932
edits
Changes
m
=== Linux Platform For Webserver (VM4) ===
First, create a new Linux VM that will be contained on the same subnet, using your existing DNS server (''vm1''), and firewall settings.
'''Perform the following steps:'''
# Create another virtual machine called '''vm4''' from scratch (only a minimal setup is needed). If you forgot how to do this, refer to [http://zenit.senecac.on.ca/wiki/index.php/OPS335_Installation_Lab#VM_Installation Lab1].<br><br>'''For Interest:''' As an optional exercise: configure all your network settings (except the firewall) using the installation wizard during installation static IP<br>(the address '''192.168.X.5''' should be available).<br><br>
# Configure your '''vm4''' virtual machine in the same way that you've configured the other three main VMs. This should be a quick exercise for you by now, including:
::* The Linux installation (minimum install)
::* If you didn't setup the network configuration during installation, make certain to connect to the correct network with a static IP<br>(the address 192.168.X.5 should be available),
::* Making sure you're using your internal DNS server (make reference to vm4's IPADDR for domain resolution)
::* Configuring default rules for your iptables firewall (hint: use saved shell scripts)
::* Allowing passwordless login from the host's root account (for future backups)
::* Disabling '''selinux''' since you don't know how to configure it properly.<br><br>
<ol><li value="3">Test your '''vm4''' virtual machine to make certain that it functions correctly.</li></ol>
No longer installing an extra VM for this.
== INVESTIGATION 1: SETTING UP A LAMP SOLUTION FOR WEBMAIL ==
=== Install, Configure & Run a Webserver (Apache) ===
'''Perform the following steps:'''
#Make certain you are in your '''VM4VM1''' machine.
#Install the Apache package (the name of the package is: '''httpd''').
#Start the httpd service, and enable this service to start automatically upon system startup.
#Make certain to configure your firewall to allow access to the httpd service (i.e. the Apache serves HTTP traffic which goes over TCP port '''80''').
#Open a web-browser in your '''host''' machine and enter the following URL: '''vm4vm1.youruserid.org'''.<br>If you setup your Apache webserver correctly, you should be able to view the Apache Test page.#Delete the file '''/etc/httpd/conf.d/welcome.conf''' to remove the default webpage.
#Although we will not be exploring webservers in depth, we will have you create a simple webpage for testing purposes, then later setup a web resource for webmail.
#The term'''DocumentRoot''' specifies where the Apache webserver will search for documents to serve. Create the file '''index.html''' in your '''DocumentRoot''' directory with the following contents (replace the date with the current one):
<pre>Hello, this is a web page on vm4vm1.yourid.org and the current time is Mar 28 22:16:27 EDT 2016!</pre>
<ol><li value="9">If you refresh your web-browser page in Firefoxyour browser, you should see the contents of your ''index.html'' document. If you wish, you can specify the filename index.html in the address, but it is not necessary, since the file index.html is automatically loaded by default when the URL refers to that directory containing that file.</li></ol>
#Replace our '''index.html''' file with an '''index.php''' with the following contents:
<pre>Hello, this is a web page on vm4vm1.yourid.org and the current time is <?php system("date"); ?>!</pre>
<ol><li value="2">On your host machine, again refresh your web-browser. Notice that in a web browser the ''index.php'' file isn't treated as a default page and the contents don't contain the date, but instead are displaying the text in the php code you entered into the index.php file (refer to above code).</li><li>The reason this occurs is that the PHP interpreter hasn't been installed on your Centos vm4 vm by default.</li><li>Install the php packeage on your vm4 vm1 machine. NOTE: The php package comes with a working default Apache configuration so you don't need to enable it manually.</li><li>Refresh the webpage for your web-browser on your host machine. You should now notice that you see the date instead of the call to the date command. Refresh your webpage several times to see how the time changes. This is simply a "trivial example" of dynamic web content does it does provide a simple demonstration of how scripting languages can be used to create more dynamic webpages.</li></ol>
=== Install, Configure and Run MySQL Database Server ===
::* Don't forget to set the password in the roundcube configuration.
<ol><li value="3">Note that both of your IMAP and SMTP servers are on different machines (i.e. not on vm4vm1). Therefore, you will need to set the following options for Roundcube:</li></ol>
::* '''$config['smtp_server']'''