Generate NGINX virtual hosts script

I created simple script for creating NGINX virtual hosts so that you don’t have to do it manualy for every new website. Script was created for Linux – CentOS 7 – operating system but it should work on other distributions too. It is written in bash. You will also need wget and tar installed for script to work – wordpress install option.

What it does is pretty straightforward. On input side it will ask you for domain name, SSL option and WordPress installation. You can choose between http and https virtual host definition. By default it will create document root for your domain and NGINX configuration file for that domain. If you choose option for WordPress installation, then it will also download latest wordpress version and unpack files to your newly created document root. You’ll still need to create database manually and finish WordPress installation. This script is suitable for basic NGINX website configurations

Just download script here and template files. Put script createsite to your /usr/sbin/ directory and make it executable. Of corse you can change virtual host templates according to your needs too.

Continue Reading

Remove those ^M symbols with VI

We all know how annoying those ^M-s can be all over your script or file. ^M is a carriage return, and is commonly seen when files are copied from Windows. All of them can be removed in one step, with vi editor. Open your file in vi and hit escape. Then do like shown below.

%s/{Ctrl+V}{Ctrl+M}//{Enter}

© 2024 geegkytuts.net
Hosted by SIEL


About author