A simple shell script set for Ubuntu/Debian to install and uninstall Apache2 + PHP with common modules. Includes configuration tweaks to allow serving all file types and a test PHP file for verification.
- One‑command installation of Apache2 + PHP
- Auto‑configuration of Apache to allow all files
- Deployment of a PHP test page (
info.php) - Easy uninstallation script to clean up packages and configs
Clone the repository and run the installer:
apt update -y
apt install git -y
git clone https://github.com/sohag1192/Apache2-PHP.git
cd Apache2-PHP
chmod +x install.sh uninstall.sh
./install.shAfter installation, open in your browser:
http://your_server_ip/info.php
You should see the PHP info page confirming Apache + PHP integration.
To remove Apache2 and PHP completely:
./uninstall.shThis stops services, purges packages, and deletes configuration files.
- Save each script as
install.shanduninstall.sh. - Make them executable:
chmod +x install.sh uninstall.sh
- Run with:
./install.sh ./uninstall.sh
Md. Sohag Rana
GitHub: Sohag1192
📱 Telegram: @sohag1192
🌍 Location: Bangladesh