Centos6.2 use Yum to install lamp and phpMyAdmin

Source: Internet
Author: User
Tags imap ldap mcrypt tidy

This article describes how to use YUM configuration to install the LAMP environment under CentOs6.2. Some brothers also like to use the compiled installation method. I personally think that if it is not customized for the server, the yum installation is stable and simple, why download & make install.

Step 1 configure the rpmforge and epel source for centos. The official centos source is actually enough, but some extensions like php, such as php-mcrypt, are not available in official sources.

You can find the latest version of rpmforge source in release or rpmforge-release-*. x86_64.rpm.

The epel source can be found in the http://mirrors.ustc.edu.cn/fedora/epel/6/, 32 systems in the i386 folder, 64-bit in the x86_64 folder, named epel-release-6-*. noarch. rpm, to find the latest version

Here we use a 32-bit system as an example,

For more information, see CentOS6.2. Use yum to install LAMP and phpMyadmin.

[Plain]
View plaincopyprint?
  1. # If The system prompts The requested URL returned error: 404, replace it with The latest version.
  2. Rpm-ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
  3. Rpm-ivh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
# If The requested URL returned error: 404 is prompted, replace it with The latest version rpm-ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpmrpm-ivh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm.

Step 2. install php/mysql/httpd

[Plain]
View plaincopyprint?
  1. # Install apache
  2. Yum-y install httpd-devel
  3. # Install mysql
  4. Yum-y install mysql-devel mysql-server mysql-libs
  5. # Install php
  6. Yum-y install php
  7. # Install php extensions
  8. Yum-y install php-mysql php-gd php-imap php-ldap php-odbc php-mbstring php-devel php-soap php-cli php-pdo
  9. Yum-y install php-mcrypt php-tidy php-xml php-xmlrpc php-pear
  10. # Other php extensions are not commonly used and do not need to be installed
  11. Yum-y install php-pecl-memcache php-eaccelerator
  12. # Install phpmyadmin
  13. Yum-y install phpmyadmin
  14. # Start after installation
  15. Service httpd start
  16. Service mysqld start
# Install apacheyum-y install httpd-devel # install mysqlyum-y install mysql-devel mysql-server mysql-libs # install phpyum-y install php # install php extension 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 # other php extensions that are not commonly used, you do not need to install yum-y install php-pecl-memcache php-eaccelerator # install phpmyadminyum-y install phpmyadmin # After installation is complete, start service httpd startservice mysqld start

Step 3. Configure httpd and mysqld to start automatically

[Plain]
View plaincopyprint?
  1. Chkconfig mysqld on
  2. Chkconfig httpd on
chkconfig mysqld onchkconfig httpd on

Step 4. Configure phpmyadmin

Modify/usr/share/phpmyadmin/config. inc. php

[Plain]
View plaincopyprint?
  1. # Modify the abcde text to your own character.
  2. $ Cfg ['blowfish _ secret'] = 'abcde ';
# Change the abcde text here to your own character, which can be any $ cfg ['blowfish _ secret'] = 'abcde ';

FAQs

1. phpmyadmin prompts that php-mcrypt is not enabled because the php-mrcrpt extension is not installed. No php-mrcrpt extension is available in official sources. Please install epel source before yum install php-mcrypt

2. phpmyadmin cannot be accessed

Phpmyadmin can only be accessed through http: // localhost/phpmyadmin by default. You can modify the corresponding part of/etc/httpd/conf. d/phpmyadmin. conf

[Plain]
View plaincopyprint?
  1. <Directory "/usr/share/phpmyadmin">
  2. Order Deny, Allow
  3. # Deny from all
  4. Allow from All
  5. </Directory>
<Directory "/usr/share/phpmyadmin">  Order Deny,Allow#  Deny from all  Allow from All</Directory>

However, it is strongly not supported to expose phpmyadmin to be insecure.

**************************************** ****

* Author: ye Wentao

* Link: CentOS6.2 install LAMP and phpMyadmin using yum

* ***************** For reprinting, please indicate the source ***************

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.