LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 12-04-2008, 01:24 PM   #1
dhupke
LQ Newbie
 
Registered: Jun 2007
Posts: 19

Rep: Reputation: 0
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.
 
Old 12-04-2008, 03:44 PM   #2
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,352

Rep: Reputation: 74
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)
 
Old 12-05-2008, 06:00 AM   #3
General Failure
Member
 
Registered: Jan 2007
Location: Germany
Distribution: Slackware 13.37
Posts: 384

Rep: Reputation: 34
10.2 ships with apache-1.3.33. How did you install apache2?
 
Old 12-05-2008, 07:37 AM   #4
dhupke
LQ Newbie
 
Registered: Jun 2007
Posts: 19

Original Poster
Rep: Reputation: 0
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
 
Old 12-05-2008, 07:45 AM   #5
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,352

Rep: Reputation: 74
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
 
Old 12-10-2008, 10:43 AM   #6
dhupke
LQ Newbie
 
Registered: Jun 2007
Posts: 19

Original Poster
Rep: Reputation: 0
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
 
Old 12-10-2008, 11:56 AM   #7
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,352

Rep: Reputation: 74
No trace of httpd starting in init scripts, then ?
What does ' ps aux | grep httpd ' report ?
 
Old 12-10-2008, 03:13 PM   #8
General Failure
Member
 
Registered: Jan 2007
Location: Germany
Distribution: Slackware 13.37
Posts: 384

Rep: Reputation: 34
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.
 
Old 12-10-2008, 04:25 PM   #9
Alstare
Member
 
Registered: Jul 2003
Distribution: Slackware
Posts: 79

Rep: Reputation: 15
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.
 
Old 12-11-2008, 07:52 AM   #10
dhupke
LQ Newbie
 
Registered: Jun 2007
Posts: 19

Original Poster
Rep: Reputation: 0
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.
 
Old 12-11-2008, 01:58 PM   #11
Alstare
Member
 
Registered: Jul 2003
Distribution: Slackware
Posts: 79

Rep: Reputation: 15
You could create a symlink to the proper location if you wanted things to be more "standard".
 
Old 12-12-2008, 07:36 AM   #12
dhupke
LQ Newbie
 
Registered: Jun 2007
Posts: 19

Original Poster
Rep: Reputation: 0
Cannot restart Apache2/httpd manually

Great suggestion Alstare. Thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Have to manually restart /etc/init.d/network after pm-suspend GamerX Fedora 2 10-18-2008 10:55 PM
i had a problem when i tried to restart my pc manually in fc8 Muhammed Linux - Software 1 06-24-2008 06:01 PM
cronjob to restart httpd if httpd is dead heropage Linux - Software 1 10-31-2007 01:22 PM
manually restart X true_atlantis Linux - Newbie 1 12-26-2005 09:48 AM
Failed Httpd restart namboi Linux - Newbie 5 05-07-2005 07:23 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration