Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ftmahringer/lamp-namp-red

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.
https://github.com/ftmahringer/lamp-namp-red

apache docker mariadb nginx php redis

Last synced: 1 day ago
JSON representation

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.

Awesome Lists containing this project

README

        

# 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:
- [Docker](https://www.docker.com/)
- [Docker Compose](https://docs.docker.com/compose/)

### 2️⃣ Clone the Repository
```sh
git clone https://github.com/ftmahringer/lamp-namp-red.git
cd lamp-namp-red
```

### 3️⃣ Start the Services
```sh
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
- Open **http://localhost:9090** → Nginx (Reverse Proxy to Apache)
- Open **http://localhost:9091** → Apache (Direct Access)
- Open **http://localhost:9092** → phpMyAdmin (Login: `user / password`)

---

## 🔧 **Configuration**
### 🎥 **Nginx Configuration (`nginx/nginx.conf`)**
Nginx acts as a reverse proxy forwarding requests to Apache:
```nginx
server {
listen 80;
location / {
proxy_pass http://apache;
}
}
```

### 🌍 **Apache Configuration (`httpd.conf`)**
Apache is set up with PHP-FPM support:
```apache

SetHandler "proxy:fcgi://php-fpm:9000"

```

### 🔀 **Changing Ports**
To change the external ports used by the services, modify the `docker-compose.yml` file:
```yaml
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
```sh
docker ps
```

### Stop the Stack
```sh
docker-compose down
```

### Restart the Stack
```sh
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. 🚀