The Wayback Machine - https://web.archive.org/web/20201113195625/https://github.com/StevenBlack/virtualhost
Skip to content
master
Go to file
Code
This branch is 8 commits ahead, 16 commits behind RoverWire:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

README.md

Virtualhost Manage Script

Bash Script to allow create or delete apache virtual hosts on Ubuntu on a quick way.

Take note!: this repo is a fork of RoverWire/virtualhost but that serves a different use case, so this repo diverges from that rather significantly. Most notably,

  • Dropped assumption of PHP.
  • Dropped support for nginx.

Installation

  1. Download the script
  2. Apply permission to execute:
$ chmod +x /path/to/virtualhost.sh
  1. 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

For Global Shortcut

$ cd /usr/local/bin
$ wget -O virtualhost https://raw.githubusercontent.com/StevenBlack/virtualhost/master/virtualhost.sh
$ chmod +x virtualhost

Usage

Basic command line syntax:

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

With script installed on /usr/local/bin

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

Examples

to create a new virtual host:

$ sudo virtualhost create mysite.dev

to create a new virtual host with custom directory name:

$ sudo virtualhost create anothersite.dev my_dir

to delete a virtual host

$ sudo virtualhost delete mysite.dev

to delete a virtual host with custom directory name:

$ sudo virtualhost delete anothersite.dev my_dir

Localization

$ sudo cp /path/to/locale/<language>/virtualhost.mo /usr/share/locale/<language>/LC_MESSAGES/

About

Bash script to automate creating or deleting apache virtual hosts on ubuntu

Topics

Resources

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.