/Dockerized-Apache-MultiSite

Simple Apache multi site configuration

Primary LanguageDockerfile

Multi-Site Example using Docker and Apache

This is a multi-site setup using Docker, Apache, and PHP to host multiple websites on a single server.

Prerequisites

  • Docker
  • Local Host Configuration
    127.0.0.1 a1.example.com
    127.0.0.1 a2.example.com
    

Getting Started

  1. Clone Repository:

    git clone --recursive https://github.com/ViralOne/Dockerized-Apache-MultiSite.git
    

    Note: This repository uses submodules. Include the --recursive flag to clone all necessary submodules.

  2. Build Docker Container:

    docker build -t multisite-apache .
  3. Run Docker Container:

    docker run -d -p 80:80 multisite-apache

    Replace multisite-apache with the name of the Docker image.

  4. Access Sites:

    Open your browser and navigate to:

Folder Structure

  • configs/ - Contains Apache site configuration files.
  • site-1/ - Files for the first website (a1.example.com).
  • site-2/ - Files for the second website (a2.example.com).

Customization

  • To add more sites:
    1. Create a new directory similar to site-1 and site-2.
    2. Add a new Apache configuration file and place it in the configs/ directory.
    3. Update the hosts file and the Dockerfile accordingly.

Notes