Git Product home page Git Product logo

docker-lamp's Introduction

docker-LAMP

defines a docker container running Arch Linux with the LAMP stack installed This thing is re-built in the cloud every time a change is made here: https://hub.docker.com/r/greyltc/lamp

Usage

  1. Install docker
  2. Download and start the LAMP server instance
    docker run --name lamp -p 443:443 -d greyltc/lamp
  3. Test the LAMP server
    Point your browser to:
    https://localhost/
    if you've not used your own ssl certificate, as described below, you'll likely see browser warnings here about NET::ERR_CERT_AUTHORITY_INVALID click though those and you should see the default apache index. Follow the info.php link there and you should see detials of the php installation.
  4. [Optional] Change your webserver root data storage location
    It's likely desirable for your www root dir to be placed in a persistant storage location outside the docker container, on the host's file system for example. Let's imagine you wish to store your www files in a folder ~/www on the host's file system. Then insert the following into the docker startup command (from step 2. above) between run and --name:
    -v ~/www:/srv/http
    UID 33 or GID 33 (http in the container image) must have at least read permissions for ~/www on the host system. Generally, it's enough to do:
    chmod -R 770 ~/www; sudo chgrp -R 33 ~/www
    Read this if you run into permissions issues in the container.
  5. [Optional] Use your own ssl certificate
    This image comes with a self-generated ssl certificate and so you'll get browser warnings when you access your server via https (but the connection will be encrypted with a private key that anyone can view by snooping around in the docker image). You can (& should) replace these self signed certificates with your own, properly generated cert files. Assuming you have server.crt and server.key files in a directory ~/sslCert on the host machine:
    sudo chown -R root ~/sslCert; sudo chgrp -R root ~/sslCert
    sudo chmod 400 ~/sslCert/server.key
    You can then add -v ~/sslCert:/root/sslKeys to the docker run command line to use your ssl certificate files.
  6. [Optional] Use the built in certbot client to fetch proper ssl certificate files from Let's Encrypt Follow the instructions here: https://github.com/greyltc/docker-LAMP/wiki/Using-the-built-in-certbot-client-to-fetch-proper-ssl-certificate-files-from-Let's-Encrypt
  7. [Optional] Stop the lamp docker server instance
    docker stop lamp
  8. [Optional] Delete the lamp docker server instance (after stopping it)
    docker rm lamp
  9. Profit.

docker-lamp's People

Contributors

dknell avatar fuerst avatar greyltc avatar l3iggs avatar

Watchers

 avatar

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.