VPS侦探论坛

 找回密码
 注册
查看: 4401|回复: 0

[Apache] 求大侠帮看看要怎么修改wordpress才能打开,原nextcloud也能用,谢谢。

[复制链接]
发表于 2019-3-9 17:46:11 | 显示全部楼层 |阅读模式

大侠你好,我原本只安装了nextcloud,https访问nextcloud正常的,现在下载解压了wordpress,建了wordpress数据库用户密码,
wordpress的主目录放在/usr/share/nginx/html/wordpress/,做了以下步骤:
cp /usr/share/nginx/html/wordpress/wp-config-sample.php  /usr/share/nginx/html/wordpress/wp-config.php
chown -R www:www /usr/share/nginx/html/wordpress/
vi /usr/share/nginx/html/wordpress/wp-config.php修改了访问的数据库账号密码。
将/etc/nginx/nginx.conf编辑成以下内容。
======================
vim /etc/nginx/nginx.conf的内容:
include /usr/share/nginx/modules/*.conf;
events {
    worker_connections 1024;
}
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 2048;
    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;
    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    #include /etc/nginx/conf.d/*.conf;
    server {
        listen       8083 default_server;
        listen       [::]:8083 default_server;
        server_name  192.168.1.167;
        # root /usr/share/nginx/html;
        root  /usr/share/nginx/html/wordpress;
        index index.html index.htm index.php;
        # Load configuration files for the default server block.
        # include /etc/nginx/default.d/*.conf;
        location / {
          if (!-e $request_filename) {
            rewrite (.*) /index.php;
             }
        }
        location ~ \.php$ {
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        }
        error_page 404 /404.html;
            location = /40x.html {
        }
        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }
================
之后访问http://http://192.168.1.167可见到Welcome to nginx on Fedora!页面。
但访问http://http://192.168.1.167:8083  弹出“404 Not Found”
===============================
nextcloud的主目录在/usr/share/nginx/html/nextcloud
配置文件 /etc/nginx/conf.d/nextcloud.conf
===============================
vim /etc/nginx/conf.d/nextcloud.conf 的内容是:
upstream php-handler {
    server 127.0.0.1:9000;
    #server unix:/var/run/php/php7.0-fpm.sock;
}
server {
    listen 80;
    listen [::]:80;
    server_name keene.f3322.net;
    # enforce https
    return 301 https://$server_name$request_uri;
}
server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name keene.f3322.net;
    ssl_certificate /etc/nginx/cert/nextcloud.crt;
    ssl_certificate_key /etc/nginx/cert/nextcloud.key;
................
.......
}
=============================
求大侠帮看看要怎么修改wordpress才能打开,原nextcloud也能用,谢谢。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-5-18 16:26 , Processed in 0.025885 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表