Skip to content

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

Notifications You must be signed in to change notification settings

parmonov98/vhost

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 

Repository files navigation

Virtualhost Managing Bash Script

Bu Bash Script sizga apache/nginx yangi local domen(virtual hosts) yaratish va o'chirish amallarini bir qator buyruq bilan bajarishga yordam beradi. Ubuntu uchun.

O'rnatish

  1. Scriptni yuklab oling.
  2. Kerakli buyruqlarni bajarishi uchun unga huquq bering:
$ chmod +x /path/to/vhost.sh
  1. Tanlovli: Agar siz scriptni global muhitda ishlatmoqchi bo'lsangiz, unda bu faylni /usr/local/bin papkaga ko'chiring, is better Agar .sh formatsiz nusxalasangiz qulay bo'ladi:
$ sudo cp /path/to/vhost.sh /usr/local/bin/vhost

Foydalanish

Asosiy buyruq sintaksis:

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

/usr/local/bin ga o'rnatilganda

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

Misol uchun

Yangi virtual host yaratish uchun:

$ sudo vhost create mysite.dev

Yangi virtual hostni o'zingiz xohlagan papka yo'naltirmoqchi bo'lsangiz:

$ sudo vhost create anothersite.dev my_dir

Virtual host ni o'chirish uchun

$ sudo vhost delete mysite.dev

Maxsus papkaga o'rnatilgan virtual host o'chirmoqchi bo'lsangiz:

$ sudo vhost delete anothersite.dev my_dir

#Happy coding!

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%