求大侠帮看看要怎么修改wordpress才能打开,原nextcloud也能用,谢谢。
大侠你好,我原本只安装了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_formatmain'$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.logmain;
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_name192.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也能用,谢谢。
页:
[1]