Skip to main content

Posts

Showing posts from July, 2017

Configuring Nginx as Webserver

Hello, Thanks for visiting RvKmR.blogspot.in In this post I am going explain about how to host your websites with nginx. Nginx is web server or we can use it as reverse proxy server. In this post we are discussing Nginx as web server. Let's say I have two web sites that I wish to host with nginx. example.com and test.com are those two websites to be hosted. Environment : Vagrant virtual machine(precise32) ___________________________________________________________________________________ 1. Installing nginx and required libraries to test: We can install it from vagrant provision script or manually from machine itself. I am installing from manually from machine. vagrant@precise32:~$ sudo apt-get install nginx wget links curl 2. Create website directories in document root and index page for those websites: sudo mkdir -p /usr/share/nginx/www/example.com/html sudo mkdir -p /usr/share/nginx/www/test.com/html  I have created simple html pa

Shebang...... an magic of unix

Hello, Thanks for visiting RvKmR.blogspot.in In this post, I am going to explain about shebang line. We see many of script starts with #! special characters. We are aware of # as a comment but at the start of the script if we use #! then it is not an ordinary comment. It is an instruction to program exec which execute our script. The shebang #! is humanly readable instance of a magic number consisting of the byte string 0x23 0x21. This is passed to exec() to determine the file to be executed is a script or a binary. When shebang line #! is used exec runs the script with executable specified after shebang #!. Ex. #!/bin/bash This is an instruction to exec to start execution of the program with /bin/bash.