HP Open Source Middleware Stacks Blueprint: LAMP Architecture on HP ProLiant BladeSystem Servers on RHEL

NOTE: For Windows systems, edit the C:\WINDOWS\system32\drivers\etc\hosts
file.
<YOUR_WEB_SERVER_IP> www.website1.com www.website2.com
2. Verify that both websites are resolved to the same IP address by entering the following
commands:
# ping www.website1.com
# ping www.website2.com
3. Create the following two directories:
/var/www/html/website1
/var/www/html/website2
4. Create a file named /var/www/html/website1/index.html using the following content:
<HTML>
<HEAD>
</HEAD>
<BODY DIR="LTR">
<P ALIGN=CENTER STYLE="margin-bottom: 0cm">
<FONT FACE="Times New Roman, serif">
<FONT SIZE=6>This is www.website1.com</FONT>
</FONT>
</P>
</BODY>
</HTML>
5. Create a file named /var/www/html/website2/index.html using the following content:
<HTML>
<HEAD>
</HEAD>
<BODY DIR="LTR">
<P ALIGN=CENTER STYLE="margin-bottom: 0cm">
<FONT FACE="Times New Roman, serif">
<FONT SIZE=6>This is www.website2.com</FONT>
</FONT>
</P>
</BODY>
</HTML>
6. Configure virtual hosting by editing the file named /etc/httpd/conf/httpd.conf and
adding the following lines:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /var/www/html/website1
ServerName www.website1.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/html/website2
ServerName www.website2.com
</VirtualHost>
7. Restart your Apache HTTP server for the changes to take effect.
8. Verify that the virtual hosting configuration operates properly by opening a browser and
entering the following URL:
http://www.website1.com
The following message appears:
14