Apache multiple virtual hosts

Written by Administrator on . Posted in Latest News

Apache2 with multiple webistes and forward 1 website to another lan apache. All available online by domain / sub domain names pointed to my wan ip and using the global port 80 for all websites ;)

 

Later on today I will post a small how-to for all the ubuntu user's having an hard time with this. After 3 days and a lot of google, I found that the online documentation is scarce and fragmented, relating to several distros or releases.... complete confusing mess.

 

1) How-to have multiple virtualhosts (domain/sub) responding from WAN/LAN using port 80.

1.a. Domain (example.com)
1.b. Subdomains -sub1.example.com -sub2.example.com


2) Having a main apache2 server for several virutalhosts and also how-to forward 1 or more domain/subdomain internally from a main apache2 server to a secondary apache2 server.

2.a. Main apache2 webserver 10.10.0.1 serves 2 websites

2.b. Forward the 3 website sub2.example.com to another LAN computer with apache2 10.10.0.2


3) So that from WAN all sites (domains/subdomains) use the same static Ip and port 80

This how-to will cover:
Ubuntu 9.04 /etc/hosts and interfaces eth* configuration
Forward router ports to main apache2 webserver
Bind9dns and Public DNS
Apache version 2.2.11 configuration "vhosts.conf / apache.conf / httpd.conf"