LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-09-2003, 02:57 PM   #1
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Unhappy Apache doesnt like me, but sure likes Code Red


Ok, I've got the latest Apache 2.0.45 release from MandrakeSoft installed on this Mandrake 9.1 setup, with the security set to Higher, and a few custom lines in the python file /etc/security/msec/level.local to improve login permissions.
Apache runs, and /etc/init.d/httpd start starts httpd2 with no problems. However, if I then try http://localhost in a browser, or localhost:80, or 127.0.0.1 or any combo, as well as Mdk91hdb5 variations as the hostname is set at boot to that (and there are entries in /etc/hosts for both hostnames) I get nothing.
Normally I get an unknown host message.
When I try this while online I get a timeout error and a mention of the port 80.
Guarddog is set to enable local and internet access to port 80, 81 and 53.

The only sign it's recieving requests or anything from anywhere is a dodgy single entry in /var/log/httpd/access_log:
81.131.151.57 - - [06/Jun/2003:23:07:15 +0100] "GET /default.ida?XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX%u9090%u6858%ucbd3%u7801%u9090%u6858%ucbd3%u7801%u9090%u6858%ucb d3%u7801%u9090%u9090%u8190%u00c3%u0003%u8b00%u531b%u53ff%u0078%u0000%u00=a HTTP/1.0" 404 354 "-" "-"

Yup, a quick check reveals that's an old Code Red request
Why doesnt my webserver work for me?
I uncommented the line Servername localhost in one apache config file, that's it, the rest is default. Any ideas?
I dont think I forced any apache packages when they required more to be downloaded due to dependancies, but I was getting tired and irritated.
 
Old 06-10-2003, 01:05 PM   #2
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Original Poster
Rep: Reputation: 116Reputation: 116
Bump. I'll be playing with the install tonight so any hints would be great. I remember apache worked fine out the box with Mdk9.0. But I really want my 9.1 server install working.
 
Old 06-10-2003, 01:16 PM   #3
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
I take it your firewall rules are ok?

Try starting apache with "-X" this way it prints all debug info to the console.
 
Old 06-10-2003, 01:25 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
What if you change the ServerName directive and use your IP or FQDN? And add :80?
 
Old 06-10-2003, 05:06 PM   #5
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Original Poster
Rep: Reputation: 116Reputation: 116
With ServerName localhost in /etc/httpd/conf/httpd2.conf:

First by starting Apache offline and testing urls like http://localhost I always get
Quote:
An error occured while loading http://localhost:


Could not connect to host localhost
This is true for 127.0.0.1, Mdk91hdb5 (the machine's hostname) and any ammendment of :80, 8080, 8008, 8800, 8088, 81, 8181, 443... all give the same error. And with http://www. instead too.

If I then go online without stopping or restarting that apache process, I get
Quote:
An error occured while loading http://localhost:


Timeout on server
Connection was to localhost at port 80
After the browser waits for about a while.
This time www. causes
Quote:
An error occured while loading http://www.localhost:


Unknown host www.localhost
Stopping apache and then starting it while already connected to the internet made no difference to these results.

I start apache as root with /etc/rc.d/init.d/httpd start or something very similar, not with apachectl. -X is not a valid arguement/use. I dont think I even have the apachectl script wrapper thing, I only remember that from installing via source on my old Mdk9.0 install once.

Last edited by Proud; 06-10-2003 at 05:08 PM.
 
Old 06-10-2003, 05:26 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Mdk91hdb5 is "hostname -s", not the "hostname -i" you need, unless you're not connected to the 'net, which you're not. Forget about the "www." prefix, cuz you ain't got the DNS entry. If ServerName equals your public IP address $(hostname -i), then you can browse it by IP address, if it's the FQDN $(hostname -f) and you have got an entry in /etc/hosts from "$(hostname -i) $(hostname -f) <alias>", then you can browse it by IP, FQDN and alias AFAIK.

Last edited by unSpawn; 06-10-2003 at 05:29 PM.
 
Old 06-11-2003, 03:33 AM   #7
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
It seems that you are not getting anly local host connections at all yet the connection times out when you are on the net. Maybe you should check to see if the loopback device has started and that there is a vailid route to the loobback in the routing table.

To start with -X then look at the /etc/rc.d/init.d/httpd script and add -X to the end of the command used in the start subroutine.
 
Old 06-12-2003, 01:31 PM   #8
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Original Poster
Rep: Reputation: 116Reputation: 116
I put the comments back in the httpd config file, and restored all other settings to their install defaults. david_ross nailed the problem, I'd turned off the Network service which starts the loopback route interface doodle. With that started, Apache works fine.

Well, the Higher security settings are making the manual pages (and error ones) unreachable, but I'll work on it
 
  


Reply



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
Red Hat 9 installation CD doesnt boot please help LambdaMOO Linux - Newbie 1 06-07-2005 04:59 AM
Javascript Code doesnt work w/ firefox? swatward Programming 1 04-18-2005 06:54 PM
apache doesnt show what it should jelgavchik Linux - Software 1 02-20-2005 04:08 PM
apache doesnt show what it should jelgavchik Linux - Networking 3 02-20-2005 02:16 PM
Apache logs with Code Red and WebDAV attacks. GinEric Slackware 1 12-17-2004 12:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

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