Changes

Jump to: navigation, search

OPS335 Web Server Lab

2 bytes added, 22:42, 12 February 2012
Install and test Apache on your VM02 and VM03
*Now create your own test page named index.html and put it into directory /var/www/html/. Reload the web page on the host - you should see your own test page now.
*Repeat the above steps for vm03.
*Now, as root on f16 (the gateway/host), try to forward incoming http connections to you your host to the web server on vm02. Use an iptables command something like this
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to 192.168.X.3
*You will also need to create a rule in the FORWARD chain in the default table to accept connections to port 80.
*Go back to f16 and redo your iptables command to forward connections to port 80 (on your host) to the new port 8080 on vm02, removing previous rule for port 80.
*Verify that other students on their PCs can still view your web page.
 
=== Load balancing using iptables ===
*Iptables can be used for load balancing connections. On your host machine add a rule(s) to the PREROUTING chain that will alternate connections bound for port 80 on your host machine to vm02 and vm03.
1
edit

Navigation menu