In centos, yum is used to build and install the linux + apache + mysql + php environment and centosyum

Source: Internet
Author: User

In centos, yum is used to build and install the linux + apache + mysql + php environment and centosyum

I. Script YUM source installation:

1. yum install wget # install the download tool wget
2. wget # download atomic yum source, configure CentOS6.5 third-party yum Source
3. sh./atomic # Script Execution
4. yum check-update # update yum Software Package

Ii. 163yum source installation

1. Go to the yum source configuration directory.

cd /etc/yum.repos.d

2. yum source of the Backup System

mv CentOS-Base.repo CentOS-Base.repo.bk

3. Download Netease's yum source 163:


4. After updating the yum source, run the following command to update the yum configuration so that the operation takes effect immediately.

yum makecache
3. Add Alibaba yum update source code:

1. Install wget:

yum install wget -y

2. Back up your original image file to avoid restoration after an error occurs.

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

3. download the new CentOS-Base.repo to/etc/yum. repos. d/

CentOS 5:wget -O /etc/yum.repos.d/CentOS-Base.repo 6:wget -O /etc/yum.repos.d/CentOS-Base.repo 7:wget -O /etc/yum.repos.d/CentOS-Base.repo

4. Then recreate the cache:

yum clean allyum makecache
4. install and configure MySQL

1. Run the yum command to install MySQ

yum -y install mysql mysql-server

2. Add MySQL to the startup Item and start MySQL immediately.

Chkconfig -- levels 235 mysqld on # restart auto start service mysqld start # restart mysql service

3. Set the MySQL root Account Password


Press enter and enter Y as prompted.

Enter the password twice and press Enter.

Enter Y as prompted

Thanks for using MySQL!

MySql password is set and MySQL is restarted

service mysqld start  

[Root @ localhost ~] # Netstat-tulpn | grep-I mysql

Tcp 0 0 3306 * LISTEN 1723/mysqld

5. install Apache

1. Use the yum command to install Apache

yum –y install httpd

2. Set Apache startup

chkconfig --levels 235 httpd on

3. Start Apache

service httpd start

4. Enter http: // localhost or http: // local IP address in the browser. The Apache test page is displayed.

### Install some apache extensions ###

root@localhost ~]# yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql
6. install and configure PHP

1. Use the yum command to install PHP

[Root @ localhost ~] # Yum-y install php-mysql [root @ localhost ~] # Yum-y install gd php-gd-devel php-xml php-common php-mbstring php-ldap php-pear php-xmlrpc php-imap # install common php extensions

2. Restart the Apache server

[root@localhost ~]# service httpd restart

Ps: apache default website directory/var/www/html

Then, we provide the php page to test

[root@localhost ~]# cd /var/www/html/[root@localhost html]# vi index.php<?php   phpinfo();?>
7. install and configure phpMyAdmin

After installing MySQL, Apache, and PHP, we can install phpMyAdmin to manage the MySQL database visually.

Download the latest version to its official website:

In Windows, Navicat is also a very useful MySQL visualization tool, which is recommended.

[Root @ localhost ~] # Unzip

[Root @ localhost ~] # Music phpMyAdmin-4.2.6-all-languages/var/www/html/phpmyadmin

[Root @ localhost ~] # Cd/var/www/html/phpmyadmin

[Root @ localhost ~] # Cp libraries/config. default. php config. inc. php

[Root @ localhost ~] # Vi cnfig. inc. php

$ Cfg ['pmaabsoluteuri '] = ''; enter the phpMyAdmin access URL here.

$ Cfg ['servers'] [$ I] ['host'] = 'localhost'; // MySQL hostname or IP address

$ Cfg ['servers'] [$ I] ['Port'] = ''; // MySQL port-leave blank for default port

$ Cfg ['servers'] [$ I] ['user'] = 'root'; // enter the MySQL user name used to access phpMyAdmin. The default value is root.

Fg ['servers'] [$ I] ['Password'] = ''; // enter the password corresponding to the above MySQL user name.

# Restart the httpd service.

[Root @ localhost ~] # Service httpd restart

Type http: // localhost/phpmyadmin in the browser.

If you have access permissions, check SElinux.


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: 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.