LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 12-30-2005, 10:37 AM   #1
anjanesh
Member
 
Registered: Sep 2004
Location: Navi Mumbai
Distribution: Ubuntu 14.04 64-bit
Posts: 230

Rep: Reputation: 30
Unable to start Apache


For some reason Apache is not starting / restarting.
Code:
[root@myserver root]# service httpd status
httpd is stopped
[root@myserver root]# service httpd start
Starting httpd:                                            [FAILED]
[root@myserver root]#
Any idea whats wrong ?

Thanks
 
Old 12-30-2005, 11:08 AM   #2
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Any helpful hints in the error_log?
 
Old 12-30-2005, 11:17 AM   #3
anjanesh
Member
 
Registered: Sep 2004
Location: Navi Mumbai
Distribution: Ubuntu 14.04 64-bit
Posts: 230

Original Poster
Rep: Reputation: 30
This is in /var/logs/httpd
Code:
[root@myserver httpd]# ls
access_log    error_log.1  ssl_access_log   ssl_error_log.2
access_log.1  error_log.2  ssl_error_log    ssl_error_log.3
error_log     error_log.3  ssl_error_log.1  ssl_request_log
[root@myserver httpd]#
Code:
[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]#
 
Old 12-30-2005, 11:42 AM   #4
dimsh
Member
 
Registered: Aug 2005
Distribution: Debian, Ubuntu, Fedora
Posts: 74

Rep: Reputation: 15
is it a new problem? was Apache working and you did some configuration so it stops ?

more information is needed to help solving the problem , also your httpd.conf Log directive will be usefull.
 
Old 12-30-2005, 12:15 PM   #5
anjanesh
Member
 
Registered: Sep 2004
Location: Navi Mumbai
Distribution: Ubuntu 14.04 64-bit
Posts: 230

Original Poster
Rep: Reputation: 30
What I did today morning was - using Plesk's command line utilities, I did
Code:
Code:
./domain.sh --create "mydomain.com" -clogin "userlogin" -ip "x.x.x.x" -login "username" -passwd "password"
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.

Could that have affected Apache ?
 
Old 12-30-2005, 12:28 PM   #6
dimsh
Member
 
Registered: Aug 2005
Distribution: Debian, Ubuntu, Fedora
Posts: 74

Rep: Reputation: 15
I do not think this may affect apache, well, I have never used plesk before.

but as the error_log says "unable to open logs" it is mostly a permissions problem.

you may check (CustomLog and ErrorLog) directives in httpd.conf to see if they are still pointing to files in an existing directory.
 
Old 01-02-2006, 09:47 PM   #7
anjanesh
Member
 
Registered: Sep 2004
Location: Navi Mumbai
Distribution: Ubuntu 14.04 64-bit
Posts: 230

Original Poster
Rep: Reputation: 30
This is what I got from support help.
Quote:
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.
 
Old 01-03-2006, 03:54 AM   #8
dimsh
Member
 
Registered: Aug 2005
Distribution: Debian, Ubuntu, Fedora
Posts: 74

Rep: Reputation: 15
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.
 
Old 01-03-2006, 03:56 AM   #9
dimsh
Member
 
Registered: Aug 2005
Distribution: Debian, Ubuntu, Fedora
Posts: 74

Rep: Reputation: 15
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.
 
Old 01-03-2006, 04:28 AM   #10
anjanesh
Member
 
Registered: Sep 2004
Location: Navi Mumbai
Distribution: Ubuntu 14.04 64-bit
Posts: 230

Original Poster
Rep: Reputation: 30
BTW, ls -l var/log/httpd gave
Code:
[root@myserver /]# ls -l var/log/httpd
total 36
-rw-r--r--  1 root root    0 Nov 20 06:02 access_log
-rw-r--r--  1 root root 2454 Nov 18 23:16 access_log.1
-rw-r--r--  1 root root 5646 Dec 30 14:49 backup_error_log.2
-rw-r--r--  1 root root    0 Jan  3 06:08 error_log
-rw-r--r--  1 root root  160 Dec 30 17:18 error_log.1
-rw-r--r--  1 root root   20 Dec 30 14:19 error_log.2
-rw-r--r--  1 root root    0 Dec 30 14:49 error_log.3
-rw-r--r--  1 root root 2394 Nov 27 06:02 error_log.4
-rw-r--r--  1 root root    0 Nov 18 15:40 ssl_access_log
-rw-r--r--  1 root root    0 Dec 31 06:02 ssl_error_log
-rw-r--r--  1 root root  882 Dec 31 04:53 ssl_error_log.1
-rw-r--r--  1 root root  378 Nov 26 07:21 ssl_error_log.2
-rw-r--r--  1 root root 2268 Nov 20 03:50 ssl_error_log.3
-rw-r--r--  1 root root    0 Nov 18 15:40 ssl_request_log
[root@myserver /]#
Isnt this right ?
dimsh - this is the output of ls -lad /var/log/httpd
Code:
[root@myserver /]# ls -lad /var/log/httpd
drwx------  2 root root 4096 Jan  3 01:56 /var/log/httpd
[root@myserver /]#

Last edited by anjanesh; 01-03-2006 at 04:30 AM.
 
Old 01-03-2006, 05:49 AM   #11
dimsh
Member
 
Registered: Aug 2005
Distribution: Debian, Ubuntu, Fedora
Posts: 74

Rep: Reputation: 15
This output is the same as I have.

it is better to point the log directly to /var/log/httpd folder

try backing up your httpd.conf and modify the CustomLog directive to show:
Code:
CustomLog /var/log/httpd/access_log common
ErrorLog "/var/log/httpd/error_log"
and in ssl.conf also
Code:
ErrorLog /var/log/httpd/ssl_error_log
CustomLog /var/log/httpd/ssl_request_log
This should fix the permission problem.

Good luck
 
Old 01-03-2006, 06:12 AM   #12
anjanesh
Member
 
Registered: Sep 2004
Location: Navi Mumbai
Distribution: Ubuntu 14.04 64-bit
Posts: 230

Original Poster
Rep: Reputation: 30
#1. BTW, I downloaded httpd.conf to my PC :
Code:
# 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]#
Are these right ?
 
Old 01-03-2006, 06:34 AM   #13
dimsh
Member
 
Registered: Aug 2005
Distribution: Debian, Ubuntu, Fedora
Posts: 74

Rep: Reputation: 15
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.
 
Old 01-03-2006, 06:57 AM   #14
anjanesh
Member
 
Registered: Sep 2004
Location: Navi Mumbai
Distribution: Ubuntu 14.04 64-bit
Posts: 230

Original Poster
Rep: Reputation: 30
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 ?
 
Old 01-03-2006, 12:23 PM   #15
anjanesh
Member
 
Registered: Sep 2004
Location: Navi Mumbai
Distribution: Ubuntu 14.04 64-bit
Posts: 230

Original Poster
Rep: Reputation: 30
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 !
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to start Apache "Cannot load /etc/httpd/modules/libphp4.so" dagalicous Linux - Software 1 03-10-2005 01:43 AM
Failed to start apache : Apache does not appear to be running : number11 Slackware 9 02-11-2005 09:51 AM
unable to start apache after installing NIC driver bcarl314 Linux - Newbie 6 09-24-2003 06:43 AM
can't get SSLl working on Apache. Apache won't start bentman78 Linux - Software 1 08-10-2003 06:17 PM
Unable to start apache because of mod_auth_mysql error krumholz Linux - General 3 07-17-2003 11:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration