Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > ISPConfig 3 Priority Support

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 26th September 2013, 18:41
skione skione is offline
Junior Member
 
Join Date: May 2013
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can't create folder or change permissions as root

I am running ubuntu 13.04 and I've installed ISPConfig control panel. The server is running an Amazon AMI with an EBS share mounted to /var/www

Here are the folder permissions I am working with:
drwxr-xr-x 3 root root 4096 Sep 26 15:12 ./
drwxr-xr-x 3 root root 4096 Sep 26 15:11 ../
lrwxrwxrwx 1 root root 30 Sep 25 21:57 snapapp.mantrais.com -> /var/www/clients/client0/web1//
drwxr-xr-x 9 root root 4096 Sep 25 21:57 web1/

Inside web1
drwxr-xr-x 2 web1 client0 4096 Sep 25 21:57 cgi-bin
drwxr-xr-x 2 root root 4096 Sep 25 21:57 log
drwx--x--- 2 web1 client0 4096 Sep 25 21:57 private
drwxr-xr-x 2 root root 4096 Sep 25 21:57 ssl
drwxrwxrwx 2 web1 client0 4096 Sep 25 21:57 tmp
drwx--x--- 11 web1 client0 4096 Sep 26 15:10 web
drwx--x--- 2 web1 client0 4096 Sep 25 21:57 webdav

If I run the following commands I get the following outputs:
root@ip-10-80-245-30:/var/www/clients/client0/web1# chmod u+w .
chmod: changing permissions of ‘.’: Operation not permitted
root@ip-10-80-245-30:/var/www/clients/client0/web1# mkdir albums
mkdir: cannot create directory ‘albums’: Permission denied
root@ip-10-80-245-30:/var/www/clients/client0/web1#

If I try and create a folder above or below web1 its no problem.
Reply With Quote
Sponsored Links
  #2  
Old 26th September 2013, 18:56
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,170
Thanks: 829
Thanked 5,412 Times in 4,255 Posts
Default

Thats correct as the folders are protected and there should be no folders created in the web1 folder. If you need custom folders, better create them in the private folder if they shall not be in the web folder.

If you really want to create a folder inside the web1 folder, then unprotect it with:

chattr -i /var/www/clients/client0/web1

and protect it again after you created the folder with:

chattr +i /var/www/clients/client0/web1

do not change the permissions of the web1 or web1/web folder if you dont want to open up your server for hackers.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 27th September 2013, 00:24
skione skione is offline
Junior Member
 
Join Date: May 2013
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found this out by googling but this is not a good way as certain frameworks store their system files outside webroot and reference by referential paths.

I need to be able to access my new folder from a web accessible location. There appears to be some restriction in places that is preventing my application from working. I need this to work they way it does on my dev server, it is crucial.

So I have a file in web the refers to a file outside web via ../folder/file when the web file gets called it gets the content from the file outside web and then loads it.
Reply With Quote
  #4  
Old 27th September 2013, 10:23
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,170
Thanks: 829
Thanked 5,412 Times in 4,255 Posts
Default

Quote:
So I have a file in web the refers to a file outside web via ../folder/file when the web file gets called it gets the content from the file outside web and then loads it.
You can create such folders if your app is not able to use the private folder which exists for this purpose like I explained above. Example:

Code:
chattr -i /var/www/clients/client0/web1
mkdir /var/www/clients/client0/web1/folder
chown web1:client0 /var/www/clients/client0/web1/folder
chattr +i /var/www/clients/client0/web1
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 27th September 2013, 14:47
skione skione is offline
Junior Member
 
Join Date: May 2013
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The problem I was subsequently having was because I had switched to mod-php at some point in an attempt to troubleshoot. Once I switched back to fastcgi I had permissions to read/write to the folder.

However I still think preventing root from creating folders there is not the best idea. As I mentioned many frameworks store folders at that level and it may not be immediately obvious (as it wasn't for me) how to get over that.

Thanks for your help
Reply With Quote
  #6  
Old 27th September 2013, 15:35
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,170
Thanks: 829
Thanked 5,412 Times in 4,255 Posts
 
Default

Quote:
However I still think preventing root from creating folders there is not the best idea. As I mentioned many frameworks store folders at that level and it may not be immediately obvious (as it wasn't for me) how to get over that.
You can disable the folder protection under system > server config.

But be aware that your customers will be able then to delete their "web" folder, which may cause the webserver to fail due to a missing document root of a vhost.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with Virtual Hosting With PureFTPd And MySQL (Incl. Quota And Bandwidth Mana ikkem HOWTO-Related Questions 33 8th June 2012 18:27
ISPConfig 2.2.37 is available for download. till General 10 19th September 2010 22:53
monit howto Jamesk5 HOWTO-Related Questions 11 5th August 2008 15:10
i am having some problem ? cobro Installation/Configuration 20 30th April 2008 16:26
cannot connect to ispconfig guidovanh Installation/Configuration 22 3rd March 2006 19:52


All times are GMT +2. The time now is 13:00.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.