To download the setup script, run the following commands :
wget https://raw.githubusercontent.com/Spokelax/ApacheSetupScript/main/download.shbash download.sh
Downloading and executing download.sh script will :
- Download and unzip the contents of apache.zip from the main repo
- Execute the main script
apache_script.shthat performs the apache installation - Install Apache2
- Stop the Apache2 service to configure the installation
- Create a
testuser with the password1234(to acess apache private repository) - Move the
000-default.conffile and the contents of the/var/www/html/directory to the appropriate locations - Start the Apache2 service to make the changes effective
- Delete any leftover files, leaving only the main script for uninstallation
Also, after installation, every files such as
000-default.confandindex.htmlwill be deleted, so usingbash apache_script.sh install [password]won't work again.
Note : During installation, a private directory called
privatewill be created at the root of the Apache server. The default username and password for the directory are set totestand1234.
To uninstall Apache, you can use the apache_script script with the uninstall option.
Note : I forgot to remove the 2 arguments restriction for uninstallation, so because of lazyness i'm using an
xvariable.
bash apache_script uninstall x