首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >有没有一种有效的方法来安装wordpress在bitnami nginx?

有没有一种有效的方法来安装wordpress在bitnami nginx?
EN

Stack Overflow用户
提问于 2021-01-25 07:18:50
回答 1查看 225关注 0票数 0

我试着按照这个链接中有关在bitnami中安装wordpress的说明:https://docs.bitnami.com/aws/how-to/install-wordpress-nginx/#step-1-prepare-your-nginx-server,但是它似乎不能工作,因为它没有显示wordpress安装页面。

顺便说一下,我正在Windows中运行bitnami。

下面是我所做的(注意:我没有使用控制台,因为我使用的是Windows):

方法A:使用系统包安装Bitnami

  1. 下载最新版本的WordPress并将文件解压缩到/opt/bitnami/wordpress/目录:

代码语言:javascript
复制
 cd /tmp
   wget https://wordpress.org/latest.tar.gz
   sudo tar xfvz latest.tar.gz -C /opt/bitnami/ 
代码语言:javascript
复制
    For Windows 
        it's C:/Bitnami/nginxstack-1.18.0-9/

  1. 运行以下命令来分配必要的目录权限:

代码语言:javascript
复制
sudo chown -R bitnami:daemon /opt/bitnami/wordpress
sudo chmod -R g+w /opt/bitnami/wordpress
代码语言:javascript
复制
For Windows 
    it's C:/Bitnami/nginxstack-1.18.0-9/wordpress
       added the wordpress files here

创建和编辑/opt/bitnami/nginx/conf/server_blocks/wordpress-server-block.conf文件并添加配置块的

  1. ,如下所示:

代码语言:javascript
复制
server {
        listen 80 default_server;
        root /opt/bitnami/wordpress;
        # Catch-all server block
        # See: https://nginx.org/en/docs/http/server_names.html#miscellaneous_names
        server_name _;

        index index.php;

        location / {
            try_files $uri $uri/ /index.php?q=$uri&$args;
        }

        if (!-e $request_filename)
        {
            rewrite ^/(.+)$ /index.php?q=$1 last;
        }

        include "/opt/bitnami/nginx/conf/bitnami/*.conf";
    }
代码语言:javascript
复制
For Windows
create and edit the C:/Bitnami/nginxstack-1.18.0-9/nginx/conf/server_blocks/wordpress-server-block.conf and add the configuration block shown below:

server {
    listen 80 default_server;
    root "C:/Bitnami/nginxstack-1.18.0-9/wordpress";
    # Catch-all server block
    # See: https://nginx.org/en/docs/http/server_names.html#miscellaneous_names
    server_name _;

    index index.php;

    location / {
        try_files $uri $uri/ /index.php?q=$uri&$args;
    }

    if (!-e $request_filename)
    {
        rewrite ^/(.+)$ /index.php?q=$1 last;
    }

    include "C:/Bitnami/nginxstack-1.18.0-9/nginx/conf/bitnami/*.conf";
}

创建和编辑/opt/bitnami/nginx/conf/server_blocks/wordpress-https-server-block.conf文件并添加配置块的

  1. ,如下所示:

代码语言:javascript
复制
server {
    # Port to listen on, can also be set in IP:PORT format
    listen 443 ssl default_server;
    root /opt/bitnami/wordpress;
    # Catch-all server block
    # See: https://nginx.org/en/docs/http/server_names.html#miscellaneous_names
    server_name _;
    ssl_certificate      bitnami/certs/server.crt;
    ssl_certificate_key  bitnami/certs/server.key;
        
    location / {
        try_files $uri $uri/ /index.php?q=$uri&$args;
    }
        
    if (!-e $request_filename)
    {
        rewrite ^/(.+)$ /index.php?q=$1 last;
    }
        
    include "/opt/bitnami/nginx/conf/bitnami/*.conf";
}
代码语言:javascript
复制
For Windows
        create and edit C:/Bitnami/nginxstack-1.18.0-9/nginx/conf/server_blocks/wordpress-https-server-block.conf and add the configuration block shown below:

server {
   # Port to listen on, can also be set in IP:PORT format
   listen 443 ssl default_server;
   root "C:/Bitnami/nginxstack-1.18.0-9/wordpress";
   # Catch-all server block
   # See: https://nginx.org/en/docs/http/server_names.html#miscellaneous_names
   server_name _;
   ssl_certificate      bitnami/certs/server.crt;
   ssl_certificate_key  bitnami/certs/server.key;

   location / {
      try_files $uri $uri/ /index.php?q=$uri&$args;
   }
  
   if (!-e $request_filename)
   {
      rewrite ^/(.+)$ /index.php?q=$1 last;
   }
   
   include "C:/Bitnami/nginxstack-1.18.0-9/nginx/conf/bitnami/*.conf";
}

  1. 重新启动NGINX:

代码语言:javascript
复制
sudo /opt/bitnami/ctlscript.sh restart nginx
代码语言:javascript
复制
For Windows just turn on the nginx from the bitnami control panel
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-01-25 10:47:34

这里的Bitnami开发者

您正在使用的指南中的方法A对Windows安装程序无效。你应该用B方法代替。要重新启动服务,请使用manager-windows.exe工具。

https://docs.bitnami.com/installer/infrastructure/wamp/administration/control-services-windows/

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65880428

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档