Apache 2 HTTP Server site creation and removing tools using command line.
Name | Version |
---|---|
Ubuntu | >= 16.04 |
Apache | >= 2 |
From PPA:
sudo add-apt-repository ppa:tarkhov/ppa
sudo apt update
sudo apt install a2site
sudo a2mksite mydomain mysite.conf ~/myfolder 127.0.0.1
This command will create:
- Virtual host
/etc/apache2/sites-available/mysite.conf
with url http://mydomain. - Folder
~/myfolder
. - Record in
/etc/hosts
- mydomain 127.0.0.1.
sudo a2mksite mydomain
This command will create:
- Virtual host
/etc/apache2/sites-available/mydomain.conf
with url http://mydomain. - Folder in current directory with name mydomain.
- Record in
/etc/hosts
- mydomain 127.0.0.1. - Restart web server.
sudo a2rmsite mydomain mysite.conf ~/myfolder 127.0.0.1
sudo a2rmsite mydomain
Alias | Command |
---|---|
a2d |
a2disable |
a2dc |
a2disconf |
a2dm |
a2dismod |
a2ds |
a2dissite |
a2e |
a2enable |
a2ec |
a2enconf |
a2em |
a2enmod |
a2es |
a2ensite |
a2l |
a2list |
a2mk |
a2mksite |
a2rl |
a2reload |
a2rm |
a2rmsite |
a2rs |
a2restart |
a2s |
a2start |
a2sp |
a2stop |
a2st |
a2status |
To completely remove the package run the command:
sudo apt remove --purge a2site
Alexander Tarkhov
This project is licensed under the MIT License - see the LICENSE
file for details.