Changes

Jump to: navigation, search

OPS335 Web Server Lab

106 bytes added, 16:13, 7 February 2012
Install and test Apache
=== Install and test Apache ===
*Login to vm02 and install the following three packages: yum install httpd httpd-tools system-config-httpd
*Still on vm02 you can now start your web server with this command and enable the service to start at boot.
systemctl start httpd.service
*Now, as root on f16 (the gateway/host), try to forward incoming http connections to our 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.
*To test this setup you'll need to ask a classmate on another PC to try to use Firefox to view your web page. S/he'll have to enter your external interface IP number (142.204.141.yyy) in Firefox's address window.
*Finally, as As root on vm02, use edit the Apache configuration file and change the following command to view/adjust port your web server parameters:webserver is listening for incoming connections on. system-config-vi /etc/httpd/conf/httpd.conf*Change your listen rules to allow connections to this port , and remove the previous rule to allow connections to 8080 and restart your web serverport 80.*Go back to f16 and redo your iptables command to forward port 80 connections to the new port 8080 on vm01vm02, removing previous rule for port 80.*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.
==Completing the Lab==
1
edit

Navigation menu