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.
- 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
/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
Ensure you have the following installed:
git clone https://github.com/ftmahringer/lamp-namp-red.git
cd lamp-namp-red
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
- Open http://localhost:9090 → Nginx (Reverse Proxy to Apache)
- Open http://localhost:9091 → Apache (Direct Access)
- Open http://localhost:9092 → phpMyAdmin (Login:
user / password
)
Nginx acts as a reverse proxy forwarding requests to Apache:
server {
listen 80;
location / {
proxy_pass http://apache;
}
}
Apache is set up with PHP-FPM support:
<FilesMatch \.php$>
SetHandler "proxy:fcgi://php-fpm:9000"
</FilesMatch>
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
.
docker ps
docker-compose down
docker-compose restart
This project is licensed under the MIT License.
Pull requests and improvements are welcome! Feel free to open an issue for discussions. 🚀