logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Two Seperate VirtualHost Directives?
Author
VcDeveloper



Joined: 13 Jun 2011
Posts: 3

PostPosted: Thu 02 Feb '12 22:30    Post subject: Two Seperate VirtualHost Directives? Reply with quote

Hi, I hope I can explain this clear and if I don't please let me know. And, I hope I don't sound redundant as I try to explain, but bare with me. Smile

I want to be able to have two VH directive on the web server.
1) for both the internet and local network to access
2) only for the local network

In others words, on my server I have two websites, 1) for the internet users, 2) the other for local network users.

Internet users only have access to say, website1, but local users have access to both website1 and 2. So how do I configure these two VH directives to behave in this matter.

Here's an example how my internet VH looks:
Code:
<VirtualHost *:80>
   ServerName site1.com
   ServerAlias www.site1.com

   DocumentRoot /srv/drupal/7/site1/drupal-7.10
   <Directory />
      Options FollowSymLinks
      AllowOverride None
   </Directory>
   <Directory /srv/drupal/7/site1/drupal-7.10>
      Options Indexes FollowSymLinks MultiViews
      AllowOverride None
      Order allow,deny
      allow from all

      # Read in drupal default .htaccess file asif conf - easier CVS management
      Include /srv/drupal/7/site1/drupal-7.10/.htaccess
      
   </Directory>

   ErrorLog /var/log/apache2/error.site1.log

   # Possible values include: debug, info, notice, warn, error, crit,
   # alert, emerg.
   LogLevel warn

   CustomLog /var/log/apache2/access.site1.log combined
</VirtualHost>


I want to create another VH restricted for my local users only to a intra-net website.

Thanks!
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7306
Location: Germany, Next to Hamburg

PostPosted: Fri 03 Feb '12 10:30    Post subject: Reply with quote

The easiest way would be just creating the new vhost and using a Server name like yourname.local and configure the DNS server from your network to resolve the right IP to yourname.local. Than no one from the internet can reach that vhost. If you are very paranoid you can also add / change

Code:

Order Deny,Allow
Deny from All
Allow from 192.168


to allow only access from your internal IPs.
Back to top
VcDeveloper



Joined: 13 Jun 2011
Posts: 3

PostPosted: Fri 03 Feb '12 19:35    Post subject: Reply with quote

Thanks! I appreciate your help! Smile
Back to top


Reply to topic   Topic: Two Seperate VirtualHost Directives? View previous topic :: View next topic
Post new topic   Forum Index -> Apache