Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Servers & Networking
FedoraForum Search

Forgot Password? Join Us!

Servers & Networking Discuss any Fedora server problems and Networking issues such as dhcp, IP numbers, wlan, modems, etc.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 31st December 2008, 11:44 AM
jeesan Offline
Registered User
 
Join Date: Aug 2008
Posts: 60
Arrow Http port problem

I m facing problems regarding http on Fedora 8 system .

When trying to browse any index / other pages in the default directory ; I have to manually put the :80 along with the IP every time . After refreshing the page , the port is vanished and if I refresh the page at the time , its showing "Bad Request" . I have to put the :80 again ;; like http://xx.xx.xx.xx:80 or http://xx.xx.xx.xx:80/test/

I had modified the httpd.conf file ,,, but problem in still there . I m attaching my httpd.conf file . Please help .



Listen 80
ServerAdmin root@localhost
ServerName xx.xx.xx.xx:80
#
# UseCanonicalName: Determines how Apache constructs self-referencing
# URLs and the SERVER_NAME and SERVER_PORT variables.
# When set "Off", Apache will use the Hostname and Port supplied
# by the client. When set "On", Apache will use the value of the
# ServerName directive.

UseCanonicalName Off

NameVirtualHost xx.xx.xx.xx:80
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
<VirtualHost xx.xx.xx.xx:80>
ServerName xx.xx.xx.xx
DocumentRoot /var/www/html
DirectoryIndex index.html index.shtml
</VirtualHost>

<VirtualHost xx.xx.xx.xx:80>
ServerName xx.xx.xx.xx
DocumentRoot /var/www/html
ErrorLog logs/test_error_log
CustomLog logs/test_access_log common
DirectoryIndex index.html index.shtml
<Directory "/var/www/html/test">
Options Indexes Includes
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

Last edited by jeesan; 31st December 2008 at 11:53 AM.
Reply With Quote
  #2  
Old 31st December 2008, 11:54 AM
David Becker Offline
Registered User
 
Join Date: Feb 2006
Posts: 780
Quote:
Originally Posted by jeesan View Post
I m facing problems regarding http on Fedora 8 system .

When trying to browse any index / other pages in the default directory ; I have to manually put the :80 along with the IP every time . After refreshing the page , the port is vanished and if I refresh the page at the time , its showing "Bad Request" . I have to put the :80 again .

I had modified the httpd.conf file ,,, but problem in still there . I m attaching my httpd.conf file . Please help .



Listen 80
ServerAdmin root@localhost
ServerName xx.xx.xx.xx:80
Off the bat, I'm not sure you should be using a port number together with the servername. Try using just the name.

David
Reply With Quote
  #3  
Old 31st December 2008, 12:07 PM
jeesan Offline
Registered User
 
Join Date: Aug 2008
Posts: 60
No, I have tested both......with or without port . But till showing bad request . I have to manually put http://xx.xx.xx.xx:80 to browse the index page every time . Even I have tried with hostname instead of IP .

Last edited by jeesan; 31st December 2008 at 12:09 PM.
Reply With Quote
  #4  
Old 31st December 2008, 12:47 PM
David Becker Offline
Registered User
 
Join Date: Feb 2006
Posts: 780
Quote:
Originally Posted by jeesan View Post
No, I have tested both......with or without port . But till showing bad request . I have to manually put http://xx.xx.xx.xx:80 to browse the index page every time . Even I have tried with hostname instead of IP .
Ok, I see that VirtualHost ServerName's are normally without the port (by virtue of the virtualhost specifying the port).

Strange, I can't see any problems with the configuration. I do recall having a similar issue years ago, but I can't remember how it was resolved. It's almost like there's some port mapping failure. As if 80 isn't the standard port. But a wrong port would just give some kind of connection failure, not a bad request.

Spooky. Is this machine normally connected to the internet? Are you using some kind of url rewriting module?

David
Reply With Quote
  #5  
Old 31st December 2008, 01:21 PM
jeesan Offline
Registered User
 
Join Date: Aug 2008
Posts: 60
Yes this system is generally connected with Internet and also tested within LAN also
Reply With Quote
  #6  
Old 31st December 2008, 01:37 PM
d3n0 Offline
Registered User
 
Join Date: Nov 2008
Posts: 66
Quote:
Originally Posted by jeesan View Post
No, I have tested both......with or without port . But till showing bad request . I have to manually put http://xx.xx.xx.xx:80 to browse the index page every time . Even I have tried with hostname instead of IP .
...you remembered to restart/reload server after editing the file?
Reply With Quote
  #7  
Old 31st December 2008, 03:43 PM
David Becker Offline
Registered User
 
Join Date: Feb 2006
Posts: 780
Quote:
Originally Posted by jeesan View Post
Yes this system is generally connected with Internet
Using selinux? I hope nobody's messing up with your system from the internet.

I seem to remember where I've encountered this before. While writing my own webserver.

There's some mismatch going on between apache and your browser. You're using virtual hosting which requires http 1.1. It's possible that your browser (which is it?) is sending a 1.0 or even 0.9 request which doesn't include a hostname (or mismatches in some other manner) resulting in a bad request. I actually would think the browser if behaving correctly while apache is confusing the browser causing the browser to generate it's request such that a bad request is returned.

- Which browser are you using?
- Which IP addresses are you using for NameVirtualhost directives? 127.0... or some ethernet address?

David
Reply With Quote
  #8  
Old 31st December 2008, 04:17 PM
David Becker Offline
Registered User
 
Join Date: Feb 2006
Posts: 780
Quote:
Originally Posted by jeesan View Post
I m facing problems regarding http on Fedora 8 system .

When trying to browse any index / other pages in the default directory ; I have to manually put the :80 along with the IP every time . After refreshing the page , the port is vanished and if I refresh the page at the time , its showing "Bad Request" . I have to put the :80 again ;; like http://xx.xx.xx.xx:80 or http://xx.xx.xx.xx:80/test/

I had modified the httpd.conf file ,,, but problem in still there . I m attaching my httpd.conf file . Please help .



Listen 80
ServerAdmin root@localhost
ServerName xx.xx.xx.xx:80
#
# UseCanonicalName: Determines how Apache constructs self-referencing
# URLs and the SERVER_NAME and SERVER_PORT variables.
# When set "Off", Apache will use the Hostname and Port supplied
# by the client. When set "On", Apache will use the value of the
# ServerName directive.

UseCanonicalName Off

NameVirtualHost xx.xx.xx.xx:80
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
<VirtualHost xx.xx.xx.xx:80>
ServerName xx.xx.xx.xx
Are you using an IP address for xx.xx.xx.xx ?

I'm wondering to what extent an IP address can be used for ServerName *within* the virtualhost directive. That would subvert the virtual hosting situation. Each virtual host listens to the same ServerName which is the same IP address which is somewhat of a contradiction (how can apache discriminate virtual hosts if they all have the same servername?).

David
Reply With Quote
  #9  
Old 1st January 2009, 05:43 AM
jeesan Offline
Registered User
 
Join Date: Aug 2008
Posts: 60
I have restarted services many times . No Selinux & no port blocking . Fresh installed system it is .
Browser -> Firefox 2.0..... and http -> 2.+

Its a standalone Fedora 8 system . Generally I had tested once with RHEL also . I just put a index.html in default path . Even I did not modify any file . Restarted the service and everything was fine . Because we know that , here the port 80 is default .
But here , I have tried this also and tested without a vertual host . But I can't understand why needed to put :80 every time in browser .

I am attaching my httpd.conf file's lines again , those I had modified only .

Listen 80
ServerName 192.168.0.20:80
#

UseCanonicalName Off

NameVirtualHost 192.168.0.20

<VirtualHost 192.168.0.20:80>
ServerName 192.168.0.20
DocumentRoot /var/www/html
ErrorLog logs/test_error_log
CustomLog logs/test_access_log common
</VirtualHost>

........... or ...........

<VirtualHost 192.168.0.20>
DocumentRoot /var/www/html
</VirtualHost>

Last edited by jeesan; 1st January 2009 at 06:07 AM.
Reply With Quote
  #10  
Old 1st January 2009, 09:06 AM
jeesan Offline
Registered User
 
Join Date: Aug 2008
Posts: 60
http://localhost is working with normally [without port number]. But not working with ip addreess , even 127.0.0.1 also .
Reply With Quote
  #11  
Old 1st January 2009, 09:30 AM
David Becker Offline
Registered User
 
Join Date: Feb 2006
Posts: 780
Quote:
Originally Posted by jeesan View Post
I have restarted services many times . No Selinux & no port blocking . Fresh installed system it is .
Browser -> Firefox 2.0..... and http -> 2.+

Its a standalone Fedora 8 system . Generally I had tested once with RHEL also . I just put a index.html in default path . Even I did not modify any file . Restarted the service and everything was fine . Because we know that , here the port 80 is default .
But here , I have tried this also and tested without a vertual host . But I can't understand why needed to put :80 every time in browser .

It would seem to be an artifact of a misconfigured server. When the server is generating the "Bad Request" messages, it should be generating some kind of "Server Misconfiguration" message. That's what's really going on . But the server is trying to make some sense of the combination <server_config, http_request> which erroneously translates to a "Bad Request". The request is probably good, but combined with the server configuration, both seem bad and the server then designates the request as bad (while it should be more self reflective).

Somewhere an IP address is being seen as a hostname. I would say that ServerName within a VirtualHost has to be a FQDN. With IP addresses, it's always going to go wrong some way or another. It's called *Name* based virtual hosting.

David
Reply With Quote
  #12  
Old 1st January 2009, 12:37 PM
jeesan Offline
Registered User
 
Join Date: Aug 2008
Posts: 60
I have tested with hostname also in httpd.conf . As result http://localhost or http://systemhostanme is fine . But again bad request , while using IP address .
I did it in RHEL product and was successful to browse through IP . In Fedora 8 , why its showing error . Is it one kind of bug or in fedora 8 its relating with another file . Please help .
Reply With Quote
  #13  
Old 1st January 2009, 12:42 PM
David Becker Offline
Registered User
 
Join Date: Feb 2006
Posts: 780
Quote:
Originally Posted by jeesan View Post
I have tested with hostname also in httpd.conf . As result http://localhost or http://systemhostanme is fine . But again bad request .
Fine, but again bad request. That doesn't seem so fine. What does this mean? Could you explain in more detail what is fine and what not? Is RHEL on the same machine? On the same network? Are you running DNS which is normally required with name based virtual hosting?

David
Reply With Quote
  #14  
Old 1st January 2009, 01:59 PM
jeesan Offline
Registered User
 
Join Date: Aug 2008
Posts: 60
Yes its working if mentioning DNS only .
That is 1.> http://localhost is working
2.> http://localHostname is working
3.> http://localHostname.localDomain is working
...........But http://IP not working without mentioning :80
Reply With Quote
  #15  
Old 1st January 2009, 04:01 PM
David Becker Offline
Registered User
 
Join Date: Feb 2006
Posts: 780
Quote:
Originally Posted by jeesan View Post
Yes its working if mentioning DNS only .
That is 1.> http://localhost is working
2.> http://localHostname is working
3.> http://localHostname.localDomain is working
...........But http://IP not working without mentioning :80
The whole idea of name based virtual hosting is to discriminate different websites based on the (DNS) name. Apache has default rules for when it receives an IP address, but most people don't care about this because they don't expect (or want to serve) a URL based on an IP address. "Bad Request" is an appropriate response.

I'm guessing it'll "work" if you use the IP address (without a port number) as the first VirtualHost.

David
Reply With Quote
Reply

Tags
http, port, problem

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
apache http port teethlikelions Servers & Networking 1 17th November 2005 11:34 PM
Change VNC HTTP Port? justincataldo Using Fedora 1 18th June 2005 01:36 AM
The Real http-alt port? Firewing1 Servers & Networking 5 12th April 2005 09:50 PM
turn off http port 80, keep https port 443 lothario Servers & Networking 11 11th February 2005 04:32 AM


Current GMT-time: 09:48 (Saturday, 25-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat