Skip to content

Bash scripts to quickly add and remove domains using apache2 on Debian.

License

Notifications You must be signed in to change notification settings

LiamPerson/Apache2Domains

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Apache2Domains

Bash scripts to quickly add and remove domains in an apache2 environment on Debian.

Creates website directory in /var/www writes config, enables site, and optionally adds index.html file.

You can edit the port the website will use by editing the PORT=YOUR_PORT variable in the newdomain.sh script.

Screenshot of the bash script.

Installation & Usage

  1. Put files onto target machine. e.g: wget https://raw.githubusercontent.com/YeloPartyHat/Apache2Domains/main/newdomain.sh && wget https://raw.githubusercontent.com/YeloPartyHat/Apache2Domains/main/removedomain.sh
  2. Navigate to the location you put the files using cd
  3. Run files using sudo bash file.sh e.g: sudo bash newdomain.sh
  4. Follow in-console prompts

Requirements

These scripts rely on apache2 to work and must be executed using the super user (sudo).

sudo apt install apache2

Notes

  • You may notice you can't immediately run the file when you place it. This is because you don't have the adequate permissions. To fix this, use: chmod +x file.sh

Use with caution!
I am not responsible if you accidentally register the wrong domain or remove something important!