Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
346 views
in Technique[技术] by (71.8m points)

Is there an effective way to install wordpress in bitnami nginx?

I tried to follow the instructions regarding installing wordpress in bitnami nginx from this link: https://docs.bitnami.com/aws/how-to/install-wordpress-nginx/#step-1-prepare-your-nginx-server but it seem not to work because it doesn't display the wordpress installation page.

By the way, I am running bitnami nginx in Windows.

Here's what I did (Note: I didn't use console because I am using Windows):

Approach A: Bitnami Installations Using System Packages

  1. Download the latest version of WordPress and extract the files to the /opt/bitnami/wordpress/ directory:
 cd /tmp
   wget https://wordpress.org/latest.tar.gz
   sudo tar xfvz latest.tar.gz -C /opt/bitnami/ 
    For Windows 
        it's C:/Bitnami/nginxstack-1.18.0-9/
  1. Run the following commands to assign the necessary directory permissions:
sudo chown -R bitnami:daemon /opt/bitnami/wordpress
sudo chmod -R g+w /opt/bitnami/wordpress
For Windows 
    it's C:/Bitnami/nginxstack-1.18.0-9/wordpress
       added the wordpress files here
  1. Create and edit the /opt/bitnami/nginx/conf/server_blocks/wordpress-server-block.conf file and add the configuration block shown below:
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";
    }
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";
}
  1. Create and edit the /opt/bitnami/nginx/conf/server_blocks/wordpress-https-server-block.conf file 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 /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";
}
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. Restart NGINX:
sudo /opt/bitnami/ctlscript.sh restart nginx
For Windows just turn on the nginx from the bitnami control panel
question from:https://stackoverflow.com/questions/65880428/is-there-an-effective-way-to-install-wordpress-in-bitnami-nginx

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Bitnami developer here,

The approach A in the guide you are using is not valid for Windows installers. You should use approach B instead. For restarting the services, please use the manager-windows.exe tool.

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...