LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-07-2006, 09:39 AM   #1
grob115
Member
 
Registered: Oct 2005
Posts: 542

Rep: Reputation: 32
Web server not serving pages...


Hello,

My web server has for some reason stopped serving pages. I checked DNS records, ping the web server, all seems okay. But running "top" returned the following and it doesn't appear that Apache is running. I issued the "apachectl graceful" to restart Apache but still the same. Can someone provide any idea of what I can try to do?

86 processes: 84 sleeping, 2 running, 0 zombie, 0 stopped
CPU states: 0.8% user, 0.8% system, 0.0% nice, 98.4% idle
Mem: 497968K av, 428988K used, 68980K free, 0K shrd, 50892K buff
Swap: 2096472K av, 40584K used, 2055888K free 276248K cached

PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
15 root 10 0 0 0 0 SW 0.2 0.0 2:34 kjournald
521 root 12 0 364 320 244 S 0.2 0.0 1:11 syslogd
1538 root 18 0 348 220 140 S 0.2 0.0 0:16 sshd
16304 root 19 0 1580 1532 1232 S 0.2 0.3 0:00 sshd
16305 root 19 0 1580 1532 1232 S 0.2 0.3 0:00 sshd
1 root 8 0 112 72 48 S 0.0 0.0 0:04 init
2 root 9 0 0 0 0 SW 0.0 0.0 0:00 keventd
3 root 9 0 0 0 0 SW 0.0 0.0 0:00 kapmd
4 root 19 19 0 0 0 SWN 0.0 0.0 0:00 ksoftirqd_CPU0
5 root 9 0 0 0 0 SW 0.0 0.0 0:01 kswapd
6 root 9 0 0 0 0 SW 0.0 0.0 0:00 kscand/DMA
7 root 13 0 0 0 0 SW 0.0 0.0 13:03 kscand/Normal
8 root 9 0 0 0 0 SW 0.0 0.0 0:00 kscand/HighMem
9 root 9 0 0 0 0 SW 0.0 0.0 0:00 bdflush
10 root 9 0 0 0 0 SW 0.0 0.0 0:00 kupdated
11 root -1 -20 0 0 0 SW< 0.0 0.0 0:00 mdrecoveryd
137 root 9 0 0 0 0 SW 0.0 0.0 0:00 kjournald
 
Old 05-07-2006, 10:26 AM   #2
nabeelmoidu
Member
 
Registered: Jul 2005
Location: Bangalore
Distribution: Fedora
Posts: 71

Rep: Reputation: 15
top needn't show everything

do a ps -ef | grep httpd
or
ps -ef | grep apache

and see if its running

if not try starting it manually without the apachectl script by executing it from its actual location like /usr/local/apache/bin/httpd
 
Old 05-07-2006, 10:29 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,158
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
You can run:
Code:
apachectl start
to start it. Also you can take a look at the apache error_log to see if you find out the reason that it's not running
 
Old 05-07-2006, 10:33 AM   #4
grob115
Member
 
Registered: Oct 2005
Posts: 542

Original Poster
Rep: Reputation: 32
Hello,

Thank you for the replies!
It returned the following:

[root@ns1 /]# ps -ef | grep apache
apache 15953 8884 0 07:44 ? 00:00:04 /usr/sbin/httpd -DHAVE_ACCESS -D
apache 15954 8884 0 07:44 ? 00:00:04 /usr/sbin/httpd -DHAVE_ACCESS -D
apache 15955 8884 0 07:44 ? 00:00:03 /usr/sbin/httpd -DHAVE_ACCESS -D
apache 15956 8884 0 07:44 ? 00:00:04 /usr/sbin/httpd -DHAVE_ACCESS -D
apache 15957 8884 0 07:44 ? 00:00:03 /usr/sbin/httpd -DHAVE_ACCESS -D
apache 15958 8884 0 07:44 ? 00:00:04 /usr/sbin/httpd -DHAVE_ACCESS -D
apache 15959 8884 0 07:44 ? 00:00:03 /usr/sbin/httpd -DHAVE_ACCESS -D
apache 15960 8884 0 07:44 ? 00:00:02 /usr/sbin/httpd -DHAVE_ACCESS -D

Does it mean it's running normally? Also there is no /apache/bin/httpd under /usr/local/.... Where can I find the error log?
 
Old 05-07-2006, 10:40 AM   #5
nabeelmoidu
Member
 
Registered: Jul 2005
Location: Bangalore
Distribution: Fedora
Posts: 71

Rep: Reputation: 15
well it does mean apache is running .
You can also try out this and see which port the httpd process is listening to
netstat -atnp
Check for the port corresponding to the httpd process- normally 80.

then try telnetting to that port from the localhost and then from any other machine.
If it works the server is properly listening .If not you will have to check for firewall issues most probably.

The location of the httpd binary can differ in each installation .But the logs are generally in /var/log/httpd or in /var/log/messages . Try out the former steps first , it appears your apache is running .
 
Old 05-07-2006, 11:05 AM   #6
grob115
Member
 
Registered: Oct 2005
Posts: 542

Original Poster
Rep: Reputation: 32
Hello,

Um... I think it is saying port 80 (just like you said) but telneting doesn't seem to work...? I'm not very familiar with telnet...
[root@ns1 /]# telnet 0.0.0.0:80
telnet: 0.0.0.0:80: Name or service not known


[root@ns1 /]# netstat -atnp
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:993 0.0.0.0:* LISTEN 17275/couriertcpd
tcp 0 0 127.0.0.1:36130 0.0.0.0:* LISTEN 13274/xinetd
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 17296/couriertcpd
tcp 0 0 0.0.0.0:106 0.0.0.0:* LISTEN 13274/xinetd
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 12390/mysqld
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 17285/couriertcpd
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 17263/couriertcpd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 546/portmap
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 8884/httpd
tcp 0 0 0.0.0.0:10000 0.0.0.0:* LISTEN 2251/perl
tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 13274/xinetd
tcp 0 0 64.34.105.69:53 0.0.0.0:* LISTEN 13652/named
tcp 0 0 64.34.105.68:53 0.0.0.0:* LISTEN 13652/named
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 13652/named
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 13274/xinetd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1538/sshd
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 13652/named
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 13274/xinetd
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 8884/httpd
tcp 0 0 0.0.0.0:8443 0.0.0.0:* LISTEN 30807/httpsd
tcp 0 0 0.0.0.0:65500 0.0.0.0:* LISTEN 2284/xc
tcp 0 0 64.34.105.69:80 72.30.102.28:55213 TIME_WAIT -
tcp 0 0 64.34.105.68:22 59.37.70.24:36220 ESTABLISHED 21903/sshd
tcp 0 300 64.34.105.69:22 221.127.92.37:64983 ESTABLISHED 15684/sshd
tcp 0 0 64.34.105.69:22 59.37.70.24:36163 ESTABLISHED 21902/sshd
 
Old 05-07-2006, 11:11 AM   #7
nabeelmoidu
Member
 
Registered: Jul 2005
Location: Bangalore
Distribution: Fedora
Posts: 71

Rep: Reputation: 15
use
telnet localhost 80

then if you get a response or the screen goes blank(one of the two will happen)

try opening http://localhost in the browser

then try http://serverip from the remote machine .
If the latter doesn't work then try
telnet serverip 80
from the remote machine and then doesn't respond check for firewalls on either your web server or your remote machine
 
Old 05-07-2006, 11:23 AM   #8
grob115
Member
 
Registered: Oct 2005
Posts: 542

Original Poster
Rep: Reputation: 32
Hello,

There are actually quite a few error logs. They are named error_log, error_log.1, error_log.2, etc. Most of them contain the same thing and are about a file not found error.

What I found interesting is that they are all reporting file not found in the directory /home/httpd/vhosts/default/htdocs/ but all my web pages are on /home/httpd/vhosts/canreef.com/httpdocs/. Is this the reason why the server is not able to load the pages? Because it is looking at the wrong place?

Here's a snippet of what one looks like:

[Sun May 7 04:02:05 2006] [notice] Apache/1.3.27 configured -- resuming normal operations
[Sun May 7 04:02:05 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun May 7 04:02:05 2006] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Sun May 7 04:58:04 2006] [notice] caught SIGTERM, shutting down
[Sun May 7 04:58:06 2006] [notice] Apache/1.3.27 configured -- resuming normal operations
[Sun May 7 04:58:06 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun May 7 04:58:06 2006] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Sun May 7 06:58:19 2006] [error] [client 205.177.72.51] File does not exist: /home/httpd/vhosts/default/htdocs/a1b2c3d4e5f6g7h8i9/nonexistentfile.php
[Sun May 7 06:58:19 2006] [error] [client 205.177.72.51] File does not exist: /home/httpd/vhosts/default/htdocs/adxmlrpc.php
[Sun May 7 06:58:19 2006] [error] [client 205.177.72.51] File does not exist: /home/httpd/vhosts/default/htdocs/adserver/adxmlrpc.php
[Sun May 7 06:58:19 2006] [error] [client 205.177.72.51] File does not exist: /home/httpd/vhosts/default/htdocs/phpAdsNew/adxmlrpc.php
[Sun May 7 06:58:19 2006] [error] [client 205.177.72.51] File does not exist: /home/httpd/vhosts/default/htdocs/phpadsnew/adxmlrpc.php
......more of the same thing, and then.....
[Sun May 7 07:44:09 2006] [notice] SIGUSR1 received. Doing graceful restart
[Sun May 7 07:44:09 2006] [notice] Apache/1.3.27 configured -- resuming normal operations
[Sun May 7 07:44:09 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun May 7 07:44:09 2006] [notice] Accept mutex: sysvsem (Default: sysvsem)
 
Old 05-07-2006, 11:27 AM   #9
nabeelmoidu
Member
 
Registered: Jul 2005
Location: Bangalore
Distribution: Fedora
Posts: 71

Rep: Reputation: 15
in your httpd.conf what have you specified as your document root?
 
Old 05-07-2006, 11:29 AM   #10
grob115
Member
 
Registered: Oct 2005
Posts: 542

Original Poster
Rep: Reputation: 32
Hello,

Well it does give me a response when I typed "telnet localhost 80". But did you want me to open Internet Explorer and actually type "http://localhost" and "http://serveip"? Because either returns a blank page. And "telnet serverip 80" returned "telnet: serverip: Name or service not known"

Here's a copy of the SSH screen capture to the server:
[root@ns1 vhosts]# telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
^]
telnet> http://localhost
?Invalid command
telnet> http://serveip
?Invalid command
telnet> exit
?Invalid command
telnet> q
Connection closed.
[root@ns1 vhosts]# telnet serverip 80
telnet: serverip: Name or service not known
serverip: Unknown host

Quote:
Originally Posted by nabeelmoidu
use
telnet localhost 80

then if you get a response or the screen goes blank(one of the two will happen)

try opening http://localhost in the browser

then try http://serverip from the remote machine .
If the latter doesn't work then try
telnet serverip 80
from the remote machine and then doesn't respond check for firewalls on either your web server or your remote machine
 
Old 05-07-2006, 11:36 AM   #11
grob115
Member
 
Registered: Oct 2005
Posts: 542

Original Poster
Rep: Reputation: 32
Hello,

Well I found two places where it references DocumentRoot. So I guess /var/www/html should be changed to /home/httpd/vhosts/canreef.com/httpdocs/?

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/html"

# Each directory to which Apache has access, can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# permissions.
#
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>


#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/var/www/html">

Quote:
Originally Posted by nabeelmoidu
in your httpd.conf what have you specified as your document root?
 
Old 05-07-2006, 11:43 AM   #12
nabeelmoidu
Member
 
Registered: Jul 2005
Location: Bangalore
Distribution: Fedora
Posts: 71

Rep: Reputation: 15
Well two things

first in my earlier post when i wrote serverip , i wanted you to substitute that term with the ip address of your web server or its domain name. and your telnet to the port was succesfull , thats why it gave a message
connected to localhost
In this case you needn't go ahead in this direction coz your error seems to be something else , but just in case you need it in future , telnet to a port will check the connectivity to a port on a machine and in fact if you know the actual HTTP protocol commands you can interactively see the default page too .try GET /index.html immediately after you get connected to the port 80 of the localhost.Anyway all that later.

Here your problem seems to be the document root setting .Change it , restart apache and then see if you have the error.In case you get it working , please send a small post that its working.
 
Old 05-07-2006, 11:57 AM   #13
grob115
Member
 
Registered: Oct 2005
Posts: 542

Original Poster
Rep: Reputation: 32
Hello,

Oh okay. I made the following changes:
DocumentRoot "/var/www/html"
to
DocumentRoot "/home/httpd/vhosts/canreef.com/httpdocs/"

and

<Directory "/var/www/html">
to
<Directory "/home/httpd/vhosts/canreef.com/httpdocs/">

and then issued the restart command:
[root@ns1 conf]# apachectl graceful
/usr/sbin/apachectl graceful: httpd gracefully restarted

I know you said goto Apache's directory and manually restart it but I'm not sure how to find the directory and what command to use to manually restart it. Anyway, it still doesn't work.....
 
Old 05-07-2006, 12:03 PM   #14
nabeelmoidu
Member
 
Registered: Jul 2005
Location: Bangalore
Distribution: Fedora
Posts: 71

Rep: Reputation: 15
Well I didn't mean it that way this time.What I meant was exactly what u did :-)

check out the error logs and see if there are any errors.
I guess someone else will have to come over because its getting too late for me , and I have to leave
 
Old 05-07-2006, 12:11 PM   #15
grob115
Member
 
Registered: Oct 2005
Posts: 542

Original Poster
Rep: Reputation: 32
Hello,

Well the error_log file still hasn't changed. Not sure why. A few things:
1) /home/httpd/vhosts/default/htdocs/ does exist
2) The original document root wasn't set to this though. It was 'DocumentRoot "/var/www/html"'

So how did "/var/www/html" get translated into "/home/httpd/vhosts/default/htdocs/"? Or what I'm seeing in these error_log files aren't saying that's where the webserver has been trying to look for the webpages?

Thanks for your help.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Web server in local network serving to internet librano Linux - Networking 1 04-25-2006 02:58 PM
ADSL Router Web configuration pages appears instead of Personal Web Server Pages procyon Linux - Networking 4 12-20-2004 05:44 PM
multiple boxes serving web pages peteABK Linux - Networking 7 09-11-2003 03:16 PM
Can't access Linux web server web pages from LAN client jaydave Linux - Networking 4 03-16-2003 02:38 AM
serving web pages on another port iggymac Linux - Networking 3 03-21-2002 01:21 PM

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

All times are GMT -5. The time now is 06:51 AM.

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