LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 10-23-2009, 08:17 AM   #1
vonbiber
Member
 
Registered: Apr 2009
Distribution: slackware
Posts: 299

Rep: Reputation: 50
can't access local server (slackware 12.2)


on my slackware 12.2 box I can't access local server.
I was able to in the past and I haven't modified the config
files lately (http.conf, ...).
The exit code of
Code:
/etc/rc.d/rc.httpd start
is 0.
The file
Code:
/var/log/httpd/error_log
doesn't report any errors.
And yet when I try to go to any of these addresses
Code:
http://localhost/
http://127.0.0.1/
http://127.0.0.1:80/
in my browser, it takes for ever to load and eventually I'd get an error page:
...
Could not connect to remote server
...

Have I missed something on my checklist?
 
Old 10-23-2009, 08:22 AM   #2
stormtracknole
Member
 
Registered: Aug 2005
Location: The Big Easy
Distribution: Slackware, RHEL
Posts: 825

Rep: Reputation: 106Reputation: 106
Quote:
Originally Posted by vonbiber View Post
on my slackware 12.2 box I can't access local server.
I was able to in the past and I haven't modified the config
files lately (http.conf, ...).
The exit code of
Code:
/etc/rc.d/rc.httpd start
is 0.
The file
Code:
/var/log/httpd/error_log
doesn't report any errors.
And yet when I try to go to any of these addresses
Code:
http://localhost/
http://127.0.0.1/
http://127.0.0.1:80/
in my browser, it takes for ever to load and eventually I'd get an error page:
...
Could not connect to remote server
...

Have I missed something on my checklist?
What do you get when you run this command:
Code:
ps -ef | grep httpd
 
Old 10-23-2009, 09:12 AM   #3
vonbiber
Member
 
Registered: Apr 2009
Distribution: slackware
Posts: 299

Original Poster
Rep: Reputation: 50
Code:
# ps -ef | grep httpd
root      2597     1  0 15:12 ?        00:00:00 /usr/sbin/httpd -k start
apache    2598  2597  0 15:12 ?        00:00:00 /usr/sbin/httpd -k start
apache    2600  2597  0 15:12 ?        00:00:00 /usr/sbin/httpd -k start
apache    2601  2597  0 15:12 ?        00:00:00 /usr/sbin/httpd -k start
apache    2602  2597  0 15:12 ?        00:00:00 /usr/sbin/httpd -k start
apache    2603  2597  0 15:12 ?        00:00:00 /usr/sbin/httpd -k start
root      2605  2590  0 15:12 pts/2    00:00:00 grep httpd
 
Old 10-23-2009, 10:13 AM   #4
stormtracknole
Member
 
Registered: Aug 2005
Location: The Big Easy
Distribution: Slackware, RHEL
Posts: 825

Rep: Reputation: 106Reputation: 106
Take a look at /var/www/htdocs and make sure you still have an index.html file. Sometimes, it gets replaced during upgrades.
 
Old 10-23-2009, 10:30 AM   #5
vonbiber
Member
 
Registered: Apr 2009
Distribution: slackware
Posts: 299

Original Poster
Rep: Reputation: 50
Quote:
Originally Posted by stormtracknole View Post
Take a look at /var/www/htdocs and make sure you still have an index.html file. Sometimes, it gets replaced during upgrades.
no, it's still there.
besides if it were missing I'd get the contents of the directory
but no error message
Before that I tried some php pages that I wrote and I know
that php is working because
Code:
php -i
displayed phpinfo contents
 
Old 10-23-2009, 10:44 AM   #6
manwichmakesameal
Member
 
Registered: Aug 2006
Distribution: Slackware
Posts: 800

Rep: Reputation: 100Reputation: 100
What kind of firewall rules do you have in place?
 
Old 10-23-2009, 11:37 AM   #7
vonbiber
Member
 
Registered: Apr 2009
Distribution: slackware
Posts: 299

Original Poster
Rep: Reputation: 50
Quote:
Originally Posted by manwichmakesameal View Post
What kind of firewall rules do you have in place?
I never touched these. I kept the default settings that came with
the slackware installation.
So I guess there are none.
 
Old 10-23-2009, 07:38 PM   #8
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 227Reputation: 227Reputation: 227
Code:
apachectl -t
Will show any errors in your config.

Code:
netstat -ltp| fgrep http
Will show you if you have a http server listening on a port.

Did you specify a "Listen" directive in your httpd.conf?

The Default is "Listen 80"

If you bind the httpd server to a specific ip address then it won't listen on localhost unless told to do so.
 
Old 10-24-2009, 06:36 AM   #9
vonbiber
Member
 
Registered: Apr 2009
Distribution: slackware
Posts: 299

Original Poster
Rep: Reputation: 50
Quote:
Originally Posted by mRgOBLIN View Post
Code:
apachectl -t
Will show any errors in your config.
I already ran that command. There are no syntax errors in the config.

Quote:
Code:
netstat -ltp| fgrep http
Will show you if you have a http server listening on a port.
I'll try that later. Right now httpd is not running.

Quote:
Did you specify a "Listen" directive in your httpd.conf?
The Default is "Listen 80"
If you bind the httpd server to a specific ip address then it won't listen on localhost unless told to do so.
I didn't change the original settings and in my browser
even
Code:
http://127.0.0.1:80/
didn't work

And, by the way, I don't have that issue with slax
(with xampp).
 
Old 10-24-2009, 08:56 AM   #10
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 227Reputation: 227Reputation: 227
Not running through a proxy of any kind?
 
Old 10-24-2009, 09:12 AM   #11
vonbiber
Member
 
Registered: Apr 2009
Distribution: slackware
Posts: 299

Original Poster
Rep: Reputation: 50
Quote:
Originally Posted by mRgOBLIN View Post
Not running through a proxy of any kind?
nope
 
Old 10-24-2009, 10:13 AM   #12
stormtracknole
Member
 
Registered: Aug 2005
Location: The Big Easy
Distribution: Slackware, RHEL
Posts: 825

Rep: Reputation: 106Reputation: 106
Just for the heck of it, type this as root:
Code:
iptables -nvL
and post the results.

Also, on your httpd.conf file, look for this section (ServerName www.example.com:80) to see what it says.

Last, but not least, take a look at /etc/hosts.allow and /etc/hosts.deny to make sure that nothing there is being block.
 
Old 10-25-2009, 07:15 AM   #13
vonbiber
Member
 
Registered: Apr 2009
Distribution: slackware
Posts: 299

Original Poster
Rep: Reputation: 50
Quote:
Originally Posted by stormtracknole View Post
Just for the heck of it, type this as root:
Code:
iptables -nvL
and post the results.
Code:
# iptables -nvL
FATAL: Module ip_tables not found.
iptables v1.4.2: can't initialize iptables table `filter': iptables who
? (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
Quote:
Also, on your httpd.conf file, look for this section (ServerName www.example.com:80) to see what it says.
Here's what I have
Code:
#
#ServerName www.example.com:80
ServerName 127.0.0.1:80
#
Quote:
Last, but not least, take a look at /etc/hosts.allow and /etc/hosts.deny to make sure that nothing there is being block.
There's nothing in there, just comments

@mRgOBLIN
Code:
# netstat -ltp | fgrep http
tcp    0  0 *:http  *:*   LISTEN      2221/httpd
 
Old 10-25-2009, 02:00 PM   #14
stormtracknole
Member
 
Registered: Aug 2005
Location: The Big Easy
Distribution: Slackware, RHEL
Posts: 825

Rep: Reputation: 106Reputation: 106
The iptables command needs to be done as root. I doubt this is the problem though. Go ahead and comment out the ServerName section. I don't think it is necessary to manually put in 127.0.0.1 in there. Once you make the change, go ahead and restart the service:
Code:
/etc/rc.d/rc.httpd restart
 
Old 10-27-2009, 06:04 AM   #15
vonbiber
Member
 
Registered: Apr 2009
Distribution: slackware
Posts: 299

Original Poster
Rep: Reputation: 50
Thanks for the suggestion about /etc/httpd/httpd.conf
I commented out the ServerName line and restarted apache
and that did the trick
However every time the daemon would start I'd get this message
Code:
httpd: Could not reliably determine the server's fully qualified  domain name, using 127.0.0.1 for ServerName
So I thought I would put this line instead
Code:
ServerName localhost
It worked and this time I didn't get the annoying message.

Again, thanks a lot to everybody who tried to help

Quote:
Originally Posted by stormtracknole View Post
The iptables command needs to be done as root.
I ran all the commands as root
 
  


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
Allow only local access to apache server monkeyman2000 Linux - Server 4 07-01-2008 10:57 PM
How to access local web server? Libertes Linux - Server 2 04-15-2008 08:11 AM
local desktop can't access server TheRudy Linux - Networking 1 09-24-2006 12:42 PM
How to access mysql server on local server ? Tancrede Linux - Newbie 2 04-09-2005 01:12 PM
no access for root on X-server (local) Li... Debian 11 02-16-2004 07:01 PM


All times are GMT -5. The time now is 03:49 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration