• nginx做代理部署WordPress


    实验环境:CentOS7

    服务器172.16.252.142做Nginx代理服务器:

    [root@conf.d localhost]#iptables -F
    [root@conf.d localhost]#setenforce 0
    [root@conf.d localhost]#yum -y install nginx
    [root@conf.d localhost]#cd /etc/nginx/conf.d/
    [root@conf.d localhost]#vim default.conf
    #静态资源和动态资源全部用一台服务器172.16.254.47,用不同的端口;
    server {
            listen 80;
            server_name www.mylinux.io;
    
            location ~* .(html|js|css|jpg|jpeg|png|gif)$ {
            #location  /  {
                    proxy_pass http://172.16.254.47:80;
            }
            location ~* .php$ {
                    fastcgi_pass 172.16.254.47:9000;
                    fastcgi_index index.php;
                    include fastcgi_params;
    #向后端php-fpm服务器传递脚本的方式:是在fastcgi_param文件中,将变量SCRIPT_NAME向后传递,/data/apps是php-fpm的document路径
                    fastcgi_param SCRIPT_FILENAME /var/www/html/wordpress$fastcgi_script_name;
    }
    }
    [root@conf.d localhost]#nginx -t
    [root@conf.d localhost]#nginx -s reload

    RS:172.16.254.47

    [root@html localhost]#yum -y install mariadb-server php-mysql
    [root@html localhost]#chown -R nginx:nginx wordpress/
    [root@html localhost]#vim /etc/php-fpm.d/www.conf 
    listen = 172.16.254.47:9000   #监听本地地址
    listen.allowed_clients = 172.16.252.142  #Nginx代理服务器的地址
    [root@html localhost]#mysql -p
    Enter password: 
    Welcome to the MariaDB monitor.  Commands end with ; or g.
    Your MariaDB connection id is 286
    Server version: 5.5.52-MariaDB MariaDB Server
    
    Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
    
    Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
    
    MariaDB [(none)]> GRANT ALL ON wp.*  TO wp@'172.16.254.47' IDENTIFIED BY '123456';
    MariaDB [(none)]> CREATE DATABASE wp;
    MariaDB [(none)]> FLUSH PRIVILEGES;

  • 相关阅读:
    __type_traits(traits思想)--萃取型别
    traits编程技巧
    SGI空间分配器之第二级配置器剖析
    SGI空间分配器之第一级配置器剖析
    枚举类型与联合类型
    函数指针
    c++中的placement new操作符学习
    第十六章:模板与泛型编程
    第十五章:面向对象编程
    第十五章:面向对象编程
  • 原文地址:https://www.cnblogs.com/wzhuo/p/7084545.html
Copyright © 2020-2023  润新知