CPE111 COMPUTER EXPLORATION



Similar documents
Getting Started with Dynamic Web Sites

Installing an open source version of MateCat

Livezilla How to Install on Shared Hosting By: Jon Manning

Installation documentation for Ulteo Open Virtual Desktop

Ulteo Open Virtual Desktop Installation

ULTEO OPEN VIRTUAL DESKTOP UBUNTU (PRECISE PANGOLIN) SUPPORT

Installing Booked scheduler on CentOS 6.5

INASP: Effective Network Management Workshops

Welcome to Collage (Draft v0.1)

Mapping ITS s File Server Folder to Mosaic Windows to Publish a Website

INUVIKA OVD INSTALLING INUVIKA OVD ON UBUNTU (TRUSTY TAHR)

Network Management & Monitoring Request Tracker (RT) Installation and Configuration

LAMP Quickstart for Red Hat Enterprise Linux 4

MOODLE Installation on Windows Platform

PHP+MYSQL, EASYPHP INSTALLATION GUIDE

MassTransit 6.0 Enterprise Web Configuration for Macintosh OS 10.5 Server

Extending Remote Desktop for Large Installations. Distributed Package Installs

Installation of PHP, MariaDB, and Apache

How to Install Multicraft on a VPS or Dedicated Server (Ubuntu bit)

Cloud Homework instructions for AWS default instance (Red Hat based)

See the installation page

INSTALLING, CONFIGURING, AND DEVELOPING WITH XAMPP

TIMETABLE ADMINISTRATOR S MANUAL

HowTo. Planning table online

Installing CPV Lab Version 2.17

We begin with a number of definitions, and follow through to the conclusion of the installation.

Lesson 7 - Website Administration

ECT362 Installing Linux Virtual Machine in KL322

Apache Configuration

HOW TO BUILD A VMWARE APPLIANCE: A CASE STUDY

Tutorial Guide to the IS Unix Service

Creating a DUO MFA Service in AWS

How to use SURA in three simple steps:

AlienVault Unified Security Management (USM) 4.x-5.x. Deploying HIDS Agents to Linux Hosts

FireBLAST Marketing Solution v2

RecoveryVault Express Client User Manual

ITP 101 Project 3 - Dreamweaver

CEFNS Web Hosting a Guide for CS212

Setting up a local working copy with SVN, MAMP and rsync. Agentic

INSTALL ZENTYAL SERVER

1. Product Information

JAMF Software Server Installation Guide for Linux. Version 8.6

Application note: Connecting the to a Database

Online Backup Linux Client User Manual

Online Backup Client User Manual Linux

Installation Instructions

Building Website with Drupal 7

Installing Drupal on Your Local Computer

Online Backup Client User Manual

How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu

AJ Matrix V5. Installation Manual

Install BA Server with Your Own BA Repository

A SHORT INTRODUCTION TO DUPLICITY WITH CLOUD OBJECT STORAGE. Version

How to install and use the File Sharing Outlook Plugin

Online shopping store

Setting Up a Development Server

Local Caching Servers (LCS): User Manual

Modelling with R and MySQL. - Manual - Gesine Bökenkamp, Frauke Wiese, Clemens Wingenbach

Installation Guidelines (MySQL database & Archivists Toolkit client)

Project management integrated into Outlook

INUVIKA OVD INSTALLING INUVIKA OVD ON RHEL 6

Personal Portfolios on Blackboard

Install and configure Apache, MySQL, PHP on OSX 10.8 Mountain Lion

Online Backup Client User Manual

How do I Install and Configure MS Remote Desktop for the Haas Terminal Server on my Mac?


MySQL quick start guide

ULTEO OPEN VIRTUAL DESKTOP V4.0

MySQL Quick Start Guide

How To Configure CU*BASE Encryption

Site Store Pro. INSTALLATION GUIDE WPCartPro Wordpress Plugin Version

INSTALLING MÜSE UPDATES FOR ISTAN

The Tor VM Project. Installing the Build Environment & Building Tor VM. Copyright The Tor Project, Inc. Authors: Martin Peck and Kyle Williams

Installation Instructions

How to install phpbb forum on NTU student club web server

nitrobit update server

Local Caching Servers (LCS) February 2015

1. Open the Account Settings window by clicking on Account Settings from the Entourage menu.

Document Freedom Workshop DFW 2012: CMS, Moodle and Web Publishing

Contents: 1. Preparation/download files 2. Apache HTTPD Web Server MySQL PHP PHPMyAdmin Ruby On Rails 1.8.

DocuSign for SharePoint

Active Directory Integration for Greentree

Installing Proview on an Windows XP machine

Pentagon Message Exchange Setup Guide: All Devices

ProjectPier v Getting Started Guide

Hadoop Basics with InfoSphere BigInsights

Smartphone Pentest Framework v0.1. User Guide

CSCI110 Exercise 4: Database - MySQL

Note: With v3.2, the DocuSign Fetch application was renamed DocuSign Retrieve.

Fermilab Central Web Service Site Owner User Manual. DocDB: CS-doc-5372

MySQL Quick Start Guide

VERSION 9.02 INSTALLATION GUIDE.

Getting Started using the SQuirreL SQL Client

1. Install a Virtual Machine Download Ubuntu Ubuntu LTS Create a New Virtual Machine... 2

Using VirtualBox ACHOTL1 Virtual Machines

How do I Install and Configure MS Remote Desktop for the Haas Terminal Server on my Mac?

About This Document 3. About the Migration Process 4. Requirements and Prerequisites 5. Requirements... 5 Prerequisites... 5

SETTING UP A LAMP SERVER REMOTELY

UP L18 Enhanced MDM and Updated Protection Hands-On Lab

Transcription:

CPE111 COMPUTER EXPLORATION BUILDING A WEB SERVER ASSIGNMENT You will create your own web application on your local web server in your newly installed Ubuntu Desktop on Oracle VM VirtualBox. This is a common task in computer professional everyday job. You can pair up with your friend to create a group. You will capture screen shots and create a report about results of various steps in installing softwares, configuring services or daemons, installing database management tool, create your database, test html, test php, and creating your web application. You can create a document in either doc or PDF format. Name your file with section follows by last three digits of your id and ends it with webserver. For example, A_111_222_webserver, AE_111_222_webserver. Submit your report in lms at the end of the session. INTRODUCTION After you have built a server platform, the next task is to configure server applications and user right or access. We are going to explore the alternative to start up a server of your own for your web development. You could use Microsoft products or use could use open source products. The trio that is very popular as web server and database server are Apache, PHP, and MySQL. The packages are available on both Microsoft and Linux environment. However, in the future, you may have a higher chance to be exposed to MS platform, so we are going to explore the alternative open source on Linux. Since you already have your Ubuntu Desktop installed, you only need to install a couple more softwares mentioned earlier. Apache is the name of a very popular httpd server which allows you to develop your website with HTML. Meanwhile, your data will be stored and managed by a database management system called MySQL. To retrieve data from MySQL server and create HTML webpages, a popular script language called PHP is used. We are going to explore how this platform works by installing, configuring, and developing a web site. GETTING STARTED You should already have your Ubuntu Desktop installed in your VM from the previous session. If you don t have or delete it, you will have to create a VM and install Ubuntu Desktop again. GAIN YOUR SUPER POWER After log in with your username and password, you will have to perform various administrative tasks to setup your web server and your database server. To do so, you require a super user (normally called root) privilege which can be gained with sudo and su command. Usually, su will change your privilege to other user (think of it as you can change yourself to someone else), in this case, super user (or root). However, you have to know the target user s password to use su (which you don t obviously). Instead of su, sudo will run a command with super user privilege with your own password (if you are allowed to do so, complicated stuffs, huh?). You will capture your screen shot

have to use sudo to run su command so that you don t have to know super user s password. In linux system, the super user account is root. First of all, you have to gain access to a Terminal or xterm. Use your dash home to launch a terminal. You now can access to a command shell in linux system where you can type in various commands. To gain super user privilege, use the following command which is running su with sudo. This will allow you to use your password to gain root access. $sudo su - After this command, your prompt will change from $ to # indicating that you now have root privilege. Be warned, after this step, you can pretty much destroy everything on your linux if you do something wrong. CHECK YOUR SOFTWARES We are going to install three softwares which are apache web server, php, and mysql server. First you have to verify if they are already installed. Ubuntu is a Debian-based linux which uses dpkg command to check for installed packages. The following command will show the package that you try to locate. #dpkg --get-selections apache #dpkg --get-selections php #dpkg --get-selections mysql If you don t have any result, you will need to install the missing software, for our case, all of them. It is performed by apt-get command as you can type it at the command prompt follows by install and application name. After each command, follow the installing guide instructions. Be sure to jot your mysql password down. After installing the applications, you should verify that they are properly installed. Use the following dpkg command. #apt-get install apache2 # apt-get install mysql-server # apt-get install php5 #apt-get install php5-mysql #dpkg --get-selections apa php mysql CONFIGURING SERVERS At this step, you will have to configure your servers so that they can host your web application in your user account. capture your screen shot

APACHE2 You have to enable UserDir support for apache2 httpd server. You have to create a symbolic link to available configuration. First change your directory to /etc/apache2/mods-enabled and verify if you are there. Follow these two commands for this step. #cd /etc/apache2/mods-enabled #pwd Once you are there, create symbolic links to userdir configurations from mods-available. Use this command to do so. You can also use apache utility a2enmod to do it. Pick either ln or a2enmod #ln s../mods-available/userdir.. #a2enmod userdir #ls l userdir. #xedit php5.conf & You should now have the configuration files. You will have to check php5.conf under the same directory and make sure that you comment the part that disable php engine out. Use xedit to open the php5.conf file and comment the part. Then it is time to restart the httpd server with the following command. #/etc/init.d/apache2 restart #service mysql restart At this point, we are going to test our newly created web server. First of all, we are going to gain access to another terminal on a different desktop by clicking at workspace icon. Pick one desktop that is empty and launch another terminal with dash home. You should notice that your prompt in this new terminal is $ indicating that this terminal is running as yourself. At this step you have to create a folder named public_html under your root directory (~) with this command. Then you will try to create your index.html in there with the following xedit command. $mkdir ~/public_html $xedit ~/public_html/index.html & In the xedit window, put the following html tags in the editor and save. After that you have to run a web browser by clicking firefox icon. capture your screen shot

Enter the following URL into firefix address. http://localhost/~yourname/. It should work, otherwise you have to check each steps again to make sure that you didn t do anything wrong. Your httpd server preparation is done at this point. MYSQL SERVER AND PHPMYADMIN With the current firefox browser still active, enter www.phpmyadmin.net into address bar. Download.gz version and save it. It should be under ~/download/. We are going to extract it to ~/public_html with the following commands from your normal shell. $cd ~/public_html $tar xzf ~/Downloads/phpMyAdmin-3.5.3-all-languages.tar.gz $ln s phpmyadmin-3.5.3-all-languages phpmyadmin $ ls -l Now go back to your firefox browser, put localhost/~yourname/phpmyadmin as URL then go. If there is nothing wrong, you should have a login page to MySQL databse. Use root as the user with the password you jotted down. Take another screen shot here. DATABASE CREATION AND DATA INSERTION We are going to create a database in MySQL DBMS server to store our tables and data. Click at databases and put database name under create database label. Hit create button you will see a message. You will notice your new database under Databases, click it. On the top, you will notice your database name after localhost. Create a table called topics with two columns. First column is tp_id and second column is tp_desc. Change tp_desc type to varchar with 256 as length. Click on the name of your new table you should see two fields of your table. Select the checkbox in front of tp_id capture your screen shot

then select add primary key under More. Now click insert on the top tabs and insert couple of records of data. Just put integer for tp_id and string for tp_desc then click go button. Now you can click at Browse and you should see your records of data. Take another screen shot here. PHP PAGE WITH DATA FROM MYSQL You are about to create a php page that retrieve records from topics table. First of all, your file will be named test.php under public_html. Use xedit to create it like this. $xedit ~/public_html/test.php & The first line of this file will be <? and the last line will be?>. In between is the code to :- 1. Connect to MySQL, 2. select a database, 3. perform a query, 4. Close connection, then 5. show the result. Step 1: set some variables and connect to MySQL $username="username"; $password="password"; $database="your_database"; mysql_connect( localhost,$username,$password); Step 2: select database @mysql_select_db($database) or die( "Unable to select database"); Step 3: perform a query $query="select FROM topics"; $result=mysql_query($query); $num=mysql_numrows($result); Step 4: close database capture your screen shot

mysql_close(); Step 5: show result $i=0; while ($i < $num) { $tp_id=mysql_result($result,$i,"tp_id"); $tp_desc=mysql_result($result,$i,"tp_desc"); echo "<b>$i.</b> $tp_id $tp_desc<br>"; $i++; } Combine these steps into test.php then save the file. Now you can go back to your browser and put localhost/~yourname/test.php in as URL. If there is nothing wrong, you should see a list of your data in the browser page. Capture a screen shot here also. EXTRA 1. Can you format your result in a table? 2. Can your show records in alternating colors? E.g odd number in blue, even number in green. 3. Can you create a group of checkboxes from tdoehe list you retrieved? capture your screen shot