LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Other *NIX (https://www.linuxquestions.org/questions/other-%2Anix-55/)
-   -   Apache 2 - RHEL4u5 - Permission denied: httpd: could not open error file (https://www.linuxquestions.org/questions/other-%2Anix-55/apache-2-rhel4u5-permission-denied-httpd-could-not-open-error-file-669030/)

vishwakumarbg 09-10-2008 05:16 PM

Apache 2 - RHEL4u5 - Permission denied: httpd: could not open error file
 
#cat /etc/hosts
127.0.0.1 vmrhes04-02.vishwa.net vmrhes04-02 localhost.localdomain localhost


#cat /etc/resolv.conf
search vishwa.net
nameserver x.x.x.x

#cat /var/log/httpd/error_log
(13)Permission denied: httpd: could not open error log file /test02/log/errorlog.
Unable to open logs
(13)Permission denied: httpd: could not open error log file /test02/log/errorlog.
Unable to open logs

[root@vmrhes04-02 test02]# service httpd restart
Stopping httpd: [FAILED]
Starting httpd: [FAILED]
[root@vmrhes04-02 test02]#
[root@vmrhes04-02 test02]# ls -ltR

drwxrwxrwx 2 root root 4096 Sep 10 17:26 www
drwxrwxrwx 2 root root 4096 Sep 10 17:24 log

./www:
total 8
-rwxrwxrwx 1 root root 518 Sep 10 17:26 index.html

./log:
total 12
-rwxrwxrwx 1 root root 15 Sep 10 17:28 errorlog
-rwxrwxrwx 1 root root 0 Sep 10 17:24 customlog
[root@vmrhes04-02 test02]# pwd
/test02
[root@vmrhes04-02 test02]#

cat /etc/httpd/conf/httpd.conf
.....
<VirtualHost *:80>
ServerAdmin vishwakumarbg@gmail.com
DocumentRoot /test02/www
ServerName www.cnn.com
ErrorLog /test02/log/errorlog
CustomLog /test02/log/customlog common
</VirtualHost>




QUESTION:
How to clear the error which is coming in /var/log/httpd/error_log
Permission denied ????

Your help will be Appreciated.


Rgds
vishwa
vishwakumarbg@gmail.com

Mr. C. 09-12-2008 01:53 AM

Show the output of :

Code:

ls -ld /test02/log/errorlog /test02/log /test02

sunils1973 09-13-2008 03:30 AM

ls -lZd /var/www/htdocs also

vishwakumarbg 09-15-2008 01:34 PM

I changed to /data01.

Here is the details.
---------------------------------------------------------------
[root@vmrhes04-01 conf]# tail -12 /etc/httpd/conf/httpd.conf
<Directory /data01/www>
Options FollowSymLinks Includes
AllowOverride All
</Directory>

<VirtualHost *:80>
ServerAdmin vishwakumarbg@gmail.com
DocumentRoot /data01/www/vishwa.kumar.net
ServerName vishwa.kumar.net
ErrorLog /data01/log/vknet-error_log
CustomLog /data01/log/vknet-access_log common
</VirtualHost>
---------------------------------------------------------------
[root@vmrhes04-01 conf]# ls -ld /data01/www/vishwa.kumar.net /data01/log
drwxr-xr-x 2 apache apache 4096 Sep 13 14:56 /data01/log
drwxr-xr-x 2 apache apache 4096 Sep 13 14:56 /data01/www/vishwa.kumar.net
---------------------------------------------------------------
[root@vmrhes04-01 conf]# ls -ls /data01/log/vknet-error_log /data01/log/vknet-access_log
4 -rwxr-xr-x 1 apache apache 0 Sep 13 14:56 /data01/log/vknet-access_log
4 -rwxr-xr-x 1 apache apache 0 Sep 13 14:56 /data01/log/vknet-error_log
---------------------------------------------------------------
[root@vmrhes04-01 conf]# service httpd restart
Stopping httpd: [FAILED]
Starting httpd: Warning: DocumentRoot [/data01/www/vishwa.kumar.net] does not exist
[FAILED]

---------------------------------------------------------------
[root@vmrhes04-01 conf]# ls -ld /data01 /data01/log /data01/log/vknet-error_log
drwxr-xr-x 4 apache apache 4096 Sep 13 13:37 /data01
drwxr-xr-x 2 apache apache 4096 Sep 13 14:56 /data01/log
-rwxr-xr-x 1 apache apache 0 Sep 13 14:56 /data01/log/vknet-error_log
[root@vmrhes04-01 conf]#
---------------------------------------------------------------
Error in /var/log/httpd/error_log file

(13)Permission denied: httpd: could not open error log file /data01/log/vknet-error_log.
Unable to open logs


I see the permission is apache and it is 755

Regards
Vishwakumar BG
973 216 1145
vishwakumarbg@gmail.com

Mr. C. 09-15-2008 02:36 PM

So you've changed the game on us, now we need to restart.

We need to see ALL the permissions for the directories leading from root down to /data01/log/vknet-error_log. Please take note of what I asked to see, and what you provided.

Show:

ls -ld / /data01 /data01/log /data01/log/vknet-error_log


All times are GMT -5. The time now is 12:03 PM.