LAMP环境搭建
Apache至少需要apr、apr-util、pcre组件的支持。
[root@localhost ~]#: yum install -y apr apr-devel apr-util apr-util-devel gcc gcc-c++ pcre-devel zlib-devel openssl openssl-devel
PS:或者使用源码安装的方式安装上述相关模块组件
[root@localhost src]# wget https://mirror.bit.edu.cn/apache//httpd/httpd-2.4.41.tar.gz
[root@localhost src]# cd httpd-2.4.41
[root@localhost httpd-2.4.41]# ./configure --prefix=/usr/local/httpd
[root@localhost httpd-2.4.41]# make && make install
[root@localhost httpd-2.4.41]# firewall-cmd --permanent --zone=public --add-service=http
success
[root@localhost httpd-2.4.41]# firewall-cmd --permanent --zone=public --add-service=https
success
[root@localhost ~]# /usr/local/httpd/bin/apachectl start
[root@localhost ~]# netstat -ntl|grep 80
tcp6 0 0 :::80 :::* LISTEN
[root@localhost ~]# curl 192.168.182.10:80
<html><body><h1>It works!</h1></body></html>
[root@localhost ~]# sudo ln -s /usr/local/httpd/bin/apachectl /usr/bin/httpd
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# systemctl stop httpd
[root@localhost ~]# systemctl restart httpd
[root@localhost ~]# yum -y install mariadb-server mariadb
[root@localhost ~]# systemctl start mariadb.service
[root@localhost ~]# systemctl enable mariadb.service
[root@localhost ~]# mysql_secure_installation
MariaDB [(none)]> create user wordpress@localhost identified by '123456';
MariaDB [(none)]> grant all privileges on wordpresss.* to wordpress@localhost;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> exit
Bye
[root@localhost src]# yum -y install php-mysql php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel
[root@localhost src]# wget https://www.php.net/distributions/php-7.4.3.tar.gz
[root@localhost src]# tar -xzvf php-7.4.3.tar.gz
[root@localhost src]# cd php-7.4.3
[root@localhost php-7.4.3]# ./configure --prefix=/usr/local/php
[root@localhost ~]# vim /var/www/html/info.php
<?php
phpinfo();
?>
[root@localhost ~]# sudo /usr/local/httpd/bin/apachectl start
WordPress环境搭建
[root@localhost ~]# tar -xzvf wordpress-5.3.2.tar.gz
[root@localhost ~]# cp -rf wordpress/* /var/www/html/
[root@localhost ~]# cd /var/www/html
[root@localhost html]# cp wp-config-sample.php wp-config.php
[root@localhost html]# vim wp-config.php
[root@localhost ~]# systemctl restart httpd
[root@localhost ~]# systemctl restart mariadb