cd ..

Complete LAMP Setup
Redaction : 5/5/2007

Install PHP5

On Centos 4 the php branch is only php4, why ??? it's strange because php5 is ready for production and stable, so i purposed a simple method with YUM package manager to install it, with centos plus :

[root@vsrv1 download]# yum --enablerepo=centosplus install php*
it's also possible to use upgrade command it depend your php setup (php4 can already exist on your OS).

 

Install MYSQL 5

Like the PHP install a mysql server is simple with Centos Plus repository :

[root@vsrv1 download]# yum --enablerepo=centosplus install mysql-server

After setup php/mysql it interesting to secure it ... let's go

Setup MYSQL 5 Server


After install and run mysql server the root password is empty !! it mean that everybody can change and access to mysql ! so first of all we 'll change it, after that it's interesting to clean unused database "test".

[root@vsrv1 download]# mysql -u root mysql

Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.27 Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> SET PASSWORD FOR root@localhost=PASSWORD('mypassword');
mysql> exit
Bye

[root@vsrv1 download]# service mysqld restart
Arrêt de MySQL : [ OK ]
Démarrage de MySQL : [ OK ]
[root@vsrv1 download]#
[root@vsrv1 download]# mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Create user and database

So now it work and it's secure, to connect now you need comutator -p on mysql client :

mysql -u root -p

Create Database and dedicated user

Now we 've secure and working configuration we can add database and user like that :

- user is crxuser and database name is crxcluster :

mysql> CREATE DATABASE crxcluster
-> ;
Query OK, 1 row affected (0.01 sec)

mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP ON crxcluster.* TO crxuser@"localhost" IDENTIFIED BY "password";

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

mysql> exit

Setup PHPMYADMIN

After download phpmyadmin (like wget) we can install it and setup apache directory and alias.

First of all we unpack inside wanted directory here /data/www/phpmyadmin/

[root@vsrv1 download]# tar -xvzf phpMyAdmin-2.10.1-all-languages.tar.gz -C /data/www/
[root@vsrv1 download]# cd /data/www/
[root@vsrv1 www]# ls
phpMyAdmin-2.10.1-all-languages
[root@vsrv1 www]# mv phpMyAdmin-2.10.1-all-languages/ phpmyadmin/

 

© Bastien Barbe 2008