1.配置nginx的官方源和php第三方源
[root@web01 ~]# vim /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
[root@web01 ~]# cat /etc/yum.repos.d/php.repo
[php-webtatic]
name = PHP Repository
baseurl = http://us-east.repo.webtatic.com/yum/el7/x86_64/
gpgcheck = 0
2.安装php,nginx,nfs
yum -y install php71w php71w-cli php71w-common php71w-devel php71w-embedded php71w-gd php71w-mcrypt php71w-mbstring php71w-pdo php71w-xml php71w-fpm php71w-mysqlnd php71w-opcache php71w-pecl-memcached php71w-pecl-redis php71w-pecl-mongodb nginx mariadb-server nfs-uilts
3.配置nginx虚拟主机配置文件
vim /etc/nginx/conf.d/blog.jl.com.conf
server{
listen 80;
server_name www.jl.com;
root /blog/wecenter;
index index.php index.html;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
4.修改nginx启动用户
[root@web02 ~]# vim /etc/nginx/nginx.conf
user www;
5.修改php启动用户
[root@web01 ~]# vim /etc/php-fpm.d/www.conf
; Start a new pool named 'www'.
[www]
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
; RPM: apache Choosed to be able to access some dir as httpd
user = www
; RPM: Keep a group allowed to write in log dir.
group = www
6.创建www用户
[root@web02 ~]# groupadd www -g 666
[root@web02 ~]# useradd www -u 666 -g 666 -s /sbin/nologin -M
7.创建站点目录
mkdir /blog
8.授权站点目录
chown www:www /blog
9.测试nginx连接php
[root@web02 ~]# vim /blog/wecenter/info.php
<?php
phpinfo()
?>
10.windows域名解析
10.0.0.8 blog.jl.com
11.浏览器访问
5.安装sersync的二进制包:
wget http://test.driverzeng.com/other/sersync2.5.4_64bit_binary_stable_final.tar.gz
6.解压安装包
tar xf sersync2.5.4_64bit_binary_stable_final.tar.gz
7.修改sersync配置文件
vim GNU-Linux-x86/confxml.xml
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义