13,420
edits
Changes
no edit summary
=== Creating a PHP File ===
'''Perform the following steps:''' #We'll replace our '''index.html''' file with an '''index.php''' with the following contents:
<pre>Hello, this is a web page on vm4.yourid.org and the current time is <?php system("date"); ?>!</pre>
<ol><li value="2">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 have exactly the text above. That's because the PHP interpreter isn't installed by default on CentOS. Install it. The package comes with a working default Apache configuration so you don't need to enable it manually. </li><li>Refresh the page, notice that you now see the date instead of the call to the date command. This is a trivial example of dynamic web content - it doesn't need to be the same every time you look at it.</li>,/ol>
=== Install, Configure and Run MySQL Database Server ===
MySQL is used to allow storage and retrieval of structured data. SQL is used by countless services for all kinds of use cases. Again we won't spend much time learning the details of MySQL configuration but you need a basic server set up. You may remember setting up MySQL from OPS235 - we're doing the nearly identical thing here.
#Install MySQL. You may notice that it's actually called MariaDB now. They are two separate projects run by different groups but they are compatible so you can use documentation from one to configure the other. Make sure you have not just the client but also the server software.#When you start the service - you'll get some instructions in the log file about setting a root password. Even though we won't configure our service to be accessible over the network - you should get into the habit of doing this with every MySQL installation you ever make.#Note that MySQL has two root passwords - one for localhost and one for external requests. Just run the two commands you're given in the log. Use a password you make up yourself, but don't use a secret password - you'll be putting it in a plain text file later.
== INVESTIGATION 2: INSTALL, CONFIGURE & RUN WEBMAIL APPLICATION (Roundcube Mail) ==
We'll install Roundcube Mail. Download the tarball from their website directly into the html directory of your vm4 using wget. This part may take some effort depending on the Sourceforge website.
'''Perform the following steps:''' #Extract the tarball and rename the directory to '''webmail'''.#In that directory there will be a file named '''INSTALL''' which will walk you through the rest of the installation.<br><br>Some notes:
::* Be careful about copy-pasting the MySQL setup part, don$config['t try to rush it.smtp_server']::* You$config['default_host'll need to install a couple more Apache modules]:: php-xml, php-pdo, and php-mysql.* Don$config['default_port't forget to set the password in the roundcube configuration.]
== COMPLETING THE LAB ==