Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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 .
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
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
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)
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)
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
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?
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.
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.....
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
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.