400 Bad Request ---- Displays wrong info

Discussion in 'General' started by Code5, Aug 4, 2008.

  1. Code5

    Code5 New Member

    Hi all,

    Quick question; when i goto mydomain.com:81 I recieve a 400 Bad Request

    It displays the following:
    ---------------------------------------------

    Bad Request
    Your browser sent a request that this server could not understand.

    Reason: You're speaking plain HTTP to an SSL-enabled server port.
    Instead use the HTTPS scheme to access this URL, please.

    Hint: https://www.linux5.config:81/
    ---------------------------------------------

    How do i fix the problem with the wrong hint? It should say;

    Hint: Https://www.mydomain.com:81


    Thanks.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Have a look in the file /root/ispconfig/httpd/conf/httpd.conf and change the hostname there.
     
  3. Code5

    Code5 New Member

    Ive checked the .conf file and cannot find the hostname variable.

    The only variable in there that looks like it resembles hostname is:

    #ServerName www.linux5.config

    As this is commented out it must not be required and that the variable i must change to fix this problem must be in another file elsewhere.

    Correct me if im wrong.


    Cheers.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    What is the output of:

    hostname

    and:

    hostname -f

    and:

    grep www.linux5.config /root/ispconfig/httpd/conf/httpd.conf
     
  5. Code5

    Code5 New Member

    The output is as follows:

    -----------------------------------------------------------
    root@linux5:~# hostname
    linux5.config
    root@linux5:~# hostname -f
    linux5.config
    root@linux5:~# grep www.linux5.config /root/ispconfig/httpd/conf/httpd.conf
    ServerAdmin [email protected]ig
    #ServerName www.linux5.config
    ServerName www.linux5.config
    ServerAdmin [email protected]ig
    root@linux5:~#
    -----------------------------------------------------------

    As we can see the hostname needs changing, but why? as other webservers can produce the "Hint Info" from the domain its being called from and shouldnt require manual hostname editing to show that www.mydomain.com requires ssl using https://www.mydomain.com

    Thanks.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    The server on port 81 is no vhost, so it uses the hostname info from its config file. Please change all occurrences of www.linux5.config to the new hostname in /root/ispconfig/httpd/conf/httpd.conf and restart the ispconfig_server. Then you should change the hostname of the server too, as www.linux5.config is no valid hostname and might cause trouble e.g. when sending mail.
     
  7. ghostshell

    ghostshell Member

    Whats distro are you running? On CentOS i do not have:

    /root/ispconfig/httpd/conf/httpd.conf

    Any ideas? I am running into the same issue when using both NICs, using only one NIC, if i switch the IP to a different address the 400 error instead of showing the host name www.mydomain.com reverts to localhost.localdomain. If i switch back to the IP that i was originally using it goes back to www.mydomain.com. Any idea why this happens? Where does the localhost.localdomain get pulled from? The only place i can find it is in my hosts file.

    This may help with a solution to my issue, when i ping the host name it, www.mydomain.com, it comes back with;

    localhost.localdomain 127.0.0.1

    and not the hostname itself with the IP, im guessing i did not change it in ISPConfig someplace unless the issue is what is in my hosts file.
     
    Last edited: Nov 13, 2013

Share This Page