First, the installation of CentOS
Download CentOS 7 and install it after burning to CD
Second, install Apache
Yum Install httpd #根据提示, enter Y to install successfully
Systemctl Start Httpd.service #启动apache
Systemctl Stop Httpd.service #停止apache
Systemctl Restart Httpd.service #重启apache
Systemctl Enable Httpd.service #设置apache开机启动
To open the server IP address in the client browser, the following interface appears, indicating that Apache installation was successful
Third, install MySQL
1. Download the MySQL repo source
$ wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
2. Install the MYSQL-COMMUNITY-RELEASE-EL7-5.NOARCH.RPM package
$ sudo rpm-ivh mysql-community-release-el7-5.noarch.rpm
After installing this package, you will get two MySQL yum repo Source:/etc/yum.repos.d/mysql-community.repo,/etc/yum.repos.d/mysql-community-source.repo.
3. Install MySQL
$ sudo yum install MySQL
$ sudo yum install Mysql-server
4. You can also install mariadb instead of MySQL
$ sudo yum install MariaDB
$ sudo yum install Mariadb-server
Iv. Installation of PHP
1. Install PHP
Yum Install PHP #根据提示输入Y直到安装完成
2, install PHP components, so that PHP support MariaDB
Yum install php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-bcmath Php-mhash
#这里选择以上安装包进行安装, enter Y return as prompted
Systemctl Restart Mariadb.service #重启MariaDB
Systemctl Restart Httpd.service #重启apache
3. Test PHP
$CD/var/www/html
$vi index.php #输入下面内容 (press the INSERT key)
<?php
Phpinfo ();
?>
#输入下面内容 (Press the ESC key to return to command-line mode)
: wq! #保存退出
Centos 7 Installation Lamp Environment