One of the most popular options is Apache is virtual hosting. Virtual hosting with Apache allows a single machine to serve multiple websites called Virtual Hosts. Each different site can have its own unique configuration, or just use the default settings. There are two comon methods for Virtual Hosting.
Name based virtual hosts. A newer method for virtual hosting, where multiple host names are registered (to one or more IP addresses). Apache then serves different sites to web clients based on name used to access the server.
IP Based. Set up multiple IP addresses on the server, and serve different sites to web clients based on the IP address they used to access the server. IP based Virtual Hosting isn't very popular these days, as registering routable internet addresses is expensive.
Most Virtual Hosting is done using the name based method. This tutorial will create two name based virtual hosts.
Open a terminal and do the following:
Add entries for each name to DNS. Create entries pointing each addresses to the IP address of your web server.
Create directories for each web site. mkdir -p /var/www/site1.stationx.example.com mkdir -p /var/www/site2.stationx.example.com
Create content in each directory. cp -rv /training/misc/site1/* /var/www/site1.stationx.example.com cp -rv /training/misc/site2/* /var/www/site2.stationx.example.com
Set up Apache for name based virtual hosting. In httpd.conf NameVirtualHost 192.168.5.x
Set up each virtualhost in configuration files: You could add the lines below to the bottom of httpd.conf, but creating two new files under conf.d for each website is a little neater. In /etc/httpd/conf.d/
Visit your partners virtual host at http://site1.stationy.example.com