About localhost

Discussion in 'Installation/Configuration' started by Konstantinos999, Jan 25, 2017.

  1. Konstantinos999

    Konstantinos999 New Member

    Hi,
    I have all my sites configured properly and they are working. If i want to open localhost one site of them, or a new site to make it localhost first, what is the link to open the localhost? Because if i write localhost, or the server ip, /theNameOfTheSite, for example 192.168.1.55/kostas (in kostas folder are the files) it doesnt working. What i must do or what i make wrong?
    Thank you
     
  2. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    localhost is always the local machine, so if you try to open http://localhost/ in your browser, your the computer your web browser is running on will try to connect to itself as the web server, and will fail (it will only work if you are using the same machine for your web server and your desktop web browser - most likely that's not the case).

    I'm a little unclear exactly what you're trying to do. If you want to access a website on your server for just local/testing purposes (without changing DNS for the live domain), just edit the hosts file on your computer and add your server's ip address for that domain, eg.
    Code:
    192.168.1.55   www.testdomain.com   testdomain.com
    Your computer will then contact 192.168.1.55 for testdomain.com, even though the rest of the world will go to the address in DNS.
     
  3. Konstantinos999

    Konstantinos999 New Member

    Sorry for the delay and because i didnt tell it more clearly. I have another server and if i write for example from my pc in a browser 192.168.1.55/~kostas it open the site without the site is online. This i can do it with every site i have in this server 192.168.1.55/~xxx, 192.168.1.55/~aaa, etc. The server reads every folder separate without make any change to the host file. In the new server how can i do that. I hope to said it better now. Is this possible with ispconfig that? or is server configuration?i can try that one you said but in the other server i have (with another Operating System) i didnt do anything like that.
     
  4. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    As far as I know ISPConfig does not have that sort of setup out of the box. You could do that with webserver config, eg. something like 'Alias /xxx.com/ /var/www/xxx.com/web/' and it might work to test some things, but it won't setup the same vhost environment, eg. it won't use the correct php mode/settings for xxx.com if it's not the default. Another, possibly better, way would be a reverse proxy in the webserver, so /xxx.com/ reverse proxies to the ip:80 and requests xxx.com - then you get the right php environment and such, and can fix some link problems (eg. a link in the site to '/home' would break in the Alias, but could be rewritten to /xxx.com/home in the proxy). That's probably worth filing a feature request for (or maybe there already is one, I haven't looked).
     

Share This Page