[root@web01 ~]# systemctl start nginx[root@web01 ~]# systemctl enable nginx
Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.
[root@web01 ~]# vim /etc/php-fpm.d/www.conf
user = www
group = www
5)启动php
[root@web01 ~]# systemctl start php-fpm[root@web01 ~]# systemctl enable php-fpm
Created symlink from /etc/systemd/system/multi-user.target.wants/php-fpm.service to /usr/lib/systemd/system/php-fpm.service.
[root@web01 ~]# systemctl start mariadb[root@web01 ~]# systemctl enable mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
3)验证
[root@web01 ~]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.64-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h'for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema || mysql || performance_schema ||test|
+--------------------+
4 rows inset(0.00 sec)
MariaDB [(none)]>
[root@web01 code]# tar xf wordpress-5.0.3-zh_CN.tar.gz
3)授权目录
[root@web01 code]# chown -R www.www /code/
4)配置nginx
[root@web01 conf.d]# vim wordpress.conf
server {
listen 80;
server_name blog.linux.com;
location / {
root /code/wordpress;
index index.php;}
location ~* \.php$ {
root /code/wordpress;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;}}[root@web01 conf.d]# systemctl restart nginx
5)创建数据库
[root@web01 conf.d]# mysql -uroot -pLin123.com
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 5.5.64-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h'for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> create database wordpress;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema || mysql || performance_schema ||test|| wordpress |
+--------------------+
5 rows inset(0.01 sec)
MariaDB [(none)]>
[root@web01 conf.d]# vim zh.conf
server {
listen 80;
server_name zh.linux.com;
location / {
root /code/wecenter;
index index.php;}
location ~* \.php$ {
root /code/wecenter;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;}}[root@web01 conf.d]# systemctl restart nginx
3)创建数据库
[root@web01 conf.d]# mysql -uroot -pLin123.com
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 144
Server version: 5.5.64-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h'for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> create database zh;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema || mysql || performance_schema ||test|| wordpress || zh |
+--------------------+
6 rows inset(0.01 sec)
MariaDB [(none)]>
7.搭建edusoho
1)上传代码包
[root@web01 code]# rz edusoho-8.3.36.tar.gz
2)解压代码包
[root@web01 code]# tar xf edusoho-8.3.36.tar.gz[root@web01 code]# chown -R www.www edusoho