<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                > ### 安裝Docker ``` [root@localhost ~]# yum install docker [root@localhost ~]# service docker start ``` > ### 安裝Docker2(用yum安裝docker運行出現權限不足) - [docker下載1](https://download-stage.docker.com/) - [docker下載2](https://download.docker.com/) - https://download-stage.docker.com/linux/centos/7/x86_64/stable/Packages/ - ce-18.03.0.ce-1.el7.centos.x86_64.rpm 鏈接:https://pan.baidu.com/s/1QYsZZ5fGQg-Yg7PQXyf3YA 密碼:oxgo ``` docker-ce-18.03.0.ce-1.el7.centos.x86_64.rpm [root@VM_0_17_centos local]# yum localinstall -y docker-ce-18.03.0.ce-1.el7.centos.x86_64.rpm [root@VM_0_17_centos local]# service docker start [root@VM_0_17_centos local]# docker version Client: Version: 18.03.0-ce ``` > ### 拉取鏡像 - nginx鏡像 : docker pull [hub.c.163.com/winniewong/nginx:1.12.2](http://hub.c.163.com/winniewong/nginx:1.12.2) - php5.6鏡像 : docker pull [hub.c.163.com/winniewong/php5:2](http://hub.c.163.com/winniewong/php5:2) - php7鏡像 : docker pull [hub.c.163.com/winniewong/php7:1](http://hub.c.163.com/winniewong/php7:1) > ### 配置文件 - nginx.conf ``` worker_processes 1; error_log logs/error.log; pid logs/nginx.pid; events { worker_connections 65535; } #負載均勻測試 http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; upstream phpserver{ server php5:9000; server php7:9000; } limit_conn_zone $binary_remote_addr zone=perip:10m; limit_conn perip 10; server { listen 80; server_name localhost; root /usr/local/www/html; access_log logs/localhost.log; location / { autoindex on; } location ~ \.php$ { fastcgi_index index.php; fastcgi_pass phpserver; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; } } #php5項目配置 server { listen 80; server_name www.demo1.cn ; root /usr/local/www/html/demo1; access_log logs/demo1.log; location / { index index.html index.htm index.php; #autoindex on; if (!-e $request_filename) { rewrite ^(.*)$ /index.php/$1 last; break; } } location ~ \.php(.*)$ { fastcgi_pass php5:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $1; include fastcgi_params; } } #php7項目配置 server { listen 80; server_name www.demo2.cn ; root /usr/local/www/html/demo2; access_log logs/demo2.log; location / { index index.html index.htm index.php; #autoindex on; if (!-e $request_filename) { rewrite ^(.*)$ /index.php/$1 last; break; } } location ~ \.php(.*)$ { fastcgi_pass php7:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $1; include fastcgi_params; } } } ``` > ### docker配置 ``` #docker自啟 systemctl enable docker #創建網絡 docker network create lnmp #php5容器 docker run -d --name php5 --net lnmp -v /usr/local/www/html/:/usr/local/www/html/ --restart=always hub.c.163.com/winniewong/php5:2 #php7容器 docker run -d --name php7 --net lnmp -v /usr/local/www/html/:/usr/local/www/html/ --restart=always hub.c.163.com/winniewong/php7:1 #nginx容器 docker run -d -p 80:80 --name lnmp_nginx --net lnmp -v /usr/local/www/html/:/usr/local/www/html/ -v /usr/local/www/nginx/nginx.conf:/usr/local/nginx/conf/nginx.conf --restart=always hub.c.163.com/winniewong/nginx:1.12.2 ``` - --name lnmp_nginx 啟動容器的名稱 - --net lnmp 讓nginx, php5, php7 容器加入同一個網絡 - -v /usr/local/www/html/:/usr/local/www/html/ 文件映射(將linux下的/usr/local/www/html/文件映射到容器的/usr/local/www/html/下) - --restart=always 失敗重啟
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看