北京企业网站案例,设计公司啊 网站,wordpress教程主题,网站层次索引模板在CentOS上安装WordPress是一个相对直接的过程#xff0c;可以通过多种方法完成#xff0c;包括使用LAMP#xff08;Linux, Apache, MySQL, PHP#xff09;栈或使用更现代的LEMP#xff08;Linux, Nginx, MySQL, PHP#xff09;栈。
我选择的是#xff08;Linux, Nginx…在CentOS上安装WordPress是一个相对直接的过程可以通过多种方法完成包括使用LAMPLinux, Apache, MySQL, PHP栈或使用更现代的LEMPLinux, Nginx, MySQL, PHP栈。
我选择的是Linux, Nginx, MySQL, PHP
基础安装教程
虚拟机安装linux我这里忽略有很多虚拟机安装centos的教程。
安装Nginx的链接 https://blog.csdn.net/xiaoyaozizai1/article/details/105552639
安装 MySQL https://blog.csdn.net/xiaoyaozizai1/article/details/145666645
安装 PHP https://blog.csdn.net/xiaoyaozizai1/article/details/145648982 以上是准备工作
下载wordpress源码包
cd /www/html
wget https://cn.wordpress.org/latest-zh_CN.zip 解压如果没有unzip需要使用yum安装
unzip latest-zh_CN.zip 配置nginx
cd /data/nginx-1.24.0/conf
vi nginx.conf 配置文件如下 server { listen 88 default_server; listen [::]:88 default_server; # 这里改动了也可以写你的域名 server_name localhost; # 默认网站根目录www目录 root /www/html/wordpress; index index.php; # Load configuration files for the default server block. include /data/nginx-1.24.0/conf*.conf; location / { # 这里改动了 定义首页索引文件的名称 index index.php index.html index.htm; } error_page 404 /404.html; location /40x.html { } error_page 500 502 503 504 /50x.html; location /50x.html { } # 这里新加的 # PHP 脚本请求全部转发到 FastCGI处理. 使用FastCGI协议默认配置. # Fastcgi服务器和程序(PHP,Python)沟通的协议. location ~ \.php$ { root /www/html/wordpress; # 设置监听端口 fastcgi_pass unix:/data/php-8.0.24/php-cgi.sock; # 设置nginx的默认首页文件(上面已经设置过了可以删除) fastcgi_index index.php; # 设置脚本文件请求的路径 fastcgi_param SCRIPT_FILENAME /www/html/wordpress$fastcgi_script_name; # 引入fastcgi的配置文件 include fastcgi_params; } } 保存 nginx.conf
重新启动nginx
sudo systemctl restart nginx
浏览器输入192.168.0.111:88 验证 这个是nginx指向wordpress文件成功
在网页安装wordpress
点击现在就开始 在浏览器输入原来的地址可以看到自己的一个网站
http://192.168.0.111:88/