Monday, May 9, 2016

Installation Mysql, php, apache

My environment:



OS
Red Hat Enterprise Linux Server release 6.5 (Santiago)
MySQL
Version 5.1.73-community MySQL Community Server (GPL)
PHP
PHP 5.6.10 (cli)
Htdoc Directory
/u01/qlts/public_html
Apache Configuration Directory
/etc/httpd/conf

MySQL installation

Detail you can read it:

Step 1: Download MySQL
You access the internet via address:

Step 2: Extracting downloaded file to your installing directory:
[root@VTGDB.COM mysql]# tar -xvpf MySQL-community-5.1.73-1.rhel5.x86_64.rpm-bundle.tar 

Step 3: Install MySQL client-server:
[root@VTGDB.COM mysql]# rpm -ivh MySQL-server-community-5.1.73-1.rhel5.x86_64.rpm MySQL-client-community-5.1.73-1.rhel5.x86_64.rpm

Step 4: Install the “Header and Libraries” that are part of the MySQL-devel packages.
[root@VTGDB.COM mysql]# rpm -ivh MySQL-devel-community-5.1.73-1.rhel5.x86_64.rpm

Step 5: Change password for root
[root@VTGDB.COM mysql]# /usr/bin/mysqladmin -u root password '***********'

Step 6: Edit the MySQL Server configuration file:
[root@VTGDB.COM etc]# vi /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
port=3306
user=mysql

#UTF 8 Setting
collation_server=utf8_unicode_ci
character_set_server=utf8
skip-character-set-client-handshake

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

[mysqld_safe]
log-error=/u01/mysql/log/mysqld.log
pid-file=/u01/mysql/mysqld/mysqld.pid
[client]
port=3306

Step 7: Restart MySQL Server
[root@VTGDB.COM etc]# service mysql restart

Shutting down MySQL... [ OK ]

Starting MySQL. [ OK ]


Step 8: Login your new MySQL Server
[root@VTGDB.COM ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 604
Server version: 5.1.73-community MySQL Community Server (GPL)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>

Php Installation


Step 1: Download Php
You access the internet via address:

Step 2: Extract downloaded file to your installing directory:
[root@VTGDB.COM setup]# tar -xzvf php-5.6.10.tar.gz

Step 3: Run installation file
[root@VTGDB.COM setup]# cd php-5.6.10
[root@VTGDB.COM php-5.6.10]# ./configure  --with-apxs2=/usr/sbin/apxs  \
                                                                            --with-mysql  --with-pdo-mysql
[root@VTGDB.COM php-5.6.10]#make
[root@VTGDB.COM php-5.6.10]#make install

Step 4: Find and Edit php configuration file
[root@VTGDB.COM php-5.6.10]# cp php.ini-development /usr/local/lib/php.ini
[root@VTGDB.COM php-5.6.10]# vi /usr/local/lib/php.ini
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Asia/Ho_Chi_Minh

Step 5: Prepare application directory
[root@VTGDB.COM php-5.6.10]# chsh -s /bin/bash apache
[root@VTGDB.COM php-5.6.10]# mkdir -p /u01/qlts/public_html
[root@VTGDB.COM php-5.6.10]# chown –R apache:apache /u01/qlts/public_html

Step 6: Find and Edit httpd configuration file:
[root@VTGDB.COM php-5.6.10]# vi /etc/httpd/conf/httpd.conf
Listen 8080
User apache
Group apache
#    Options FollowSymLinks
#    Allow from all
#    AllowOverride None
    Options FollowSymLinks
    AllowOverride All
#AddType application/x-tar .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php .html
    ServerAdmin thonh53@gmail.com
    DocumentRoot /u01/qlts/public_html
    ServerName VTGDB.COM
    ServerAlias VTGDB
    ErrorLog /u01/qlts/log/error.log
#    CustomLog logs/dummy-host.example.com-access_log common


Step 7: Restart Apache server
[root@VTGDB.COM php-5.6.10]# service httpd restart

Step 8: Test php
[root@VTGDB.COM php-5.6.10]# su – apache
[apache@VTGDB.COM ~]# cd /u01/qlts/public_html
[apache@VTGDB.COM public_html]# vi info.php
<?php 
     phpinfo();
?>              
Open your browser access address: http://YOUR_IP_SERVER:8080/info.php


Share this

0 Comment to "Installation Mysql, php, apache"

Post a Comment