Describes how to install the lamp environment using Yum under CentOs6.2, some brothers also like to use the installation method of compiling, personally feel that if not to the server to do custom, with yum install stable simple, why go to Download&make&make Install it.
Step1. Configure Rpmforge and Epel sources for CentOS. The official CentOS source is also sufficient, but some extensions like PHP, such as Php-mcrypt, are not in the official source.
The Rpmforge source can be downloaded and installed in http://pkgs.repoforge.org/rpmforge-release/, named rpmforge-release-*.i686.rpm or rpmforge-release-*. X86_64.RPM, find the latest version
Epel source can be found in the http://mirrors.ustc.edu.cn/Fedora/epel/6/, 32 system in the I386 folder, 64 bits in the x86_64 folder, named epel-release-6-*. NOARCH.RPM, find the latest version
Here is an example of a 32-bit system ,
#如果提示The requested URL returned error:404, please change yourself to the latest version
RPM-IVH http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
RPM-IVH http://download.Fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
Step 2. Installing PHP/MYSQL/HTTPD
#安装apache
Yum-y Install httpd Httpd-devel
#安装mysql
Yum-y install MySQL mysql-devel mysql-server mysql-libs
#安装php
Yum-y Install PHP
#安装php扩展
Yum-y Install php-mysql php-gd php-imap php-ldap php-odbc php-mbstring php-devel php-soap php-cli php-pdo
Yum-y Install Php-mcrypt php-tidy php-xml php-xmlrpc php-pear
#其它不常用php扩展, www.linuxidc.com can not be installed
Yum-y Install Php-pecl-memcache Php-eaccelerator
#安装phpmyadmin
Yum-y Install phpMyAdmin
#安装完成之后, start
Service httpd Start
Service mysqld Start
Step 3: Configure httpd, mysqld boot from
Chkconfig mysqld on
Chkconfig httpd on
Step 4: Configure phpMyAdmin
Modify/usr/share/phpmyadmin/config.inc.php
#将这里abcde文字修改为自己的字符, can be any
$cfg [' blowfish_secret '] = ' ABCDE ';
Problems
1. The phpMyAdmin prompt does not turn on Php-mcrypt because the php-mrcrpt extension is not installed. There is no php-mrcrpt extension in official source, please install Epel source and then yum install Php-mcrypt
2. phpMyAdmin Cannot access
phpMyAdmin By default can only be accessed using http://localhost/phpmyadmin, you can modify the corresponding part of the/etc/httpd/conf.d/phpmyadmin.conf into
<directory "/usr/share/phpmyadmin" >
Order Deny,allow
# Deny from all
Allow from all
</Directory>
But it's strongly not supportive, exposing phpmyadmin to insecurity.
Attention:
Apache parses PHP, modifies/etc/httpd/conf/httpd.conf files, adds
AddType application/x-httpd-php. php. phtml
AddType Application/x-httpd-php-source. Phps
MYQL can Telnet
Set MySQL password
mysql>; Use MySQL;
mysql>; UPDATE user SET Password=password (' newpassword ') WHERE user= ' root ';
mysql>; FLUSH privileges;
Allow remote logins
Mysql-u root-p
Enter Password: <your new password>
Mysql>grant all privileges on * * to ' user name ' @ '% ' identified by ' password ' with GRANT OPTION;
% is the service IP address. When you're done, you can manage MySQL remotely with Mysql-front.
Set to boot:
Chkconfig mysqld on
Change the authentication method of phpMyAdmin , change from cookie to http:
vi/usr/share/phpmyadmin/config.inc.php
$cfg [' Servers '] [$i] [' auth_type '] = ' http ';
CentOS 6.5 System installs lamp environment and phpMyAdmin detailed process using Yum mode