Skip to content

Bash Script to create or delete apache virtual hosts in Ubuntu quickly.

Notifications You must be signed in to change notification settings

praveendabral/virtualhost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Virtualhost Manage Script

Bash Script to create or delete apache virtual hosts in Ubuntu quickly.

Installation

  1. Download the script
  2. Optional: if you want to use the script globally, then you need to copy the file to your /usr/local/bin directory, is better if you copy it without the .sh extension:
$ sudo cp /path/to/virtualhost.sh /usr/local/bin/virtualhost
  1. Apply permission to execute:
chmod +x /path/to/virtualhost

Usage

With script installed on /usr/local/bin

$ sudo virtualhost [create | delete] [domain] [optional root_dir]

Basic command line syntax:

$ sudo sh /path/to/virtualhost.sh [create | delete] [domain] [optional root_dir]

Examples

to create a new virtual host:

$ sudo virtualhost create mysite.local

to create a new virtual host with custom directory name:

$ sudo virtualhost create anothersite.local root_dir

to delete a virtual host

$ sudo virtualhost delete mysite.local

to delete a virtual host with custom directory name:

$ sudo virtualhost delete anothersite.local root_dir

About

Bash Script to create or delete apache virtual hosts in Ubuntu quickly.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages