virtualhost

Bash Script to easy create or delete apache virtual hosts on ubuntu

  • 所有者: RoverWire/virtualhost
  • 平台:
  • 許可證:
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

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
  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/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:

$ 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

For Apache:

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

For NGINX:

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

主要指標

概覽
名稱與所有者RoverWire/virtualhost
主編程語言Shell
編程語言Shell (語言數: 1)
平台
許可證
所有者活动
創建於2013-05-25 20:17:38
推送於2022-04-13 16:27:29
最后一次提交2022-04-13 11:27:29
發布數0
用户参与
星數0.9k
關注者數54
派生數538
提交數64
已啟用問題?
問題數30
打開的問題數6
拉請求數18
打開的拉請求數5
關閉的拉請求數17
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?