Changes

Jump to: navigation, search

OPS335 Web Server Lab

No change in size, 11:11, 7 February 2012
Install and test Apache
*Using Firefox on vm01 go to address "localhost". You should get the "Fedora Test Page" which indicates your web server is running. Do not continue until this step works.
*Now create your own test page named index.html and put it into directory /var/www/html/. Reload the Firefox "localhost" web page - you should see your own test page now.
*Try viewing this web page from f13 f16 (the gateway/host). You'll need to enter the IP address of vm01 in your Firefox browser. By default this address should be something like 192.168.122.aaa. If this doesn't work you may have to add a rule to the firewall on vm01 to allow incoming connections on port 80.
*Edit the /etc/hosts file on each PC in your network and include the IP address and host name for both PCs. Now try accessing your web site by name in stead of IP number. Note: we're not using DNS so /etc/hosts file should work in its place.
*Now, as root on f13 f16 (the gateway/host), try to forward incoming http connections to our server on vm01 (the guest). Use an iptables command something like this
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to 192.168.122.aaa
Note: aaa is the IP address of your guest VM
system-config-httpd
*Change your listen port to 8080 and restart your web server.
*Go back to f13 f16 and redo your iptables command to forward port 80 connections to the new port 8080 on vm01.
*Verify that other students on other PCs can still view your web page. If this doesn't work you may have to add a rule to the firewall on vm01 to allow connections on port 8080.
1
edit

Navigation menu