Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
apache2 not creating pid
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
LennyNero
n00b
n00b


Joined: 14 Dec 2004
Posts: 26

PostPosted: Thu Feb 01, 2007 4:02 am    Post subject: apache2 not creating pid Reply with quote

I just installed apache v2.x. Starting it does not create the pid file thus apache does not serve pages, amongst other things. During my testing, I have noticed that the pid file does appear, randomly. There is no pattern. When the pid is created, pages ARE served as expected. Very annoying, when the pid is not created however, is that pages never load nor time out.

Apache info:
Apache version:
[ebuild   R   ] net-www/apache-2.0.58-r2  USE="apache2 debug doc mpm-prefork ssl -ldap -mpm-itk -mpm-leader -mpm-peruser -mpm-threadpool -mpm-worker (-selinux) -static-modules -threads"


Currently, apache appears to be running but no pid:

Code:
boron apache2 # /etc/init.d/apache2 start
 * Starting apache2 ...                                                                                                [ ok ]
boron apache2 # netstat -ntap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      7147/apache2
boron apache2 # ls /var/run/httpd/
boron apache2 #


Permissions on /var/run/httpd are WAY loose while testing:
Code:
boron apache2 # ls /var/run/ -l
drwxrwxrwx 2 apache apache   48 Jan 31 19:36 httpd


The only parameters I have changed are:

/etc/apache2/httpd.conf:
PidFile "/var/run/httpd/apache2.pid"


/etc/apache2/vhosts.d/00_default_vhost.conf:
<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /var/www/localhost/htdocs
    ServerName boron.domain.tld
#    ErrorLog @rel_logfiledir@/dummy-host.example.com-error_log
#    CustomLog @rel_logfiledir@/dummy-host.example.com-access_log common
</VirtualHost>


My apache configuration syntax checks out:
Code:
boron apache2 # apache2 -t
Syntax OK


Log files (This is all the useful information. I can post the entire log(s) but the messages are the same):
/var/log/messages:
boron apache2 # cat /var/log/messages |grep apache
Jan 31 18:14:32 boron groupadd[6194]: new group: name=apache, GID=81
Jan 31 18:14:32 boron useradd[6204]: new user: name=apache, UID=81, GID=81, home=/var/www, shell=/sbin/nologin


/var/log/apache2/error_log:
[Wed Jan 31 19:36:38 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec2)
[Wed Jan 31 19:36:38 2007] [notice] Digest: generating secret for digest authentication ...
[Wed Jan 31 19:36:38 2007] [notice] Digest: done
[Wed Jan 31 19:36:38 2007] [notice] Apache configured -- resuming normal operations
[Wed Jan 31 19:36:52 2007] [error] [client 192.168.4.20] File does not exist: /var/www/localhost/htdocs/favicon.ico


When the pid is not created/does not exist, I am forced to kill the apache process before 'restarting':
Code:
boron apache2 # killall apache2
boron apache2 # /etc/init.d/apache2 zap
 * Manually resetting apache2 to stopped state.


OTHERWISE, I get this:
Code:
boron apache2 # /etc/init.d/apache2 restart
 * Starting apache2 ...                                                                                                [ ok ]
boron apache2 # /etc/init.d/apache2 restart
 * Stopping apache2 ...
httpd (no pid file) not running                                                                                        [ ok ]
 * Starting apache2 ...
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs                                                                                                    [ !! ]
boron apache2 #


The default webroot exists:
Code:
boron apache2 # ls -l /var/www/localhost/
total 6
drwxr-xr-x 2 apache apache   96 Jan 31 18:16 cgi-bin
drwxr-xr-x 3 apache apache  976 Jan 31 18:16 error
drwxr-xr-x 2 apache apache 1320 Jan 31 18:16 htdocs
drwxr-xr-x 3 apache apache 4600 Jan 31 18:16 icons


Additional info: I mount /var to a partition different from / (root). Could this be the issue? In my experience, I don't think so, but......
/etc/fstab:
/dev/sda1               /boot           reiserfs        noauto,noatime,notail                   1 2
/dev/sda2               none            swap            sw                                      0 0
/dev/sda3               /               reiserfs        noatime,notail                          0 1
/dev/sda5               /home           reiserfs        noatime,nodev,notail                    0 0
/dev/sda6               /var            reiserfs        noatime,notail                          0 0
/dev/sda7               /usr/portage    reiserfs        noatime,notail                          0 0
/dev/sda8               /tmp            reiserfs        noatime,nodev,nosuid,noexec,notail      0 0


I've been hacking away at this all day. Google is about as useful as a hot iron in the eye on this issue. =(

I'm rather lost and would appreciate any ideas.

Regards.

/edit:
I have gone as far as removing apache and deleting all crud emerge leaves behind (such as the init script, init conf file, apache config directory, ALL OF IT). Installing it a new makes no difference.
Back to top
View user's profile Send private message
lokelo
Tux's lil' helper
Tux's lil' helper


Joined: 16 Dec 2002
Posts: 101
Location: Maryland, USA

PostPosted: Mon Mar 19, 2007 4:53 am    Post subject: Reply with quote

I'm having exactly the same symptoms. Have you been able to come up with a solution to this? It seems that after a reboot, the system will work for a time.
Back to top
View user's profile Send private message
LennyNero
n00b
n00b


Joined: 14 Dec 2004
Posts: 26

PostPosted: Mon Mar 19, 2007 4:33 pm    Post subject: Reply with quote

I reinstalled. My hard drive was bad which I believe to be the issue.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum