Changes

Jump to: navigation, search

OPS345 Assignment 1

30 bytes added, 02:30, 26 January 2022
Part 1: first slave
** In '''ops345wwsg'''
** Make sure the second virtual drive is named '''www-data-slave1'''
* Add the appropriate '''iptables rule ''' on router (don't forget to save the iptables rules) and '''ops345routersg ''' rule to allow yourself to SSH to www-data-slave1 via port 2221.
* Don't change the hostname of www-data-slave1, leave it as "www".
== Sync files with www ==
Each of your web servers (www and all the slaves) need to have the same data on them. That means you need to synchronize the contents of '''/var/www/html'''. You might recall this is mounted from a separate drive (/dev/xvdf) but that doesn't matter for this assignment.
You'll use rsync to do the synchronization, but first you need to set up your user on www-slave1 to be able to ssh to www without a password.
* Create an ssh key on www-slave1 as your regular user. Make sure the key is stored in '''/home/yourusername/.ssh/id_rsa_wwwsync'''** On www edit '''/home/yourusername/.ssh/authorized_keys'''
** Paste the contents of /home/yourusername/.ssh/id_rsa_wwwsync.pub from www-slave1 to the end of that file as one line.
* Test your key authentication setup as yourusername on www-slave1 to confirm you can log in to yourusername@10.3.45.11 (www) without a password:<source>ssh -i /home/yourusername/.ssh/id_rsa_wwwsync yourusername@10.3.45.11</source>

Navigation menu