Giter VIP home page Giter VIP logo

ng-crud's Introduction

Nginx Virtual Host CRUD Operation

Codacy Badge

Simple bash script to perform CRUD (Create, Read, Update, and Delete) virtual host using Nginx

Installation

  1. Download the codes via terminal on your server

$ wget https://github.com/wildan3105/Nginx-Vhost-CRUD-Operation/archive/master.zip

  1. Unzip the codes

$ unzip master.zip /path/to

  1. Change permission for all files

$ chmod +x *.sh

  1. Start managing your Nginx virtual host and be productive !

  2. Optional : If you wanna edit the script on your own, you can also change permission to 755 to enable editing

$ chmod 755 *.sh

Usage

Assumption(s) : You have set your basic Nginx virtual host / server blocks. If you haven't set it yet, check to this link :

How to set up nginx virtual host on Ubuntu 16.04

Basic command line syntax : $ sudo ./create.sh [argument]

Examples

  1. Create a new virtual host :

    Syntax : $ sudo ./create.sh [domain]

    Example : $ sudo ./create.sh blog.wildan.us

  2. List all active virtual host(s):

    Syntax : $ ./read.sh

    Example : $ ./read.sh

  3. Delete certain virtual host :

    Syntax : $ sudo ./delete.sh [domain]

    Example : $ sudo ./delete.sh blog.wildan.us

  4. Update virtual host address :

    Syntax : $ sudo ./update.sh [old-domain] [new-domain]

    Example : $ sudo ./update.sh blog.wildan.us notes.wildan.us

Further Development

  • Add usage.sh
  • Check if domain already exist
  • Colored output text

Contributor

License

MIT

ng-crud's People

Contributors

quique avatar wildan3105 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ng-crud's Issues

ReadMe

The Readme has an link issue in line

Assumption(s) : You have set your basic Nginx virtual host / server blocks. If you haven't set it yet, check to this link :
How to set up nginx virtual host on Ubuntu 14.04

It directs to setup apache virtual hosts.
The correct link would be :

How to set up nginx virtual host on Ubuntu 16.04

Create unit test for every action

What is the current situation ?

Every action (create, read, update, and delete) virtual host happen without test. So if I did something wrong, it will eventually cause an error on Nginx server.

What is the expected situation ?

A unit test for every case based on the action so it will not cause an error on Nginx server.

Reference link on stackoverflow regarding this issue Unit testing bash script

I will very appreciate for any kind of help 👍

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.