HP Open Source Middleware Stacks Blueprints: LAMP Architecture on HP ProLiant BladeSystem Servers on SLES
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:
/srv/www/htdocs/website1
/srv/www/htdocs/website2
4. Create a file named /srv/www/htdocs/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 /srv/www/htdocs/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/apache2/vhosts.d/
vhosts.conf and adding the following lines:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /srv/www/htdocs/website1
ServerName www.website1.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /srv/www/htdocs/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
Installing, Configuring, and Managing LAMP Middleware Stack Components 15