Giter Site home page Giter Site logo

dnmp-mutli-php's Introduction

dnmp-mutli-php

DNMP(Docker + Nginx + MySQL + PHP7/5多版本 + Redis)是一款全功能的LNMP一键安装程序。

放在/var/www/目录下

├── build
│   ├── mongodb
│   │   └── Dockerfile
│   ├── mysql
│   │   └── Dockerfile
│   ├── nginx
│   │   └── Dockerfile
│   ├── php
│   │   ├── php56
│   │   │   ├── Dockerfile
│   │   │   └── sources.list.jessie
│   │   ├── php71
│   │   │   ├── Dockerfile
│   │   │   ├── sources.list.jessie
│   │   │   └── sources.list.stretch
│   │   └── php73
│   │       ├── Dockerfile
│   │       ├── etc
│   │       ├── sources.list.jessie
│   │       └── sources.list.stretch
│   └── redis
│       └── Dockerfile
├── conf
│   ├── mysql
│   │   ├── my.cnf
│   │   └── mysql.cnf
│   ├── nginx
│   │   ├── conf.d
│   │   │   └── default.conf
│   │   └── nginx.conf
│   ├── php56
│   │   ├── php
│   │   │   └── php.ini
│   │   └── php-fpm.d
│   │       └── www.conf
│   ├── php71
│   │   ├── php
│   │   │   └── php.ini
│   │   └── php-fpm.d
│   │       └── www.conf
│   ├── php73
│   │   ├── php
│   │   │   └── php.ini
│   │   └── php-fpm.d
│   │       └── www.conf
│   └── redis
│       └── redis.conf
├── data
│   ├── mongodb
│   ├── mysql
│   └── redis
├── docker-compose.yml
├── logs
│   ├── mysql
│   ├── nginx
│   │   ├── access.log
│   │   └── error.log
│   ├── php56
│   ├── php71
│   └── php73
├── README.md
└── site
    ├── site56
    │   └── index.php
    ├── site71
    │   └── index.php
    └── site73
        └── index.php

运行:注意加sudo

sudo docker-compose up

增加虚拟主机方法:conf/nginx/conf.d创建site71.conf文件内容:

server {
    listen       80;
    server_name  localhost;
    root   /var/www/docker/dnmp-mutli-php/site/site71;
    index  index.php index.html index.htm;
    #charset koi8-r;
    
    access_log /dev/null;
    #access_log  /var/log/nginx/nginx.localhost.access.log  main;
    error_log  /var/log/nginx/nginx.localhost.error.log  warn;
    
    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php$ {
        fastcgi_pass   php71:9000;
        fastcgi_index  index.php;
        include        fastcgi_params;
        fastcgi_param  PATH_INFO $fastcgi_path_info;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}

/etc/hosts 添加

127.0.0.1 site56.test
127.0.0.1 site71.test
127.0.0.1 site73.test

在浏览器打开

http://site56.test
http://site71.test
http://site73.test

参考文档

https://github.com/yeszao/dnmp
https://github.com/Tinywan/dnmp
https://github.com/c0priwolf/docker-lnmp-with-mutli-php-versions

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.