CentOS7.2 build a LAMP environment

The so-called Lamp is: Linux + Apache + mysql + php. Linux here use CentOS7.2.

0x00 we can start to update the look yum:

# Upgrade all packages as well as software upgrades and system kernel 
yum - the y- Update 
# upgrade all packages only, not upgrading software and system kernel 
yum - the y-upgrade

0x01 install Apache

yum -y install httpd 

0x02 install php

yum -y install php

0x03 installed php-fpm

yum -y install php-fpm

0x04 install mysql

yum -y install mysql

Installation mysql-server 0x05

CentOS 7+ used mariadbinstead of the MySQLdatabase software, it is not directly "yum -y install mysql-server" is installed, there are two methods.

install amariadb

yum install -y mariadb 

b download from the official websitemysql-server

wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

rpm -ivh mysql-community-release-el7-5.noarch.rpm

yum install mysql-community-server

Determined intermediate, direct input 'y' like the transport.

0x06 installed php-mysql

yum -y install php-mysql

Installation of common extended package 0x07

# Apache expansion pack 
yum - the y-install httpd - Manual mod_ssl mod_perl mod_auth_mysql 

# PHP extension package 
yum - the y-install PHP - gd PHP - xml PHP - mbstring PHP - the LDAP PHP - PEAR PHP - xmlrpc PHP - devel 

# Mysql extension package 
yum - the y- MySQL install - Connector - ODBC MySQL - devel libdbi - DBD - MySQL

0x08 configuration Apache, mysql boot (optional)

# Restart apache 
systemctl restart httpd.service 
# Set apache boot 
systemctl enable httpd.service 

# restart MariaDB 
systemctl restart mariadb.service 
# Set boot 
systemctl enable mariadb.service 

# restart the corresponding service 
Service mysqld restart 

Service PHP - FPM Start 

Service httpd restart

0x09 configuration mysql

Setting MySQL database root account password:

mysql_secure_installation

Enter current password for root - Enter
? Set root password [Y / n ] - Enter (to establish the root password)

Enter here the password you need to set, and then enter it again to confirm Enter:
New password:

? Remove anonymous users [Y / n ] ( delete anonymous users?) - Enter
Disallow root login remotely [Y / n ] ( do not allow root remote login yet?) -? Enter
Remove test database and access to it? [Y / n] - Enter
? Reload privilege tables now [Y / n] - Enter

0x10 test environment

The browser address bar enter '127.0.0.1' or 'localhost'.

 

 

Guess you like

Origin www.cnblogs.com/awrrays/p/11432026.html