当前位置:论坛首页 > Linux面板 > 求助

【待反馈】端口冲突,修改后报错;修改回去依旧报错。网

发表在 Linux面板2023-2-17 22:18 [复制链接] 9 4458

用的是腾讯云轻量服务器,预装宝塔和wordpress软件的版本。今天晚上发现wordpress的后台http://4X.XXX.XX.X1/wp-login.php 无法登录。发现反向代理的端口9000和我白天装的一个软件冲突了(难怪白天一直无法启动那个新装的软件)。为了修改反向代理的监听端口,先把php-fpm.conf.default里面的9000端口改掉。然后回到实例,运行pkill关闭php。然后重启php-fpm。后又修改nginx.conf.default里面的9000端口。返回宝塔面板就开始报错。如下图:
然后原路返回把以上修改过的参数又改回去。依旧报错。在暂停了反向代理后无法重新打开。网站前端也无法进入了。是否有办法恢复呢?
微信图片_20230217221646.png
使用道具 举报 只看该作者 回复
发表于 2023-2-17 22:24:16 | 显示全部楼层
您好,删掉面板依赖的python环境,手动修复一下试试,命令:(不要在面板里面的终端执行)
  1. mv /www/server/panel/pyenv /root
  2. curl http://download.bt.cn/install/update_panel.sh|bash
复制代码
使用道具 举报 回复 支持 反对
发表于 2023-2-17 23:37:49 | 显示全部楼层
堡塔运维盏尽 发表于 2023-2-17 22:24
您好,删掉面板依赖的python环境,手动修复一下试试,命令:(不要在面板里面的终端执行)
...

代码已执行。重新登录面板,开启反向代理报错。网站没有恢复。报错信息如图:    微信图片_20230217233418.png
使用道具 举报 回复 支持 反对
发表于 2023-2-18 00:28:17 | 显示全部楼层
您好,检查一下伪静态、配置文件、Nginx主配置文件是否存在
location / {} 这种全局设置,如有这种规则的话是不允许建立的。
使用道具 举报 回复 支持 反对
发表于 2023-2-18 07:52:32 | 显示全部楼层
堡塔运维盏尽 发表于 2023-2-18 00:28
您好,检查一下伪静态、配置文件、Nginx主配置文件是否存在
location / {} 这种全局设置,如有这种规则的话 ...

伪静态配置为空,Nginx配置如下,是否需要修改?如何改?Vhost没有找到文件目录。是否可以告知? Nginx cof.png
使用道具 举报 回复 支持 反对
发表于 2023-2-18 07:56:01 | 显示全部楼层
堡塔运维盏尽 发表于 2023-2-18 00:28
您好,检查一下伪静态、配置文件、Nginx主配置文件是否存在
location / {} 这种全局设置,如有这种规则的话 ...

伪静态配置文件为空;Nginx相关代码如下,是否需要修改?具体如何改?另外Vhost文件目录没有找到,是否可以告知文件目录地址?
Nginx cof.png
使用道具 举报 回复 支持 反对
发表于 2023-2-18 19:42:22 | 显示全部楼层
/www/server/nginx/conf/Nginx.cof

91-94【一恢复就变下载】再次删除【不打算恢复了】

        location ~ /\.
        {
            deny all;
        }

/www/server/nginx/conf/Nginx.conf.default

89-92(代码变了,找不到原来的行数了)【不打算恢复了】

  #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }

112-115(放到102-105)【恢复后报错502bad gateaway】
    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }




/usr/local/lighthouse/softwares/btpanel/server/nginx/conf/nginx.conf

删除73-78(代码变了,找不到了)

     # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}

删除53-55 (想恢复时,找不到地方了)

        location = /50x.html {
            root   html;
        }


删除43-46

       location / {
            root   html;
            index  index.html index.htm;
        }


/www/server/panel/vhost/nginx/wordpress.local.conf

13-19

    include /www/server/panel/vhost/nginx/proxy/wordpress.local/*.conf;
    #REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
    include /www/server/panel/vhost/rewrite/wordpress.local.conf;
    #REWRITE-END
    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }


删除17-19(恢复时报错)【不打算恢复了】

location / {
        try_files $uri $uri/ /index.php?$query_string;
    }


/www/server/panel/vhost/nginx/azurehealth.cn.conf

删除25-27(这三行删除后可以了)【不打算恢复了】

  location / {
      try_files $uri $uri/ /index.php?$query_string;
    }

做了以上修改,现在前台报错502
使用道具 举报 回复 支持 反对
发表于 2023-2-18 19:50:56 | 显示全部楼层
目前/www/server/nginx/conf/Nginx.conf.default  代码如下:

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #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  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;



        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;


        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}
        


   
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

  
    #}


    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;


    #}
   
   
    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }


}



/www/server/nginx/conf/nginx.conf代码如下:

user  www www;
worker_processes auto;
error_log  /www/wwwlogs/nginx_error.log  crit;
pid        /www/server/nginx/logs/nginx.pid;
worker_rlimit_nofile 51200;

stream {
    log_format tcp_format '$time_local|$remote_addr|$protocol|$status|$bytes_sent|$bytes_received|$session_time|$upstream_addr|$upstream_bytes_sent|$upstream_bytes_received|$upstream_connect_time';
  
    access_log /www/wwwlogs/tcp-access.log tcp_format;
    error_log /www/wwwlogs/tcp-error.log;
    include /www/server/panel/vhost/nginx/tcp/*.conf;
}

events
    {
        use epoll;
        worker_connections 51200;
        multi_accept on;
    }

http
    {
        include       mime.types;
                #include luawaf.conf;

                include proxy.conf;

        default_type  application/octet-stream;

        server_names_hash_bucket_size 512;
        client_header_buffer_size 32k;
        large_client_header_buffers 4 32k;
        client_max_body_size 50m;

        sendfile   on;
        tcp_nopush on;

        keepalive_timeout 60;

        tcp_nodelay on;

        fastcgi_connect_timeout 300;
        fastcgi_send_timeout 300;
        fastcgi_read_timeout 300;
        fastcgi_buffer_size 64k;
        fastcgi_buffers 4 64k;
        fastcgi_busy_buffers_size 128k;
        fastcgi_temp_file_write_size 256k;
                fastcgi_intercept_errors on;

        gzip on;
        gzip_min_length  1k;
        gzip_buffers     4 16k;
        gzip_http_version 1.1;
        gzip_comp_level 2;
        gzip_types     text/plain application/javascript application/x-javascript text/javascript text/css application/xml;
        gzip_vary on;
        gzip_proxied   expired no-cache no-store private auth;
        gzip_disable   "MSIE [1-6]\.";

        limit_conn_zone $binary_remote_addr zone=perip:10m;
                limit_conn_zone $server_name zone=perserver:10m;

        server_tokens off;
        access_log off;

server
    {
        listen 888;
        server_name phpmyadmin;
        index index.html index.htm index.php;
        root  /www/server/phpmyadmin;
            location ~ /tmp/ {
                return 403;
            }

        #error_page   404   /404.html;
        include enable-php.conf;

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }



        access_log  /www/wwwlogs/access.log;
    }
include /www/server/panel/vhost/nginx/*.conf;
}


/www/server/panel/vhost/nginx/XXX.cn.conf 代码如下:

server {
    listen 443 ssl;
      server_name wordpress.local XXX.cn www.XXX.cn;
    ssl_certificate /www/server/panel/vhost/nginx/certificates/XXX_bundle.pem;
ssl_certificate_key /www/server/panel/vhost/nginx/certificates/XXX.cn.key;

    server_tokens off;
    keepalive_timeout 10;

  
    ssl_session_timeout 5m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
    ssl_prefer_server_ciphers on;

    index index.php index.html;


    root /usr/local/lighthouse/softwares/wordpress;
    client_max_body_size 50m;
    include /www/server/panel/vhost/nginx/proxy/wordpress.local/*.conf;
    # REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
    include /www/server/panel/vhost/rewrite/wordpress.local.conf;
    # REWRITE-END
  
        

    # 禁止访问的文件或目录
    location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md) {
       return 404;
    }

    location ~ \.well-known {
       allow all;
    }

    access_log  "/www/wwwlogs//XXX.cn.log";
    error_log  "/www/wwwlogs//XXX.cn.error.log";
}


/www/server/panel/vhost/nginx/XX.conf代码如下:



使用道具 举报 回复 支持 反对
发表于 2023-2-20 19:51:47 | 显示全部楼层
有人可以回答一下么?
使用道具 举报 回复 支持 反对
发表于 2023-2-20 23:20:46 | 显示全部楼层
宝塔用户_yzpwqy 发表于 2023-2-20 19:51
有人可以回答一下么?

您好,你的网站模版应该是腾讯云那边做的,和面板上不兼容,建议您的网站删掉(不要删除网站目录/数据库/FT P),仅仅删除绑定,然后重新建站
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

企业版年付运维跟进群

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急问题处理

论坛响应时间:10分钟

问题处理方式:1对1处理(优先)

工作时间:白班:9:00 - 18:00

工作时间:晚班:18:00 - 24:00

立即付费处理
快速回复 返回顶部 返回列表