Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

migrated from superuser.com May 22 '11 at 17:33

This question came from our site for computer enthusiasts and power users.

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.