
**WordPress是一款常用的搭建个人博客网站软件,该软件使用PHP语言开发。
[root@hl-web lnmp-wordpress]# rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
[root@hl-web ~]# yum search nginx
[root@hl-web ~]# yum install -y pcre-devel openssl-devel #安装nginx依赖包
[root@hl-web ~]# yum install -y nginx
-
实现PHP联动
-
配置nginx的/etc/nginx/conf.d/default.conf文件,
server { listen 80; server_name 192.168.0.116; #access_log /var/log/nginx/host.access.log main; location / { root /usr/share/nginx/html/wordpress; index index.html index.htm index.php; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } location ~ \.php$ { root /usr/share/nginx/html/wordpress; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } -
或者有的是配置nginx的/etc/nginx/nginx.conf文件
http { log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 4096; include &
-

本文详细指导如何在CentOS 7.6上配置Nginx以同时挂载两个域名(localhost与www.hl01.com, www.hl02.com),实现PHP与Nginx的联动,并配置MySQL数据库,安装WordPress并完成多站配置。
最低0.47元/天 解锁文章
655

被折叠的 条评论
为什么被折叠?



