LAMP Quickstart for Red Hat Enterprise Linux 4



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

Installing Booked scheduler on CentOS 6.5

INUVIKA OVD INSTALLING INUVIKA OVD ON RHEL 6

Host your websites. The process to host a single website is different from having multiple sites.

Installation documentation for Ulteo Open Virtual Desktop

Ulteo Open Virtual Desktop Installation

Setting Up Specify to use a Shared Workstation as a Database Server

CPE111 COMPUTER EXPLORATION

HOW TO BUILD A VMWARE APPLIANCE: A CASE STUDY

Deploying IBM Lotus Domino on Red Hat Enterprise Linux 5. Version 1.0

Server Installation/Upgrade Guide

Extending Remote Desktop for Large Installations. Distributed Package Installs

Install Cacti Network Monitoring Tool on CentOS 6.4 / RHEL 6.4 / Scientific Linux 6.4

Installing and Running MOVES on Linux

How To Install Amyshelf On Windows 2000 Or Later

LAMP : THE PROMINENT OPEN SOURCE WEB PLATFORM FOR QUERY EXECUTION AND RESOURCE OPTIMIZATION. R. Mohanty Mumbai, India

Moving Drupal to the Cloud: A step-by-step guide and reference document for hosting a Drupal web site on Amazon Web Services

Omnistar Recruiter Install User Guide (Codelock)

Dell Proximity Printing Solution. Installation Guide

Rancid Server Build and Operation Overview (v0.3) (This is being done from memory so expect some errors)

Installation Instructions

vtiger CRM 4.2 Installation Guide for Linux OS

How to Install SMTPSwith Mailer on Centos Server/VPS

System and Network Monitoring With Zabbix

Installation of PHP, MariaDB, and Apache

Red Hat JBoss Core Services Apache HTTP Server 2.4 Apache HTTP Server Installation Guide

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

SEAGATE BUSINESS NAS ACCESSING THE SHELL. February 1, 2014 by Jeroen Diel IT Nerdbox

Migrating LAMP stack from x86 to Power using the Server Consolidation Tool

Desktop : Ubuntu Desktop, Ubuntu Desktop Server : RedHat EL 5, RedHat EL 6, Ubuntu Server, Ubuntu Server, CentOS 5, CentOS 6

OpenPro ERP Software Installation Guide REDHAT LINUX

ProjectPier v Getting Started Guide

Livezilla How to Install on Shared Hosting By: Jon Manning

Enterprise Reporting Server v3.5

Apache 2.0 Installation Guide

CommandCenter Secure Gateway

Installing an open source version of MateCat

dotdefender v5.12 for Apache Installation Guide Applicure Web Application Firewall Applicure Technologies Ltd. 1 of 11 support@applicure.

Expresso Quick Install

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

How to use SURA in three simple steps:

Recommended File System Ownership and Privileges

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

IIS, FTP Server and Windows

Lab 2: Secure Network Administration Principles - Log Analysis

User Manual of the Pre-built Ubuntu 9 Virutal Machine

Welcome to Collage (Draft v0.1)

LOCKSS on LINUX. Installation Manual and the OpenBSD Transition 02/17/2011

Cybozu Garoon 3 Server Distributed System Installation Guide Edition 3.1 Cybozu, Inc.

SAMBA SERVER (PDC) Samba is comprised of a suite of RPMs that come on the RHEL/Fedora CDs. The files are named:

Backup and Restore MySQL Databases

CO Web Server Administration and Security. By: Szymon Machajewski

Apache and Virtual Hosts Exercises

NetIQ Sentinel Quick Start Guide

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

OpenGeo Suite for Linux Release 3.0

Backup of ESXi Virtual Machines using Affa

INASP: Effective Network Management Workshops

Cacti complete network graphing solution. Oz Melamed E&M Computing Jun 2009

Cassandra Installation over Ubuntu 1. Installing VMware player:

XCloner Official User Manual

MassTransit 6.0 Enterprise Web Configuration for Macintosh OS 10.5 Server

Develop and Test Your PHP Applications on the IBM cloud

Quick Start Guide for Parallels Virtuozzo

SETTING UP A LAMP SERVER REMOTELY

Hadoop Basics with InfoSphere BigInsights

PHP+MYSQL, EASYPHP INSTALLATION GUIDE

Content Management System

Using Cacti To Graph MySQL s Metrics

UQC103S1 UFCE Systems Development. uqc103s/ufce PHP-mySQL 1

SIMIAN systems. Setting up a Sitellite development environment on Mac OS X. Sitellite Content Management System

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

VPS Remote Computing. Connecting to a Windows Server for the first time. 1 Your Server has been installed. 2 Finding the login details for your Server

Signiant Agent installation

Virtual Appliance for VMware Server. Getting Started Guide. Revision Warning and Disclaimer

Web Server using Apache. Heng Sovannarith

Installing Rails 2.3 Under CentOS/RHEL 5 and Apache 2.2

HOW TO SETUP AN APACHE WEB SERVER AND INTEGRATE COLDFUSION

SIMIAN systems. Setting up a Sitellite development environment on Windows. Sitellite Content Management System

JAMF Software Server Installation Guide for Linux. Version 8.6

IMPLEMENTATION OF CIPA - PUDUCHERRY UT SERVER MANAGEMENT. Client/Server Installation Notes - Prepared by NIC, Puducherry UT.

IBM DB2 for Linux, UNIX, and Windows. Deploying IBM DB2 Express-C with PHP on Ubuntu Linux

CN=Monitor Installation and Configuration v2.0

Accessing vlabs using the VMware Horizon View Client for OSX

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

HOW TO SILENTLY INSTALL CLOUD LINK REMOTELY WITHOUT SUPERVISION

Introduction to Operating Systems

Using Red Hat Enterprise Linux with Georgia Tech's RHN Satellite Server Installing Red Hat Enterprise Linux

INUVIKA OVD INSTALLING INUVIKA OVD ON UBUNTU (TRUSTY TAHR)

Hadoop Basics with InfoSphere BigInsights

Newton Linux User Group Graphing SNMP with Cacti and RRDtool

Cacti The ULTIMATE Management Solution

Plexxi Control Installation Guide Release 2.1.0

Installation Guide for WebSphere Application Server (WAS) and its Fix Packs on AIX V5.3L

Joining an XP workstation to a domain Version 1.00

Installation Guide for FTMS and Node Manager 1.6.0

Installing IBM Websphere Application Server 7 and 8 on OS4 Enterprise Linux

Transcription:

LAMP Quickstart for Red Hat Enterprise Linux 4 Dave Jaffe Dell Enterprise Marketing December 2005 Introduction A very common way to build web applications with a database backend is called a LAMP Stack, where LAMP stands for the Linux operating system, the Apache web server, the MySQL database, and the PHP (or Perl or Python) web application language. This Quickstart will take you through configuring and starting up the LAMP components, and then downloading, installing and testing a complete LAMP application, an online DVD Store written by Dell engineers. The DVD Store application, including four PHP pages and the code needed to build and load the MySQL database, can be used as a model for your own LAMP web application. This Quickstart assumes you have successfully installed Red Hat Enterprise Linux 4 on your server (RHEL4 ES edition was used for the test but the instructions should be similar for the other RHEL4 editions) and are moderately familiar with Linux commands (you will need to be able to edit files). Total time to work through the Quickstart should be 30 60 minutes. Getting Started For ease of use, log into the system as root. Verify that the required packages have been installed. To do this, click on Applications => Systems Settings => Add/Remove Packages. This will bring up a window showing all of the packages available, and what has already been installed, sorted by groups. Scroll down to the Servers section and verify the Web Server and MySQL Database have been checked. Under details of MySQL Database, verify that both php-mysql and mysql-server have also been checked. If any of these items have not been previously checked, simply click the update button at the bottom of the window and provide the appropriate installation media as requested. For purposes of this document, the hostname is rhel4es and the root password is password (you should use something more creative, of course!). You will need to ensure that all of the appropriate host name information has been set in your network environment (updating DNS, or /etc/hosts, etc.) You will need to create a non-root user to own the PHP and MySQL code. We used user web with password web. lamp_quickstart_final.doc December 2005 1/8

To create the web user, open a terminal shell (right click anywhere on the desktop, select Open Terminal ). Type the following (ideally you can cut and paste right from this Quickstart to your Linux command shell). In this document commands that you type or that are printed by the computer are indicated in monospace font. useradd web passwd web At this point, it will prompt you for the new password. Use web as the password (ignore the warnings for BAD PASSWORD you can always change this later). For the rest of this document you will enter some commands as root and some as web. [Hint: use two Linux command shells, one for root, one for web. If you are logged in as root you can use the command su web to login as web in that command shell]. Start and Test Apache To run the Apache web server you first need to make a small modification to the Apache configuration file, then start the Apache service (known as httpd ), and finally configure it so it will always start when the machine is booted: cd /etc/httpd/conf cp httpd.conf httpd.conf.orig gedit httpd.conf Find the line with #ServerName new.host.name:80 and add below it: ServerName rhel4es Save your changes; close the window. Next, you will start the web server, and configure it so that it will automatically start on the next reboot. Type the following into the shell window: service httpd start chkconfig httpd on To test Apache, bring up a web browser with URL http://localhost. You should see the Red Hat Enterprise Linux Test Page: lamp_quickstart_final.doc December 2005 2/8

Start and Test MySQL Before starting MySQL, you ll need to create a MySQL configuration file from one of the standard ones offered. As root, copy the standard small configuration file to /etc/my.cnf and add 4 lines to the end of it. Type the following into the terminal window: cd /etc cp /usr/share/doc/mysql-server-4.1.7/my-small.cnf my.cnf cat >> my.cnf <hit Enter, then paste in next 4 lines> # For DVD Store full text search ft_min_word_len = 3 ft_stopword_file = log=/var/lib/mysql/mysql_query.log <Enter Ctrl-C> Next you need to start the MySQL service (called mysqld ), and set it to always start when the machine starts. Type the following into the terminal shell: service mysqld start chkconfig mysqld on Now configure user access to the MySQL database. To change root s password (replace the final password with your root password), give privileges to the web lamp_quickstart_final.doc December 2005 3/8

user, and remove the default anonymous user, type the following into the terminal shell: mysqladmin -u root password password mysql -p This will prompt you for the password you just entered above, and start the MySQL monitor. You will need to ensure that you also add access based on your specific host name as well (i.e. web@localhost.localdomain). Type the following at the mysql> prompt: grant all privileges on *.* to web@localhost identified by 'web'; grant all privileges on *.* to web@rhel4es identified by 'web'; delete from mysql.user where User=''; exit Login as web and test out MySQL: su web mysql u web -password=web This will start the MySQL monitor as the user web. Type the following at the mysql> prompt to test it: show databases; You should get output that looks something like: Database mysql test 2 rows in set (0.00 sec) Type exit to leave the MySQL monitor. Type exit again to log out as web. This shows that MySQL has been installed with the initial two databases. Start and Test PHP As root, edit the PHP configuration file to point to the correct host and allow access to the web user, then restart Apache to read changes. In the terminal window, type the following: cd /etc cp php.ini php.ini.orig gedit php.ini Change three lines to read as follows: mysql.default_host = rhel4es lamp_quickstart_final.doc December 2005 4/8

mysql.default_user = web mysql.default_pw = web Save the document, close the window, then continue typing the following into the terminal shell window to restart the web server and put the changes you just made into effect: service httpd restart To test PHP, create a test PHP page. Type the following into the terminal window: cd /var/www/html gedit default.php Add the following to the file: <html> <head> <title>php Test Page</title> </head> <body> <?php echo <hr /> ; echo <p align=center>this is a test of PHP!</p> ; echo <hr /> ; echo <p align=center>copyright 2005 Dell</p> ;?> </body> </html> To test, use your browser to access http://localhost/default.php. It should look like lamp_quickstart_final.doc December 2005 5/8

Install and Test the DVD Store LAMP Application Now you are ready to install a full LAMP application, the Dell DVD Store application. This application has been released by Dell to the open source community under the GPL license and is available for all to use. First, download in binary the DVD Store files ds2.tar.gz and ds2_mysql.tar.gz from http://linux.dell.com/dvdstore to web s home directory, /home/web. To accomplish this, type the following from the terminal window: su web wget http://linux.dell.com/dvdstore/ds2.tar.gz wget http://linux.dell.com/dvdstore/ds2_mysql.tar.gz Then expand these tarballs with: tar xvzf ds2.tar.gz tar xvzf ds2_mysql.tar.gz This will create several directories under /home/web/ds2 with the DVD Store data files and driver programs, as well as the MySQL build and load scripts. Now, as root, you will need to create a directory to put the PHP pages: cd /var/www/html mkdir ds2 Now, the PHP files need to be copied to the new directory: cd ds2 cp ~/ds2/mysqlds2/web/php4/*. Now you are ready to create and test the MySQL DVD Store database. As web: cd ~/ds2/mysqlds2 sh mysqlds2_create_all_nosp.sh mysql u web --password=web mysql> use DS2; mysql> show tables; +---------------+ Tables_in_DS2 +---------------+ CATEGORIES CUSTOMERS CUST_HIST INVENTORY ORDERLINES ORDERS PRODUCTS REORDER +---------------+ 8 rows in set (0.00 sec) lamp_quickstart_final.doc December 2005 6/8

mysql> select count(*) from CUSTOMERS; count(*) 20000 1 row in set (0.01 sec) mysql> exit This shows that the DVD Store has been installed correctly with 8 tables and 20,000 initial customers. The DVD Store LAMP stack is ready for testing. With your browser, access http://rhel4es/ds2. You should see the DVD Store Login page: lamp_quickstart_final.doc December 2005 7/8

Login with Username user2 and password password. You should see the following Welcome screen: Click on Start Shopping, search for some DVDs by Title, Actor or Category, add DVDs to your shopping cart, and finally purchase them using your stored credit card number. You now have a working LAMP stack. By basing your application on the MySQL and PHP code included here, you can jumpstart your own LAMP stack! THIS PAPER IS FOR INFORMATIONAL PURPOSES ONLY, AND MAY CONTAIN TYPOGRAPHICAL ERRORS AND TECHNICAL INACCURACIES. THE CONTENT IS PROVIDED AS IS, WITHOUT EXPRESS OR IMPLIED WARRANTIES OF ANY KIND. lamp_quickstart_final.doc December 2005 8/8