I want to host two servers on one computer:
public (i want it to accessible on port 80)
development (on port 8001)
I have dynamic IP address, so I want users to type eg:
- Code: Select all
123.123.123.123 (public)
or
123.123.123.123:8001 (development)
to get to those servers.
In the same time, I want those servers to be accessible to me as:
- Code: Select all
localhost
and
development
by just typing that name into browser, without any ip, port or anything. As I understand it, I have to create two virtual hosts and modify /etc/hosts but, unfortunately, I can't get it to work.
Here's my /etc/hosts:
- Code: Select all
127.0.0.1 localhost
127.0.0.1:8001 development
My /etc/apache2/ports.conf:
- Code: Select all
Listen 80
Listen 8001
My /etc/apache2/sites-enabled/ files:
- Code: Select all
ServerName localhost
DocumentRoot /www/localhost/
- Code: Select all
NameVirtualHost *:8001
<VirtualHost *:8001 development>
ServerName development
ServerAlias 127.0.0.1:8001
DocumentRoot /www/development/
</VirtualHost>
Right now, remote access to my server (through IP & port) works, but my local access to development server won't. How to fix that?