xray和wordpress共存问题



让您的vps,再运行xray的同时,也兼有自己的wordpress网站。替换原来的静态站点。

mack-a脚本补充wp:

1 安装一键脚本
wget -P /root -N –no-check-certificate “https://raw.githubusercontent.com/mack-a/v2ray-agent/master/install.sh” && chmod 700 /root/install.sh && /root/install.sh

2 ubutun18.04安装php7.4
apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php

apt update
apt-get install php7.4 php7.4-fpm php7.4-cli php7.4-curl php7.4-mysql php7.4-curl php7.4-gd php7.4-mbstring php-pear php7.4-cgi php7.4-zip -y

3 配置ningx,使其支持php
vi /etc/nginx/conf.d/default.conf 【第一次修改】
location / {
root /usr/share/nginx/html;
index index.php index.html index.htm; 【增加主页对php的支持】
}

vi /etc/nginx/conf.d/alone.conf 【第二次修改】
server {
listen 127.0.0.1:31300;
server_name www.hi890.top;
root /usr/share/nginx/html;
location ~ .php$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

还需要:
vi /etc/php/7.2/fpm/php.ini
cgi.fix_pathinfo=0

vi /etc/php/7.2/fpm/pool.d/www.conf
;listen = /run/php/php7.2-fpm.sock
listen = 127.0.0.1:9000

service php7.2-fpm restart

测试部分:
vi /usr/share/nginx/html/phpinfo.php
(php
phpinfo();
?) 注意:把圆括号换成尖括号
service nginx restart

https://your website/phpinfo.php 测试成功!

source

Leave a Reply