Changes

Jump to: navigation, search

OPS345 Lab 3

226 bytes added, 02:07, 2 January 2022
Set up access to the web server
* chown -R andrew /var/www/html
* systemctl start httpd
* test with links
* install php, restart httpd
 
== Port forwarding for HTTP ==
 
* On router: iptables -t nat -I PREROUTING -p tcp --dport 80 -j DNAT --to 10.3.45.11:80
* On www: iptables -I INPUT 3 -p tcp --dport 80 -j ACCEPT
* Edit security group, allow HTTP
* ss -atnp on router and www
* install php, restart httpd== Make a proper PHP webpage == 
* make proper html page:<source>
<html>
</html>
</source>
 
= Remove public IP from the web server =
 
* Removing public ip doesn't work. Have to modify subnet and recreate the vm:
 
== Rebuild ww into www ==
 
** Terminate www, rename it to www-deleted.
** Modify subnet to not auto-assign public IPs.
** Install httpd, php
** To get yum install to work, allocate a new elastic ip "temporary" and associate with www
 
== Reconnect www-data ==
 
** Note that www-data was not deleted when the original www was terminated. Attach it to www now.
** All the data on the logical volume is still there, but fstab is gone, add lv-www back into there.
** Start httpd, everything should be back to as it was.
 
== Disasociate the public ip from www ==
 
** Disasociate the public ip. Everything should keep working.
** Release the elastic ip.

Navigation menu