I just configured my apache on CentOS 5.5. It started up. I then configured my VirtualHosts to have 2 definitions. Copied the example from the file for now. Restarted the httpd process and I get this:
Code:
Starting httpd: Warning: DocumentRoot [/home/mysite] does not exist
I cd to the dir and a basic index.html file is there. I googled the error and found the following...
Quote:
Edit /etc/sysconfig/selinux and change it to disabled then reboot.
|
Now my question is this: Why would you want/need to disable selinux? I want selinux enabled especially on a www server. Should I disable/reboot then re-enable it? Is this a 1 time deal?
None of the posts I read explained why you needed to disable it and if you could re-enable it. I tried to go to the
http://www.apache.org site and it says its not responding. So I cannot look things up there.
I found this link after some searching but I dont understand the chcon command and dont want to munge my system:
http://www.centos.org/modules/newbb/...=2147&forum=31
Code:
ls -al --contex /home
drwxr-xr-x root root system_u:object_r:file_t .
drwxr-xr-x root root system_u:object_r:root_t ..
drwx------ root root system_u:object_r:file_t lost+found
drwxr-xr-x apache apache user_u:object_r:file_t www
Code:
[root@loxww35 audit]# ls -al --contex /home/www
drwxr-xr-x apache apache user_u:object_r:file_t .
drwxr-xr-x root root system_u:object_r:file_t ..
drwxr-xr-x apache apache user_u:object_r:file_t sample1_com
drwxr-xr-x apache apache user_u:object_r:file_t sample2_com
drwxr-xr-x apache apache user_u:object_r:file_t logs
I'm still reading up on it but not sure if what I am looking at is OK or not. It looks like apache.apache is the owner of the files OK.. I just noticed this too. I am wondering why it things there are not virtual hosts? I defined 2 of them.
Code:
$ service httpd start
Starting httpd: Warning: DocumentRoot [/home/wwww/sample1_com] does not exist
Warning: DocumentRoot [/home/www/sample2_com] does not exist
[Wed Sep 01 14:03:24 2010] [warn] NameVirtualHost *:80 has no VirtualHosts
[ OK ]
Some people remove the dirs and rebuilt them. I tried this and still does not work. I even tried new names and updated the httpd.conf file to reflect that.