Friday 13 April 2012

LAMP server configuration in rhel6

[root@station1 ~]# yum groupinstall "MySQL Database server"
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Setting up Group Process
Resolving Dependencies
--> Running transaction check
---> Package mysql-server.x86_64 0:5.1.52-1.el6_0.1 will be installed
--> Processing Dependency: mysql = 5.1.52-1.el6_0.1 for package: mysql-server-5.1.52-1.el6_0.1.x86_64
--> Processing Dependency: perl-DBD-MySQL for package: mysql-server-5.1.52-1.el6_0.1.x86_64
--> Running transaction check
---> Package mysql.x86_64 0:5.1.52-1.el6_0.1 will be installed
---> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================
 Package                          Arch                     Version                            Repository                Size
=============================================================================================================================
Installing:
 mysql-server                     x86_64                   5.1.52-1.el6_0.1                   server                   8.1 M
Installing for dependencies:
 mysql                            x86_64                   5.1.52-1.el6_0.1                   server                   889 k
 perl-DBD-MySQL                   x86_64                   4.013-3.el6                        server                   134 k

Transaction Summary
=============================================================================================================================
Install       3 Package(s)

Total download size: 9.1 M
Installed size: 26 M
Is this ok [y/N]: y
Downloading Packages:
-----------------------------------------------------------------------------------------------------------------------------
Total                                                                                         37 MB/s | 9.1 MB     00:00    
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : mysql-5.1.52-1.el6_0.1.x86_64                                                                             1/3
  Installing : perl-DBD-MySQL-4.013-3.el6.x86_64                                                                         2/3
  Installing : mysql-server-5.1.52-1.el6_0.1.x86_64                                                                      3/3
Installed products updated.

Installed:
  mysql-server.x86_64 0:5.1.52-1.el6_0.1                                                                                    

Dependency Installed:
  mysql.x86_64 0:5.1.52-1.el6_0.1                             perl-DBD-MySQL.x86_64 0:4.013-3.el6                           

Complete!
[root@station1 samba]# service mysqld start
Initializing MySQL database:  Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h station1.example.com password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

                                                           [  OK  ]
Starting mysqld:                                           [  OK  ]
[root@station1 samba]# mysqladmin -u root password password
[root@station1 samba]# mysql -u root -ppassword
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.52 Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| test               |
+--------------------+
3 rows in set (0.00 sec)

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> DELETE FROM mysql.user WHERE user = '';
Query OK, 2 rows affected (0.00 sec)

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

mysql> quit
Bye

Now Download mysql-gui-tools-5.0r12-linux-x86_64.tar.gz this package extract and keep the folder in /opt directory
[root@station1 ~]# cd /opt/mysql-gui-tools-5.0/
[root@station1 mysql-gui-tools-5.0]# cp MySQLAdministrator.desktop MySQLQueryBrowser.desktop /root/Desktop/
now go to your desktop and double click these two files wait for few seconds and click mark trusted option now you
can see the icons. login as shown in the screenshot below password is your mysql password "password"



[root@station1 Desktop]# yum groupinstall "PHP Support"
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Setting up Group Process
Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:5.3.3-3.el6_1.3 will be installed
--> Processing Dependency: php-common = 5.3.3-3.el6_1.3 for package: php-5.3.3-3.el6_1.3.x86_64
--> Processing Dependency: php-cli = 5.3.3-3.el6_1.3 for package: php-5.3.3-3.el6_1.3.x86_64
---> Package php-gd.x86_64 0:5.3.3-3.el6_1.3 will be installed
---> Package php-pdo.x86_64 0:5.3.3-3.el6_1.3 will be installed
---> Package php-pear.noarch 1:1.9.4-4.el6 will be installed
---> Package php-xml.x86_64 0:5.3.3-3.el6_1.3 will be installed
--> Running transaction check
---> Package php-cli.x86_64 0:5.3.3-3.el6_1.3 will be installed
---> Package php-common.x86_64 0:5.3.3-3.el6_1.3 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================
 Package                       Arch                      Version                             Repository                 Size
=============================================================================================================================
Installing:
 php                           x86_64                    5.3.3-3.el6_1.3                     server                    1.1 M
 php-gd                        x86_64                    5.3.3-3.el6_1.3                     server                    103 k
 php-pdo                       x86_64                    5.3.3-3.el6_1.3                     server                     72 k
 php-pear                      noarch                    1:1.9.4-4.el6                       server                    393 k
 php-xml                       x86_64                    5.3.3-3.el6_1.3                     server                    100 k
Installing for dependencies:
 php-cli                       x86_64                    5.3.3-3.el6_1.3                     server                    2.2 M
 php-common                    x86_64                    5.3.3-3.el6_1.3                     server                    522 k

Transaction Summary
=============================================================================================================================
Install       7 Package(s)

Total download size: 4.5 M
Installed size: 16 M
Is this ok [y/N]: y
Downloading Packages:
-----------------------------------------------------------------------------------------------------------------------------
Total                                                                                         40 MB/s | 4.5 MB     00:00    
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : php-common-5.3.3-3.el6_1.3.x86_64                                                                         1/7
  Installing : php-cli-5.3.3-3.el6_1.3.x86_64                                                                            2/7
  Installing : 1:php-pear-1.9.4-4.el6.noarch                                                                             3/7
  Installing : php-5.3.3-3.el6_1.3.x86_64                                                                                4/7
  Installing : php-pdo-5.3.3-3.el6_1.3.x86_64                                                                            5/7
  Installing : php-xml-5.3.3-3.el6_1.3.x86_64                                                                            6/7
  Installing : php-gd-5.3.3-3.el6_1.3.x86_64                                                                             7/7
Installed products updated.

Installed:
  php.x86_64 0:5.3.3-3.el6_1.3           php-gd.x86_64 0:5.3.3-3.el6_1.3           php-pdo.x86_64 0:5.3.3-3.el6_1.3        
  php-pear.noarch 1:1.9.4-4.el6          php-xml.x86_64 0:5.3.3-3.el6_1.3        

Dependency Installed:
  php-cli.x86_64 0:5.3.3-3.el6_1.3                            php-common.x86_64 0:5.3.3-3.el6_1.3                          

Complete!
[root@station1 Desktop]# yum install -y php-mysql
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-mysql.x86_64 0:5.3.3-3.el6_1.3 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================
 Package                      Arch                      Version                              Repository                 Size
=============================================================================================================================
Installing:
 php-mysql                    x86_64                    5.3.3-3.el6_1.3                      server                     78 k

Transaction Summary
=============================================================================================================================
Install       1 Package(s)

Total download size: 78 k
Installed size: 215 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : php-mysql-5.3.3-3.el6_1.3.x86_64                                                                          1/1
Installed products updated.

Installed:
  php-mysql.x86_64 0:5.3.3-3.el6_1.3                                                                                        

Complete!
Now we have to install phpmyadmin graphical tool
click here to download phpmyadmin
[root@station1 ~]# yum install -y httpd*
now extract and copy the phpMyAdmin-3.4.10.1-english folder to document root
[root@station1 samba]# cp -a phpMyAdmin-3.4.10.1-english/ /var/www/html/
[root@station1 html]# cd /var/www/html/phpMyAdmin-3.4.10.1-english/
[root@station1 phpMyAdmin-3.4.10.1-english]# cp config.sample.inc.php config.inc.php
[root@station1 phpMyAdmin-3.4.10.1-english]# vim config.inc.php
 17 $cfg['blowfish_secret'] = 'ba17c1ec07d65003'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
 35 $cfg['Servers'][$i]['extension'] = 'mysql';
 68 $cfg['UploadDir'] = '/var/www/html/uploaddir';
 69 $cfg['SaveDir'] = '/var/www/html/downloaddir';
[root@station1 phpMyAdmin-3.4.10.1-english]# mkdir /var/www/html/uploaddir
[root@station1 phpMyAdmin-3.4.10.1-english]# mkdir /var/www/html/downloaddir

********for https secure connection am installing openssl**********
[root@station1 phpMyAdmin-3.4.10.1-english]# yum install -y openssl*
[root@station1 phpMyAdmin-3.4.10.1-english]# yum install -y mod_ssl*
[root@station1 phpMyAdmin-3.4.10.1-english]# yum install -y crypto-utils*
[root@station1 phpMyAdmin-3.4.10.1-english]# genkey station1.example.com
[root@station1 phpMyAdmin-3.4.10.1-english]# vim /etc/httpd/conf.d/ssl.conf
105 SSLCertificateFile /etc/pki/tls/certs/station1.example.com.crt
112 SSLCertificateKeyFile /etc/pki/tls/private/station1.example.com.key
[root@station1 phpMyAdmin-3.4.10.1-english]# service httpd restart
Stopping httpd:                                            [FAILED]
Starting httpd:                                            [  OK  ]
[root@station1 phpMyAdmin-3.4.10.1-english]# firefox https://station1.example.com/phpMyAdmin-3.4.10.1-english
**login root and password you kept for mysql.. if you follow my steps login is root and password is password**






3 comments:

  1. Hi... Where should i download the packages
    Yum groupinstall command doesnt run....
    says it doesnt find the group

    ReplyDelete
    Replies
    1. Follow this post for yum group configuration. http://visitmeranjith.blogspot.in/2012/04/yum-server-configuration.html

      Delete
  2. Renjit, i am struck up configuring joomla 2.5.8 in rhel6. No where in the net no article spks on rhel6 except urs. I am new to linux. never done installation from source code.

    ReplyDelete