Hey when we are work in new project then its annoying to create new virtual hosts checking all those boring things if not work then fixing bug on hosts file etc.... So There is a script to create your virtual host automatically. Just run script and BooooooooooooM! Host created within a second.
- Create New Virtualhost
- Delete an Existing Host
- View all List of Existing Host
- Compatible with nginx and apache
- Clone or download this repo
git clone https://github.com/nayeemdev/auto-virtualhost
cd auto-virtualhost
- Give permission for executing(Different For nginx and apache):
### For Apache
sudo chmod +x apache-virtualhost.sh
### For nginx
sudo chmod +x nginx-virtualhost.sh
### For Apache
sudo ./apache-virtualhost.sh [create/delete/list] [domain_name] [your_project_full_directory_path]
### For nginx
sudo ./nginx-virtualhost.sh [create/delete/list] [domain_name] [your_project_full_directory_path]
### For Apache
sudo ./apache-virtualhost.sh create nayeem.test /var/www/html/nayeem
### For nginx
sudo ./nginx-virtualhost.sh create nayeem.test /var/www/html/nayeem
You can run this script globally if you want just follow up these steps
Give permission for executing:
### For Apache
sudo chmod +x apache-virtualhost.sh
### For nginx
sudo chmod +x nginx-virtualhost.sh
Run this Command for copy sh file to local bin directory
### For Apache
sudo cp apache-virtualhost.sh /usr/local/bin
### For nginx
sudo cp nginx-virtualhost.sh /usr/local/bin
For create virtual host
### For Apache
sudo apache-virtualhost [create/delete] [domain_name}[your_project_full_directory_path]
### For nginx
sudo apache-virtualhost [create/delete] [domain_name}[your_project_full_directory_path]
### For Apache
sudo apache-virtualhost create nayeem.test /var/www/html/nayeem
### For nginx
sudo nginx-virtualhost create nayeem.test /var/www/html/nayeem
Fork this repo add/change what you want and send a pull request. ##Happy Coding##