Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
[root@myserver httpd]# tail -100 error_log
Unable to open logs
Unable to open logs
Unable to open logs
Unable to open logs
Unable to open logs
Unable to open logs
Unable to open logs
Unable to open logs
Unable to open logs
Unable to open logs
Unable to open logs
Unable to open logs
[root@myserver httpd]#
Code:
[root@myserver httpd]# tail /var/log/httpd/error_log
Unable to open logs
Unable to open logs
Unable to open logs
Unable to open logs
Unable to open logs
Unable to open logs
Unable to open logs
Unable to open logs
Unable to open logs
Unable to open logs
[root@myserver httpd]#
some 700 times - which added some 700 domains. 4 returned errors like "username exits" etc but that didnt stop from creating the remaining domains. And those 4 domains were added but not active - I went to Plesk and manually changed for those 4 alone.
After researching the issue(s) at hand, we have determined the following:
It seems that the permissions are wrong in /etc/httpd/logs/, which is
preventing apache to restart.
/etc/httpd/logs links to /var/logs/httpd
1. So what do I have to do with /var/logs/httpd ?
2. I did cat /etc/httpd/conf/httpd.conf but it kept scrolling.
Generally the log directory for apache is owned by user and group root,the main apache instance runs as root and fork the other threads to run as other user, usually apache user.
you have to make the directory /var/logs/httpd writable by owner of the main apache instance (the user who starts apache) and it should be root user in this case.
as you said if /etc/httpd/logs links to /var/logs/httpd, so changing the permissions for /etc/httpd/logs will change them for /var/logs/httpd and the link file always has 777 permissions.
what is the out put of these command:
Code:
ls -lad /var/log/httpd
ps aux|grep apache | grep Ss
this will show you the users and permissions so you can change them accordingly.
Generally the log directory for apache is owned by user and group root,the main apache instance runs as root and fork the other threads to run as other user, usually apache user.
you have to make the directory /var/logs/httpd writable by owner of the main apache instance (the user who starts apache) and it should be root user in this case.
as you said if /etc/httpd/logs links to /var/logs/httpd, so changing the permissions for /etc/httpd/logs will change them for /var/logs/httpd and the link file always has 777 permissions.
what is the out put of these command:
Code:
ls -lad /var/log/httpd
ps aux|grep apache | grep Ss
this will show you the users and permissions so you can change them accordingly.
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog logs/error_log
I did mention in my 5th post that I created added some 700+ domains using Plesk's command line utility (domain.sh).
Am I suppossed to be looking for <VirtualHost> somewhere else ? Because its defintely not there in httpd.conf file.
#2. In /var/www/vhosts/My-Domain1.com/statistics
Code:
[root@myserver statistics]# ls -l
total 20
drwxr-xr-x 2 root root 4096 Nov 19 07:05 anon_ftpstat
drwxr-xr-x 2 root root 4096 Dec 31 04:07 ftpstat
drwxr-xr-x 2 root root 4096 Nov 20 06:07 logs
drwxr-xr-x 2 root root 4096 Dec 31 06:07 webstat
drwxr-xr-x 2 root root 4096 Nov 19 07:05 webstat-ssl
[root@myserver statistics]#
ls -lad /var/www/vhosts/My-Domain1.com/statistics
Code:
[root@myserver statistics]# ls -lad /var/www/vhosts/My-Domain1.com/statistics
dr-xr-x--- 7 root psaserv 4096 Nov 19 07:05 /var/www/vhosts/My-Domain1.com/statistics
[root@myserver statistics]#
you may seek the VirtualHost directive in the included files, as I told you, I did not used plesk before, but I suppose that each virtual server you add will have its configuration in a seperated file and that file will be included in the main httpd.conf using the Include directive.
The last line in httpd.conf does contain Include /etc/httpd/conf/httpd.include.
I downloaded /etc/httpd/conf/httpd.include and has a lot of stuff in it.
But last 700+ lines contain
Code:
Include /var/www/vhosts/My-Domain001.com/conf/httpd.include
.
# lot of other stuff here
.
Include /var/www/vhosts/My-Domain002.com/conf/httpd.include
Include /var/www/vhosts/My-Domain002.com/conf/httpd.include
.
.
.
Include /var/www/vhosts/My-Domain700.com/conf/httpd.include
Im beginning to think if I need to replace Include /var/www/vhosts/My-Domain-xxx.com/conf/httpd.include with Include "/var/www/vhosts/My-Domain-xxx.com/conf/httpd.include" - since many domain names contain other characters. Could this be a possibility ?
Apparently this is an issue with Plesk + Linux Package settings.
Plesk requires Apache, PHP ,SSL to be recompiled to meet Plesk's requirements. http://kb.swsoft.com/article_41_260_en.html
I deleted 400 domains from 700 and all of a sudden the site's back - Apache started working again !
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.