How to install on a shared host?
Posted: Mon Feb 26, 2007 6:07 pm
Let's assume I want to install CMSMS on a shared webhost at Pair Networks (www.pair.com).
That is a typical FreeBSD account on a machine you share with some 50-100 other users (who you don't know and can't trust).
In this kind of environment you want the following file permissions:
755 (user: rwx, group: r-x, other: r-x) for directories.
644 (user: rw-, group: r--, other: r--) for most files.
600 (user: rw-, group: ---, other: ---) for files with "secrets" like passwords and such.
User - the 'user' group consists only of the owner of the file (your account, in most cases)
Group - the 'group' group consists of the other users on the server
Other - the 'other' group consists of everyone else -- most importantly, the web server falls into the 'other' category.
The risks of not paying attention to file permissions on a shared host are very real:
http://www.pair.com/support/knowledge_b ... iwrap.html
This requires a small change to the .htacess file, to insert a few lines like this:
Action application/x-pair-sphp4 /cgi-sys/php-cgiwrap/username/php4.cgi/users/
AddType application/x-pair-sphp4 .php
AddType application/x-pair-sphp4 .htm
AddType application/x-pair-sphp4 .html
This will allow the webserver to access files as 'user' when parsing these filetypes through PHP.
Now the question is: What exactly do you have to do, in order to get CMSMS set up for this kind of environment? What are the important settings?
How about the modules? Like file permissions on Captcha (my 0.3 install creates rw-/---/--- files, which the webserver can't read from).
What files contains "secrets" that we don't want other users to see? config.php is obvious - but what else?
Running all php files as "user" adds another risk - if some of all that php code can be exploited.
Your comments and suggestions are much appreciated.
I tried a similar question here, but didn't get any response - hence the modified repost:
http://forum.cmsmadesimple.org/index.ph ... 308.0.html
That is a typical FreeBSD account on a machine you share with some 50-100 other users (who you don't know and can't trust).
In this kind of environment you want the following file permissions:
755 (user: rwx, group: r-x, other: r-x) for directories.
644 (user: rw-, group: r--, other: r--) for most files.
600 (user: rw-, group: ---, other: ---) for files with "secrets" like passwords and such.
User - the 'user' group consists only of the owner of the file (your account, in most cases)
Group - the 'group' group consists of the other users on the server
Other - the 'other' group consists of everyone else -- most importantly, the web server falls into the 'other' category.
The risks of not paying attention to file permissions on a shared host are very real:
- Other users can read your database passwords etc. if you leave the config.php file with read-access for 'group' or 'other'.
- Other users can erase files and write stuff into your web-directories if you open for write access for 'group' or 'other'.
http://www.pair.com/support/knowledge_b ... iwrap.html
This requires a small change to the .htacess file, to insert a few lines like this:
Action application/x-pair-sphp4 /cgi-sys/php-cgiwrap/username/php4.cgi/users/
AddType application/x-pair-sphp4 .php
AddType application/x-pair-sphp4 .htm
AddType application/x-pair-sphp4 .html
This will allow the webserver to access files as 'user' when parsing these filetypes through PHP.
Now the question is: What exactly do you have to do, in order to get CMSMS set up for this kind of environment? What are the important settings?
How about the modules? Like file permissions on Captcha (my 0.3 install creates rw-/---/--- files, which the webserver can't read from).
What files contains "secrets" that we don't want other users to see? config.php is obvious - but what else?
Running all php files as "user" adds another risk - if some of all that php code can be exploited.
Your comments and suggestions are much appreciated.
I tried a similar question here, but didn't get any response - hence the modified repost:
http://forum.cmsmadesimple.org/index.ph ... 308.0.html