• 使用docker部署php-fpm环境


    1、pull php-fpm环境

    docker pull richarvey/nginx-php-fpm:latest

    2、run php-fpm镜像

    docker run -idt --name php-fpm -p 9000:80  -v /opt/hk.railfi.com:/var/www/html  richarvey/nginx-php-fpm

    [root@localhost conf.d]# docker ps
    CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
    cb26d42cdce7 richarvey/nginx-php-fpm "docker-php-entryp..." 2 hours ago Up 2 hours 443/tcp, 9000/tcp, 0.0.0.0:8888->80/tcp php-fpm

    3、部署nginx服务器

    server
      {
        listen       80;
    
        server_name localhost;
    
        ## send request back to docker ##
        location / {
            proxy_pass  http://127.0.0.1:9000;
    
            #Proxy Settings
            proxy_redirect     off;
            proxy_set_header   Host             $host;
            proxy_set_header   X-Real-IP        $remote_addr;
            proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
            proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
            proxy_max_temp_file_size 0;
            proxy_connect_timeout      90;
            proxy_send_timeout         90;
            proxy_read_timeout         90;
            proxy_buffer_size          4k;
            proxy_buffers              4 32k;
            proxy_busy_buffers_size    64k;
            proxy_temp_file_write_size 64k;
       }
    
        ##access_log  /data/logs/access_retmobao.789et.com_$year-$month-$day.log ;
       access_log off;
      }

    4、测试php环境

    <?php
     echo "this is php";
    ?>

  • 相关阅读:
    UVa532 Dungeon Master 三维迷宫
    6.4.2 走迷宫
    UVA 439 Knight Moves
    UVa784 Maze Exploration
    UVa657 The die is cast
    UVa572 Oil Deposits DFS求连通块
    UVa10562 Undraw the Trees
    UVa839 Not so Mobile
    327
    UVa699 The Falling Leaves
  • 原文地址:https://www.cnblogs.com/zhangzihong/p/7027495.html
Copyright © 2020-2023  润新知