hostname points to web

Discussion in 'Installation/Configuration' started by error.log, Aug 15, 2012.

  1. error.log

    error.log New Member

    hello everyone

    i added a domain to a customer, after that i added the server IP on which ISPConfig is running on. I assigned the ip to the webhost i recently added.

    okay.. now i removed the ip because this was a mistake. but there is no effect. it seems that the ip is still connected with the domain.

    ive installed the server step by step with this manual: http://www.howtoforge.com/perfect-s...n-6.0-with-bind-dovecot-and-nginx-ispconfig-3

    how can i remove the connection between the hostname (e.g. IP) and the webhost?
     
  2. error.log

    error.log New Member

    I looked up the default vhost, but the root was correct there. I've already removed the web and added it again with other webX ID. But same situation...

    I've totally no clue how to fix this...
     
  3. tahunasky

    tahunasky New Member

    I dont really understand what you are getting at, but the only place you need to add ip address is in DNS setting for a domain or in the SYSTEM/SERVER IP.

    If you delete the DNS record of the client/domain you made the mistake on and then add it again it should fix any IP problems.
     
  4. Sir Henry

    Sir Henry Member

    I do not understand the problem either. What is wrong with your setup?

    With virtual hosting you can either map ALL of your IPs (indicated with '*') to a web site or a specific one. If you change from a specific one to a wildcard, then any of your IPs will map to your site.

    Or is the problem that you expect a different site when you direct your browser to the numeric IP?
     
    Last edited: Aug 15, 2012
  5. error.log

    error.log New Member

    Hello,

    first of all thank you for your answers.

    Maybe I didn't explain it very clearly.

    I've a domain let's say example.com, on my webserver the hostname is srv.example.com (it should point to /usr/share/nginx/www which is described in vHost for "default"). Also the IP (123.456.678.9) should point to this directory, but it doesn't.

    It points to the web from a client. And that since I've assigned the IP via control panel at the "sites" tab to this customer before. So I didn't choose wildcard but exactly this IP.

    After I removed this - because I thought this will give the IP private to the customer - I noted that the IP (123.456.678.9) - which pointed correctly to the nginx ww before, shows now the web of the client.

    I don't have that IP listed as server IP, because I want to have this IP pointing to the nginx-ww like hostname (srv.example.com) and all other IPs which are pointing to that server but not assigned to any customers.

    But they all point to the web from this one client... I really don't know why. I followed the installation tutorial step by step.
     
    Last edited: Aug 15, 2012
  6. tahunasky

    tahunasky New Member

    I think I understand what you are getting at: if you just type in the IP address of the server its points to the DocumentRoot of a clients domain and not the default web DocumentRoot directory of example.com. I had the same problem, it would point to the first domain in my DNS list. The way i fixed this was to create a new default virtual host record.

    You need to relise that HOSTNAME and DOMAIN NAME are 2 different things. Even though hostname can be/is a fully qualified domain name, unless you setup a site for it there will not be one. You need to go to SITES/WEBSITES/ADD NEW SITE and create new site for example.com . So if someone puts in your servers IP address it will default to the first domain record (for me it was the first domain is DNS list) that is loaded (in apache anyways)

    I use Apache, so not sure about nginx (but someone should be able to tell you want to do for nginx), but what i did for apache was:

    create a new default /etc/httpd/conf/sites-available/_default.vhost file, then added the following code at the top:

    Code:
    <VirtualHost _default_:80>
        ServerName example.com
        ServerAdmin webmaster@example.com
        DocumentRoot /var/www/example.com/web
    </VirtualHost>
    
    OR

    Code:
    <VirtualHost 123.456.678.9:80>
        ServerName example.com
        ServerAdmin webmaster@example.com
        DocumentRoot /var/www/example.com/web
    </VirtualHost>
    
    You can change the DocumentRoot to point to wherever you want.

    Then i created a symbolic link to the file /etc/httpd/conf/sites-enabled/000-default.vhost

    Code:
    ln -s /etc/httpd/conf/sites-available/_default.vhost /etc/httpd/conf/sites-enabled/000-default.vhost
    
    This will catch all http requests to the IP address.
     
    Last edited: Aug 16, 2012
  7. error.log

    error.log New Member

    Last edited: Aug 18, 2012
  8. tahunasky

    tahunasky New Member

    for my setup this is what i have for the default site, if they type in an IP address or if there is no site associated with the a domain name. i put it at the top of my _default.vhost file and i dont have a ServerName key in the section:

    Code:
    <VirtualHost _default_:80>
    	DocumentRoot /var/www/html/
    	ServerAdmin webmaster@example.com
    	ErrorLog /var/log/httpd/default-error_log
    	CustomLog /var/log/httpd/default-access_log common
    </VirtualHost>
    
     

Share This Page