1、 Update Centos7 download source
Remember to backup before updating! ! !
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
Reference: http://mirrors.aliyun.com/help/centos
163 Source reference: http://mirrors.163.com/.help/centos.html
2、 Update local cache
yum clean all
yum makecache
3、 Install network tools
yum install net-tools
If you want to use commands such as ifconfig
4、 Close firewall
systemctl stop firewalld.service
systemctl disable firewalld.service
5、 Close selinux
vi /etc/selinux/config
Comment #SELINUX=enforcing
Comment#SELINUXTYPE=targeted
Add SELINUX=disabled
Save and exit: wq
setenforce 0#Close selinux
6、 Install apache
yum install httpd
7、 Install Mariadb
yum install mariadb mariadb-server
Copy the configuration file to overwrite the original configuration file
cp /usr/share/mysql/my-huge.cnf /etc/my.cnf
8、 Install PHP
yum install phpphp-mysql php-gd php-odbc php-pear php-mbstring php-mcrypt
9、 Download PHPmyadmin
wget https://files.phpmyadmin.net/phpMyAdmin/4.0.0/phpMyAdmin-4.0.0-all-languages.zip
Unzip to /var/www/html/phpmyadmin
10、 Configure site
vi /etc/httpd/conf/httpd.conf
File added at the end
Include vhost/*.conf
mkdir /etc/httpd/vhost
touch test.conf
DocumentRoot /var/www/html/test
ServerName test
Options FollowSymLinks
AllowOverride All
touch phpmyadmin.conf
DocumentRoot /var/www/html/phpmyadmin
ServerName phpmyadmin
Options FollowSymLinks
AllowOverride All
Restart apache and mariadb
11、 Install epel source
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm
If the version is not the same, go here to find http://dl.fedoraproject.org/pub/epel/
rpm -ivh rpm epel-release-7-8.noarch.rpm
yum clean all
yum update
The following steps are performed under the installation of epel source
12、 Install mcrypt extension
yum install php-mcrypt
13、 Install redis, memcache and extensions
yum install redis
vi /etc/redis.conf
daemonize yes#daemon running
redis-server /etc/redis.conf
yum install php-redis
yum install memcached
yum install php-memcached
appendix:
Start|stop|restart apache systemctl start|stop|restart httpd.service
Start apache systemctl enable httpd.service
Start|stop|restart mariadb systemctl start|stop|restart mariadb.service
Enable mariadb systemctl enable mariadb.service
Recommended Posts