Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ascii-16/virtualhost
Bash Script to easy create or delete apache virtual hosts on ubuntu
https://github.com/ascii-16/virtualhost
Last synced: 3 months ago
JSON representation
Bash Script to easy create or delete apache virtual hosts on ubuntu
- Host: GitHub
- URL: https://github.com/ascii-16/virtualhost
- Owner: ascii-16
- Fork: true (RoverWire/virtualhost)
- Created: 2019-11-18T08:54:34.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-23T19:09:49.000Z (about 5 years ago)
- Last Synced: 2023-09-05T12:34:54.558Z (over 1 year ago)
- Size: 41 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Virtualhost Manage Script
===========Bash Script to allow create or delete apache/nginx virtual hosts on Ubuntu on a quick way.
## Installation ##
1. Download the script
2. Apply permission to execute:```
$ chmod +x /path/to/virtualhost.sh
```3. 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:```bash
$ sudo cp /path/to/virtualhost.sh /usr/local/bin/virtualhost
```### For Global Shortcut ###
```bash
$ cd /usr/local/bin
$ wget -O virtualhost https://raw.githubusercontent.com/RoverWire/virtualhost/master/virtualhost.sh
$ chmod +x virtualhost
$ wget -O virtualhost-nginx https://raw.githubusercontent.com/RoverWire/virtualhost/master/virtualhost-nginx.sh
$ chmod +x virtualhost-nginx
```## Usage ##
Basic command line syntax:
```bash
$ sudo sh /path/to/virtualhost.sh [create | delete] [domain] [optional host_dir]
```With script installed on /usr/local/bin
```bash
$ sudo virtualhost [create | delete] [domain] [optional host_dir]
```### Examples ###
to create a new virtual host:
```bash
$ sudo virtualhost create mysite.dev
```
to create a new virtual host with custom directory name:```bash
$ sudo virtualhost create anothersite.dev my_dir
```
to delete a virtual host```bash
$ sudo virtualhost delete mysite.dev
```to delete a virtual host with custom directory name:
```
$ sudo virtualhost delete anothersite.dev my_dir
```
### LocalizationFor Apache:
```bash
$ sudo cp /path/to/locale//virtualhost.mo /usr/share/locale//LC_MESSAGES/
```For NGINX:
```bash
$ sudo cp /path/to/locale//virtualhost-nginx.mo /usr/share/locale//LC_MESSAGES/
```