apache file location
Hello.
I have virtual hosts set up with the following on an apache server, running CentOS 4.4. Code:
# get the server name from the Host: header This works well, however i want the DocumentRoot to be on a diffrent partition, with the mount point /www Partition is fine however when i change the code to this: Code:
# include the server name in the filenames used to satisfy requests Quote:
|
Are you sure that not only your user account has access to mounted www? Apache httpd loves to switch uid to nobody, www, apache, daemon or httpd.
|
That sounds like it could be a likly problem! It was set up when linux was installed on the server, so perhaps only root can. How can i change this?
(i just tried to create a file on it as another user, and it also denied permision). |
Well, you can either 'chmod a+rX -R' the directory, so it will be readable to everybody, or 'chown -R ' it, but then you will have to know apache username (it can be found in httpd.conf). If you want, you can read manual for chmod, chown, chgrp and usermod and make a directory that belongs to root, has group apache (or nogroup - you can name it as you wish), that group has httpd pseudo user as member, and permissions are 'a-w o-r g+r'. That way neither making apache misbehave allows modifications nor other means of getting local user rights allow reading the files, which is a bit better from security point of view (surely, applying critical security patches in time is much better anyway).
|
Ok, have played around with that a little and this is what i have know.
The partition /www cannot be alter by any user other than root: drwxr-xr-x 7 root root 4096 Jan 2 23:03 www I like this as there will be lots of uses folder in there, and i odviously dont want them to able to create there own, or delet others! If i place a folder in /www/ and chown it so the user owns it then they can eddit it them selves. However apache still throughs back this error to the web browser: Quote:
- Thanks, so far you have all been very helpful! |
OK. Please find and post all sections inside <Directory> tags in httpd.conf and included sites. Maybe it will be so that /var/www/html is governed by any of them (which allows all access), and /www not.
|
All of them, in order, exactly as they are. (My error pages are still in /var/www/error)
Quote:
|
Not sure what help this may be but if i change DocumentRoot "/var/www/html" to DocumentRoot "/www/" when i restart apache i get:
Starting httpd: Syntax error on line 265 of /etc/httpd/conf/httpd.conf: DocumentRoot must be a directory [FAILED] |
I think the directory thing has to be the problem! Anyone got any thought where ive gone wrong?
|
Well, post line 265 then... I am not sure it handles httpd.conf correctly while there are errors.
Sorry, missed previous thread notification when looked through subscriptions |
At my place of work we use RHeL running apache2 and all of our vhost's root folders need to be in the apache group. Then all the folders inside can be owned by the user.
This is on my actual shared server: Code:
-bash-3.00$ ls -la | grep analext |
Line 265: 265DocumentRoot "/www/"
(sorry i ment the stuff in the <directory> tags).... I tried chwon apache:apache and it makes no diffrence! All very strange. |
Er.. I guess 265 is not part of the line? Is this line inside any section? Did you try removing trailing slash?
|
sorry, the 265 is not in it! tried taking out the / and still no diffrent....
When i try to start the service i get the folowing error: Starting httpd: Syntax error on line 265 of /etc/httpd/conf/httpd.conf: DocumentRoot must be a directory [FAILED] How can it not be a directory? |
Quote:
|
All times are GMT -5. The time now is 04:35 AM. |