Open main menu

CDOT Wiki β

Changes

OPS335 Lab 5

239 bytes added, 13:04, 30 March 2016
no edit summary
==WEB SERVER RESOURCES==[[File:Example.jpg]]
Online References:
'''Perform the following steps:'''
#Make certain you are in your '''VM4''' 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.
<pre>Hello, this is a web page on vm4.yourid.org and the current time is Mar 28 22:16:27 EDT 2016!</pre>
<ol><li value="67">If you refresh your web-browser page in Firefox, 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>
=== Creating a PHP File ===
In order to allow us to run a webserver application in a web-browser, we need a scripting language that will allow the web-browser to function dynamically (i.e. in "real time"being able to change frequently, as opposed to being "static" or unchanging). In this section, we will demonstrate how a scripting language (PHP) can be used for the web-browser to react in a more dynamicallydynamic fashion.
'''Perform the following steps:'''
#We'll replace 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 are displaying the text in the php code you entered into the index.php file (refer to abovecode). That's because </li><li>The reason this occurs is that the PHP interpreter isnhasn't been installed on your Centos vm by default on CentOS. </li><li>Install itthe php packeage on your vm4 machine. 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 ===
13,420
edits