LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Cannot restart Apache2/httpd manually (https://www.linuxquestions.org/questions/slackware-14/cannot-restart-apache2-httpd-manually-688351/)

dhupke 12-04-2008 02:24 PM

Cannot restart Apache2/httpd manually
 
I'm running Slackware 10.2 and I am trying to manually restart apache2 service with no luck.

I've tried the command /etc/rc.d/rc.httpd stop|start|restart , but after looking in /etc/rc.d, rc.httpd is not listed. Hence the error:

-bash: /etc/rc.d/rc.httpd: No such file or directory

I tried running apachectl stop
error:
/usr/sbin/apachectl stop: httpd (no pid file) not running

I tried apachectl start
error:
/usr/sbin/apachectl: line 86: /usr/sbin/httpd: No such file or directory
/usr/sbin/apachectl start: httpd could not be started

I tried apachectl restart
error:
/usr/sbin/apachectl: line 120: /usr/sbin/httpd: No such file or directory
/usr/sbin/apachectl restart: httpd could not be started

Right now, the only way I can restart Apache is to reboot the machine.

Any help would be much appreciated.

Thank you.

keefaz 12-04-2008 04:44 PM

Please post output with: ls -l /etc/rc.d
and with: grep httpd /etc/rc.d/*
There should be a script here that starts apache (if it is started when you boot)

General Failure 12-05-2008 07:00 AM

10.2 ships with apache-1.3.33. How did you install apache2?

dhupke 12-05-2008 08:37 AM

Cannot restart Apache2/httpd manually
 
Here are the results. The biggest problem is that I don't know how Apache2 was installed. This was done by a previous Admin that was not here when I got here. So your guess is as good as anybody's...

Thanks

ls -l /etc/rc.d

total 213
lrwxrwxrwx 1 root root 4 2006-07-12 17:14 rc.0 -> rc.6*
-rwxr-xr-x 1 root root 893 2003-01-29 15:43 rc.4*
-rwxr-xr-x 1 root root 5764 2005-08-01 13:12 rc.6*
-rwxr-xr-x 1 root root 1989 2004-06-21 09:04 rc.K*
-rwxr-xr-x 1 root root 8144 2005-07-24 18:00 rc.M*
-rwxr-xr-x 1 root root 10996 2005-08-04 14:29 rc.S*
-rwxr-xr-x 1 root root 466 2004-11-05 02:20 rc.acpid*
-rwxr-xr-x 1 root root 1650 2005-07-22 13:41 rc.alsa*
-rw-r--r-- 1 root root 1031 2003-09-21 14:07 rc.bind
-rw-r--r-- 1 root root 3942 2005-01-04 20:13 rc.cups
-rw-r--r-- 1 root root 512 2005-09-12 23:13 rc.dnsmasq
-rwxr-xr-x 1 root root 119 2004-05-29 23:19 rc.font.new*
-rwxr-xr-x 1 root root 1156 2006-07-12 17:25 rc.gpm*
-rwxr-xr-x 1 root root 1529 2005-09-04 12:57 rc.hotplug*
-rwxr-xr-x 1 root root 8270 2005-09-07 15:44 rc.inet1*
-rw-r--r-- 1 root root 3579 2008-08-01 17:32 rc.inet1.conf
-rw-r--r-- 1 root root 3583 2008-08-01 17:32 rc.inet1.conf~
-rwxr-xr-x 1 root root 5267 2005-07-24 16:01 rc.inet2*
-rwxr-xr-x 1 root root 497 2003-09-11 22:27 rc.inetd*
-rw-r--r-- 1 root root 1924 2003-09-13 18:10 rc.ip_forward
-rwxr-xr-x 1 root root 247 2006-08-31 17:09 rc.local*
-rwxr-xr-x 1 root root 226 2006-07-14 14:29 rc.local~*
-rwxr-xr-x 1 root root 25400 2005-06-05 22:41 rc.modules*
-rwxr-xr-x 1 root root 2300 2005-08-27 21:53 rc.mysqld*
-rwxr-xr-x 1 root root 2389 2004-06-06 16:52 rc.nfsd*
-rwxr-xr-x 1 root root 4790 2004-10-28 00:30 rc.pcmcia*
-rw-r--r-- 1 root root 905 2003-09-13 18:38 rc.portmap
-rw-r--r-- 1 root root 1169 2005-07-24 19:11 rc.saslauthd
-rwxr-xr-x 1 root root 687 2002-06-04 16:09 rc.sendmail*
-rwxr-xr-x 1 root root 2895 2005-09-12 23:40 rc.serial*
-rwxr-xr-x 1 root root 1585 2006-07-12 23:18 rc.sqlrelay*
-rwxr-xr-x 1 root root 1222 2005-09-01 09:46 rc.sshd*
-rwxr-xr-x 1 root root 860 2004-05-02 17:07 rc.syslog*
-rwxr-xr-x 1 root root 1740 1999-09-11 15:48 rc.sysvinit*
-rw-r--r-- 1 root root 1396 2005-07-30 13:14 rc.udev
-rwxr-xr-x 1 root root 8293 2005-07-25 02:19 rc.wireless*
-rw------- 1 root root 7320 2005-07-25 02:19 rc.wireless.conf





grep httpd /etc/rc.d/*

/etc/rc.d/rc.0:if [ -x /etc/rc.d/rc.httpd ]; then
/etc/rc.d/rc.0: /etc/rc.d/rc.httpd stop
/etc/rc.d/rc.6:if [ -x /etc/rc.d/rc.httpd ]; then
/etc/rc.d/rc.6: /etc/rc.d/rc.httpd stop
/etc/rc.d/rc.K:if [ -x /etc/rc.d/rc.httpd ]; then
/etc/rc.d/rc.K: /etc/rc.d/rc.httpd stop
/etc/rc.d/rc.M:if [ -x /etc/rc.d/rc.httpd ]; then
/etc/rc.d/rc.M: . /etc/rc.d/rc.httpd start

keefaz 12-05-2008 08:45 AM

Weird, maybe the old admin set apache starter script as sys V style...
could you post the output with:
Code:

grep -rln httpd /etc/init.d
Or maybe with:
Code:

grep -rln httpd /etc/rc.d

dhupke 12-10-2008 11:43 AM

Cannot restart Apache2/httpd manually
 
Here are the results:

grep: /etc/init.d: No such file or directory

grep -rln httpd /etc/rc.d
/etc/rc.d/rc.0
/etc/rc.d/rc.6
/etc/rc.d/rc.K
/etc/rc.d/rc.M

Thanks,
Dave

keefaz 12-10-2008 12:56 PM

No trace of httpd starting in init scripts, then ?
What does ' ps aux | grep httpd ' report ?

General Failure 12-10-2008 04:13 PM

You need to find out where the old admin started apache. This will be somewhere in the scripts in /etc/rc.d. You have it mentioned (at least) in rc.K and rc.M. 0 is halt, 6 is reboot, K is single user and M is multi-user. I'd say: Check if apache is started through those files, stop that and install the stock apache.

Alstare 12-10-2008 05:25 PM

I think all those references are from the default apache 1.8 install, which has clearly been altered since with the install of Apache 2.

keefaz's suggestion of running his previously mentioned command should give you some insight on what is going on.

Report back with the results and we will be able to help more.

dhupke 12-11-2008 08:52 AM

keefaz-

Your suggestion was very helpful... I'm not really understanding why it was setup this way, but that's for another time.

ps aux | grep httpd
root 18649 0.1 0.5 12104 4616 ? Ss 07:45 0:00 /usr/local/apache2/bin/httpd -k start
nobody 18650 0.0 0.5 12104 4632 ? S 07:45 0:00 /usr/local/apache2/bin/httpd -k start
nobody 18651 0.0 0.5 12104 4632 ? S 07:45 0:00 /usr/local/apache2/bin/httpd -k start
nobody 18652 0.0 0.5 12104 4632 ? S 07:45 0:00 /usr/local/apache2/bin/httpd -k start
nobody 18653 0.0 0.5 12104 4632 ? S 07:45 0:00 /usr/local/apache2/bin/httpd -k start
nobody 18654 0.0 0.5 12104 4632 ? S 07:45 0:00 /usr/local/apache2/bin/httpd -k start

To start|stop|restart Apache on this box, I need to use the command

/usr/local/apache2/bin/httpd -k start|stop|restart

Thank you all for your suggestions.

Alstare 12-11-2008 02:58 PM

You could create a symlink to the proper location if you wanted things to be more "standard".

dhupke 12-12-2008 08:36 AM

Cannot restart Apache2/httpd manually
 
Great suggestion Alstare. Thanks.


All times are GMT -5. The time now is 05:37 AM.