Welcome! This is a website that everyone can build together. It's easy!

LAMP Stack Installation Details

- General comments
- This documents the steps I took in building an application with PHP5 on Apache 2 and MySQL5 back end on RHEL5.0

- Install Red Hat Linux RHEL Server 5.0 from RHEL5-Server-20070208.0-x86_64-DVD.iso
- Be sure to set hostname (r4rhela10.setc.com in this example) and add an entry in hosts for that hostname
- Installs Apache httpd-2.2.3-6.el5 and PHP php-5.1.6-5.el5
- Customize
- Add user web with default home directory (/home/web); set password to "web"
- As root: useradd web; passwd web [web]
- Fix permissions on /home directories
- As root: chmod 755 /home/web;

- Install MySQL 5
- Remove any mysql packages with rpm -e (use rpm -qa|grep -i mysql to see installed packages)
- As root, rpm -iv following files from RHEL5 installation DVD in the order listed:
- perl-DBI-1.52-1.fc6.x86_64.rpm
- perl-DBD-MySQL-3.0007-1.fc6.x86_64.rpm
- mysql-5.0.22-2.1.x86_64.rpm
- mysql-server-5.0.22-2.1.x86_64.rpm
- php-pdo-5.1.6-5.el5.x86_64.rpm
- php-mysql-5.1.6-5.el5.x86_64.rpm
- Make mysqld start upon boot: chkconfig --level 35 mysqld on
- Start mysqld: service mysqld start
- Check: mysqladmin --password=(rootpw) status

- Initialize MySQL as root
- Create user web and remove anonymous user created by default installation
#mysql --password=(rootpw)
mysql> grant all privileges on *.* to web@localhost identified by 'web';
mysql> grant all privileges on *.* to web@r4rhela10.setc.com identified by 'web';
mysql> delete from mysql.user where User='';
- Modify configuration file
- Copy /usr/share/doc/mysql-server-5.0.22/my-large.cnf to /etc/my.cnf.1GB, apply edits in my.cnf.example.diff from ds2 MySQL kit
- As root: cd /etc; mv my.cnf my.cnf.orig; cp my.cnf.1GB my.cnf
- Optionally, add following line to mysqld section: log=/var/lib/mysql/mysql_query.log
- To put new cnf file into effect:
- shutdowm mysqld with service mysqld stop
- Assuming you don't need data in mysql file, in /var/lib/mysql, remove
- ibdata1, ib_logfile*, mysql-bin*
- service mysqld start
- To use log file, before starting MySQL:
cd /var/lib/mysql;touch mysql_query.log;chown mysql.mysql mysql_query.log; chmod 644 mysql_query.log (still needed?)

- As user web, set up DVD Store 2 (DS2) database
- Copy tarballs (ds2.tar.gz and ds2_mysql.tar.gz) from http://linux.dell.com/dvdstore to
/home/web/ and extract with tar xzf
- This creates /home/web/ds2 and subdirectories
- Either leave contents of /home/web/data_files alone (for small (10 MB) database) or copy over
medium (1GB) or large (100GB) files
- To build and load database, as web: sh mysqlds2_create_all.ksh

Contents of mysqlds2_create_all.sh:
# mysqlds2_create_all.sh
# start in ./ds2/mysqlds2
cd build
mysql -u web --password=web < mysqlds2_create_db.sql
mysql -u web --password=web < mysqlds2_create_ind.sql
mysql -u web --password=web < mysqlds2_create_sp.sql
cd ../load/cust
mysql -u web --password=web < mysqlds2_load_cust.sql
cd ../orders
mysql -u web --password=web < mysqlds2_load_orders.sql
mysql -u web --password=web < mysqlds2_load_orderlines.sql
mysql -u web --password=web < mysqlds2_load_cust_hist.sql
cd ../prod
mysql -u web --password=web < mysqlds2_load_prod.sql
mysql -u web --password=web < mysqlds2_load_inv.sql

- To test:
[web@r4rhela10 ~/ds2/mysqlds2]$ mysql --password=web
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12 to server version: 5.0.22

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use DS2
Database changed
mysql> select count(*) from CUSTOMERS;
+----------+
| count(*) |
+----------+
| 2000000 |
+----------+
1 row in set (2.64 sec)

mysql> select count(*) from PRODUCTS;
+----------+
| count(*) |
+----------+
| 100000 |
+----------+
1 row in set (0.00 sec)

- Set up Apache, PHP

- Set Apache to start upon system boot. As root: chkconfig --level 35 httpd on
- Modify /etc/httpd/conf/httpd.conf:
KeepAlive On
KeepAliveTimeout 50
ServerName r4rhelm605a10:80
AddType application/x-httpd-php .php
- Make following changes to PHP config file /etc/php.ini for MySQL:
uncomment error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
comment out error_reporting = E_ERROR
display_errors = On
mysqli.default_host = r4rhelm605a10
mysqli.default_user = web
mysqli.default_pw = web
- Start Apache: service httpd start


- Copy ds2 php files to /var/www/html/ds2:

dsbrowse.php, dslogin.php,dspurchase.php, dscommon.inc, dsnewcustomer.php, index.html


- Access http://r4rhela10/ds2 with browser


- Additional MySQL Commands:
mysql> show create table CUSTOMERS; // to show Create statement that would be used to create CUSTOMERS
mysql> select table_name, engine from information_schema.tables where table_schema='ds2';



Latest page update: made by DevinCanterberry , Aug 14 2008, 6:09 PM EDT (about this update About This Update DevinCanterberry Reverting change. - DevinCanterberry

1 word added
1 word deleted

view changes

- complete history)
Keyword tags: None
More Info: links to this page

There are no threads for this page. 

Anonymous  (Get credit for your thread)



By saving these changes, I acceptthis site's content policies and agree to comply with applicable copyright laws.