View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 6 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Fri Jul 11, 2008 6:25 pm 
Offline
Joined: Wed May 09, 2007 8:47 pm
Posts: 367
Location: Minnesota- Brrrrr!
I am pointing my web browser to my KM machine and it does not return a web page. I would like to be able to perform the following tasks from SSH:

1) query the webserver's status (running \ stopped)
2) start \ stop the webserver

I am assuming that the problem is with the webserver (it was working yesterday). In addition I am also assuming that if I can ping 'mythtvhost' from a dosprompt, IE7 (DNS) is able to resolve the IP address. Any suggestions to address the tasks above or diagnose the issue are appreciated. Thank you.

_________________
R7.3: 0.22.20091023-1, Hauppauge PVR-500 (Philips FQ1236A MK4), Gigabyte Gigabyte EG45M-UD2H, E5200 2.4Ghz, 2GB RAM, NVIDIA GEFORCE 256MB


Last edited by gatorback on Fri Jul 11, 2008 6:53 pm, edited 1 time in total.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 11, 2008 6:33 pm 
Offline
Joined: Fri Apr 02, 2004 10:08 am
Posts: 1637
Location: Virginia, USA
1) use the command
Code:
ps -ef | grep apache2


2) as root
Code:
/etc/init.d/apache2 stop
/etc/init.d/apache2 start


(or just "/etc/init.d/apache2 restart" to do the same thing as a stop/start)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 11, 2008 7:17 pm 
Offline
Joined: Wed May 09, 2007 8:47 pm
Posts: 367
Location: Minnesota- Brrrrr!
I tried rebooting the mythtvhost server and noticed that during the boot sequence that there was something wrong with the apache service. If memory serves, there was a message similar to this:

Quote:
Remove it before continuing if it is corrupted.


I tried the commands (thank you) from ceenvee703:

Code:
root@mythtvhost:~#  ps -ef | grep apache2
root      3421  3318  0 21:09 ttyp0    00:00:00 grep apache2
root@mythtvhost:~# /etc/init.d/apache2 stop
Stopping web server (apache2)...(20014)Internal error: Error retrieving pid file /var/run/apache2.pid
Remove it before continuing if it is corrupted.
 failed!
root@mythtvhost:~# /etc/init.d/apache2 start
Starting web server (apache2)...(20014)Internal error: Error retrieving pid file /var/run/apache2.pid
Remove it before continuing if it is corrupted.
 failed!
root@mythtvhost:~#  ps -ef | grep apache2
root      3480  3318  0 21:10 ttyp0    00:00:00 grep apache2
root@mythtvhost:~# kill 3318
root@mythtvhost:~#  ps -ef | grep apache2
root      3482  3318  0 21:10 ttyp0    00:00:00 grep apache2


Not sure that I used the kill command correctly. Am I on the right track to restoring webserver functionality or are there additional diagnostic tests needed before determining a course of action? Thank you!


I have used RH's service command like this:
Code:
[root@flamingo init.d]# ls ht*
httpd.vmware
[root@flamingo init.d]# service httpd.vmware status
httpd (pid 4110 4106 4098 4094) is running...
[root@flamingo init.d]#

_________________
R7.3: 0.22.20091023-1, Hauppauge PVR-500 (Philips FQ1236A MK4), Gigabyte Gigabyte EG45M-UD2H, E5200 2.4Ghz, 2GB RAM, NVIDIA GEFORCE 256MB


Last edited by gatorback on Fri Jul 11, 2008 7:38 pm, edited 1 time in total.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 11, 2008 7:33 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
So do like the messages tell you and remove the pid file.

0) Become root - http://www.knoppmythwiki.org/index.php?page=BecomeRoot

1) First make sure that the server is not running:
Code:
pkill -9 -fl apache

2) Then remove the file:
Code:
rm -f /var/run/apache2.pid

3) Then restart the server:
Code:
/etc/init.d/apache2 start


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 11, 2008 9:13 pm 
Offline
Joined: Wed May 09, 2007 8:47 pm
Posts: 367
Location: Minnesota- Brrrrr!
Thanks for the suggestions tjc. Much appreciated. I tried them and found this:

Quote:
root@mythtvhost:/etc/init.d# apache2 start
Usage: apache2 [-D name] [-d directory] [-f file]
[-C "directive"] [-c "directive"]
[-k start|restart|graceful|graceful-stop|stop]
[-v] [-V] [-h] [-l] [-L] [-t] [-S]
Options:
-D name : define a name for use in <IfDefine name> directives
-d directory : specify an alternate initial ServerRoot
-f file : specify an alternate ServerConfigFile
-C "directive" : process directive before reading config files
-c "directive" : process directive after reading config files
-e level : show startup errors of level (see LogLevel)
-E file : log startup errors to file
-v : show version number
-V : show compile settings
-h : list available command line options (this page)
-l : list compiled in modules
-L : list available configuration directives
-t -D DUMP_VHOSTS : show parsed settings (currently only vhost settings)
-S : a synonym for -t -D DUMP_VHOSTS
-t -D DUMP_MODULES : show all loaded modules
-M : a synonym for -t -D DUMP_MODULES
-t : run syntax check for config files


I ended up using this:

Code:
root@mythtvhost:/etc/init.d# apache2 -k start


Note: had to remove the -l option when issuing the pkill command. Apparently it only works with pgrep.

root@mythtvhost:
Code:
/etc/init.d# pkill -9 -f apache2

root@mythtvhost:/etc/init.d#
Code:
ps -ef | grep apache2

root 4794 4764 0 23:09 ttyp4 00:00:00 grep apache2
root@mythtvhost:/etc/init.d# ps -ef | grep apache2
root 4806 4764 0 23:09 ttyp4 00:00:00 grep apache2
root@mythtvhost:
Code:
/etc/init.d# /etc/init.d/apache2 start

Starting web server (apache2)....
root@mythtvhost:/etc/init.d# ps -ef | grep apache2
root 4811 1 0 23:09 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 4812 4811 0 23:09 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 4813 4811 0 23:09 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 4814 4811 0 23:09 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 4815 4811 0 23:09 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 4816 4811 0 23:09 ? 00:00:00 /usr/sbin/apache2 -k start
root 4822 4764 0 23:09 ttyp4 00:00:00 grep apache2

_________________
R7.3: 0.22.20091023-1, Hauppauge PVR-500 (Philips FQ1236A MK4), Gigabyte Gigabyte EG45M-UD2H, E5200 2.4Ghz, 2GB RAM, NVIDIA GEFORCE 256MB


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 12, 2008 12:19 am 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
gatorback wrote:
Thanks for the suggestions tjc. Much appreciated. I tried them and found this:

Code:
root@mythtvhost:/etc/init.d# apache2 start

Sigh...
Code:
root@black2:~# type -p apache2
/usr/sbin/apache2

This is not the same. If somebody tells you to run an init script you'll notice that they _always_ tell you to use the full path, e.g. "/etc/init.d/something"

- As root '.' is not and should never be in your path for safety reasons.
- The /etc/init.d directory is also not in your path for very good although more subtle reasons. (Init scripts very often have the same name as the daemon process they start.)
- When you're given a full path for something there is usually a reason...


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 21 guests


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 post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu