1

I have Ubuntu Server (with Ubuntu Desktop GUI running) on my server computer. I would like to have 2 different sites running together on Apache, which came with Ubuntu Server. One site would have to be an intranet site, so it will only be accessible through any device connected to the same internet router, and an internet site, which will be accessible to anyone who has my IP. I am new to this, so please try to give a detailed description.

1 Answers1

3

There are a few ways to do this. They all center around blocking access by IP.

One way is to configure Apache to allow only IPs from your intranet using mod_access. In your vhost file (located in sites-available), add the following:

Order Deny,Allow
Deny from all
Allow from *your_ip_subset*

The IP subset can be a partial IP address, a network/netmask pair, or a network/nnn CIDR. Read about mod-access at: http://httpd.apache.org/docs/1.3/mod/mod_access.html

Another way to do this is to assign two different IPs to your server and then assign one IP each to your two sites. Now you can configure your router to block requests for the intranet IP unless the requests are coming from your desired IPs.

Chris Ting
  • 899
  • 4
  • 5