设为首页
收藏本站
切换到宽版
用户名
Email
自动登录
找回密码
密码
登录
注册
快捷导航
论坛
BBS
排行榜
Ranklist
搜索
搜索
热搜:
香港vps
香港VPS
amh
机柜
vps
分销
VPS
域名出售
火车头
云主机
不限流量
香港服务器
美国服务器
香港
全能空间
whmcs
digitalocean
本版
帖子
用户
MJJ论坛
»
论坛
›
主机综合交流
›
美国VPS综合讨论
›
LNMP wordpress for yum
返回列表
查看:
1219
|
回复:
6
[已解决]
LNMP wordpress for yum
[复制链接]
ccnif
ccnif
当前离线
积分
15656
发表于 2021-10-8 14:53:44
|
显示全部楼层
|
阅读模式
本帖最后由 ccnif 于 2021-10-8 15:06 编辑
看到论坛有同学要 学搭建wordpress写个文章
# 查看wordpress官方环境要求
https://cn.wordpress.org/support/article/requirements/
系统:centos7x
NGINX:主线版本
MySQL:5.6
PHP:7.3
# 第三方源 安装
yum install -y https://mirrors.tuna.tsinghua.edu.cn/remi/enterprise/remi-release-7.rpm
yum install -y epel-release
复制代码
# 关闭selinux
setenforce 0
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
复制代码
# MySQL 安装
yum install -y https://mirrors.tuna.tsinghua.edu.cn/percona/yum/percona-release-latest.noarch.rpm
sed -i 's/repo.percona.com/mirrors.tuna.tsinghua.edu.cn/g' /etc/yum.repos.d/percona-original-release.repo
yum install -y Percona-Server-server-57
systemctl enable --now mysqld
复制代码
# MySQL 设置 root 密码
mysqladmin -uroot -p`cat /var/log/mysqld.log | grep 'temporary password' | awk '{print $NF}'` password "root密码"
复制代码
# MySQL 新建 用户 数据库 设置权限
mysql -uroot -p"P@ssw0rd" -e "CREATE DATABASE IF NOT EXISTS wordpress DEFAULT CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI;"
mysql -uroot -p"P@ssw0rd" -e "GRANT ALL PRIVILEGES ON wordpress.* TO wordpress@'%' IDENTIFIED BY 'P@ssw0rd';"
mysql -uroot -p"P@ssw0rd" -e "FLUSH PRIVILEGES;"
复制代码
# PHP 安装
yum install -y php74-php-fpm php74-php-mysqlnd
systemctl enable --now php74-php-fpm
复制代码
# PHP-FPM 运行用户设置
sed -i 's/user = apache/user = nginx/g' /etc/opt/remi/php74/php-fpm.d/www.conf
sed -i 's/group = apache/group = nginx/g' /etc/opt/remi/php74/php-fpm.d/www.conf
systemctl restart php74-php-fpm
复制代码
# NGINX 安装
yum -y install nginx
systemctl enable --now nginx
复制代码
# NGINX 配置
https://www.nginx.com/resources/wiki/start/topics/recipes/wordpress/
vi /etc/nginx/conf.d/wordpress.conf
upstream php {
server 127.0.0.1:9000;
}
server {
server_name 域名;
root /data0/wordpress;
index index.php;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_pass php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
}
nginx -t
systemctl reload nginx
复制代码
# 防火墙开启80端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
systemctl start firewalld.service
复制代码
# Wordpress源代码安装
mkdir -p /data0/wordpress
cd /data0/wordpress
wget https://cn.wordpress.org/latest-zh_CN.tar.gz
tar -xf latest-zh_CN.tar.gz
mv wordpress/* ./
rm -rf wordpress latest-zh_CN.tar.gz
cd /data0
chmod 755 wordpress/ -R
chown nginx:nginx wordpress/ -R
复制代码
回复
举报
zuoridangnian
zuoridangnian
当前离线
积分
6135
发表于 2021-10-8 14:58:29
|
显示全部楼层
好麻烦的样子
回复
支持
反对
举报
cdseoo
cdseoo
当前离线
积分
20168
发表于 2021-10-8 14:59:30
|
显示全部楼层
docker-compose up -d
回复
支持
反对
举报
citywar
citywar
当前离线
积分
20405
发表于 2021-10-8 15:00:34
|
显示全部楼层
小白福音 宝塔面板
回复
支持
反对
举报
钱宗鑫
钱宗鑫
当前离线
积分
8166
发表于 2021-10-8 15:08:35
|
显示全部楼层
litespeed更好用,搭建也快速
可以去googl一下相关的一键脚本
回复
支持
反对
举报
宝丽金
宝丽金
当前离线
积分
41026
发表于 2021-10-8 15:10:56
|
显示全部楼层
提示:
作者被禁止或删除 内容自动屏蔽
回复
支持
反对
举报
ixbear
ixbear
当前离线
积分
14543
发表于 2021-10-8 15:38:22
|
显示全部楼层
有没有大神提供一下docker-compose.yml文件的
回复
支持
反对
举报
返回列表
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
|
注册
本版积分规则
发表回复
回帖后跳转到最后一页
Archiver
|
手机版
|
小黑屋
|
MJJ论坛
Copyright
MJJ论坛
© 2022 All Rights Reserved.
快速回复
返回顶部
返回列表