This script automatically installs multiple versions of PHP and a chosen web server (Apache or NGINX) on Ubuntu or Debian systems. The script also installs and configures MariaDB, PHPMyAdmin, and sets up MySQL root with a random password.
- Ubuntu, Debian, Mac operating system.
- Root user access.
-
Clone the repository:
git clone https://github.com/ruban-s/server-setup.git
-
Navigate to the directory:
cd server-setup
-
Give executable permissions to the script:
chmod -R 777 setup.sh
-
Run the script as root:
sudo ./setup.sh
sudo ./setup-mac.sh
-
The script will prompt you to enter the PHP versions you want to install. Enter the versions, separated by a comma, for example:
Enter PHP versions to install (separated by comma): 7.4,8.0
-
Then the script will ask you which web server to install:
apache
ornginx
. Enter your choice:Enter the web server to install (apache or nginx): nginx
-
The script will then proceed to install the chosen PHP versions, the web server, MariaDB, and PHPMyAdmin. It will also set up MySQL root with a random password.
- Make sure to back up your configurations before running the script, as it may modify existing configurations.
- This is a basic setup and the actual configuration may depend on your specific needs and environment. Always check the official PHP and MariaDB documentation for the latest configuration information.
- This script should be run on a non-production environment first to ensure that it works as expected.
If you have any questions or run into any issues, please open an issue in this repository.