Skip to content

A modern web development stack combining LAMP (Linux, Apache, MariaDB, PHP) and NAMP (Nginx, Apache, MariaDB, PHP) with Redis for caching. Powered by Docker for easy deployment.

Notifications You must be signed in to change notification settings

FTMahringer/LAMP-NAMP-RED

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LAMP-NAMP-RED 🚀

A powerful and flexible development stack that combines LAMP (Linux, Apache, MariaDB, PHP) and NAMP (Nginx, Apache, MariaDB, PHP) with Redis for caching. This setup enables efficient web application hosting, load balancing, and database management.

📌 Features

  • Nginx as a reverse proxy for Apache
  • Apache with PHP-FPM for processing PHP requests
  • MariaDB as the relational database
  • phpMyAdmin for database administration
  • Redis for caching and session management
  • Docker-based environment for easy setup and deployment

🏷️ Project Structure

/lamp-namp-red
│── /app                # Application code (HTML, PHP, etc.)
│── /nginx              # Nginx configuration
│   ├── nginx.conf
│── /php/apache         # Apache with PHP
│── /php/fpm            # PHP-FPM setup
│── docker-compose.yml  # Docker Compose file
│── httpd.conf          # Apache configuration
│── index.php           # Test PHP script

⚙️ Setup & Installation

1️⃣ Prerequisites

Ensure you have the following installed:

2️⃣ Clone the Repository

git clone https://github.com/ftmahringer/lamp-namp-red.git
cd lamp-namp-red

3️⃣ Start the Services

docker-compose up -d

This will:

  • Start Nginx on port 9090
  • Start Apache on port 9091
  • Start MariaDB on port 4306
  • Start phpMyAdmin on port 9092
  • Start Redis on port 6379

4️⃣ Test the Setup


🔧 Configuration

🎥 Nginx Configuration (nginx/nginx.conf)

Nginx acts as a reverse proxy forwarding requests to Apache:

server {
    listen 80;
    location / {
        proxy_pass http://apache;
    }
}

🌍 Apache Configuration (httpd.conf)

Apache is set up with PHP-FPM support:

<FilesMatch \.php$>
    SetHandler "proxy:fcgi://php-fpm:9000"
</FilesMatch>

🔀 Changing Ports

To change the external ports used by the services, modify the docker-compose.yml file:

  nginx:
    ports:
      - "9090:80"  # Change the external port (left side) to your preferred port

For example, changing 9090:80 to 8080:80 will make the service accessible at http://localhost:8080 instead of 9090.


🛠 Managing Containers

View Running Containers

docker ps

Stop the Stack

docker-compose down

Restart the Stack

docker-compose restart

🐜 License

This project is licensed under the MIT License.


🎯 Contributions

Pull requests and improvements are welcome! Feel free to open an issue for discussions. 🚀

About

A modern web development stack combining LAMP (Linux, Apache, MariaDB, PHP) and NAMP (Nginx, Apache, MariaDB, PHP) with Redis for caching. Powered by Docker for easy deployment.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published