How to use an IP-based URL to access sub-servers / sub-domain websites ?

October 20, 2014 3.5k views

Hi everyone,

I'm getting a bit confused here. I have a droplet with webmin / virtualmin and a LAMP server deployed but I do not have a domain name pointing at my droplet IP at the moment (and I'm not planning to have one right now as I want to do some testing before buying a domain name).

I can access my server through SSH, the webmin console at http://server-ip:20000. All this is working fine.

Now, I would like to access sub-servers I created with virtualmin (containing websites) in my web browser. I used to be able to do that with Cpanel using an IP-based URL, if I remember correctly, but this doesn't seem to work with my configuration (http://server-ip/subdomain does not work).

Is this possible to access sub-servers / sub-domains without having registered a domain name pointing at my droplet IP?

Additional question : do I need to install BIND DNS server on my VPS to make this possible or is this unnecessary?

Thanks for your answers.

1 Answer

You may use different ports for different sites for testing purpose.

Add Listen [port] in /etc/apache2/ports.conf and change <VirtualHost *:[port]> in site config files should be enough. (Ubuntu)

Make sure your firewall is not block any of those ports.

Have another answer? Share your knowledge.