Nginx Virtual host creator PHP script.

Though I had coded this script for an interview purpose. But this is really very necessary to share the same with other developers to ease their task in the creation of virtual hosts on a linux machine with nginx installed as server.I had hosted this script over Git-Hub :


https://github.com/tkant/nginx-vhost-creator
0 forks.
0 open issues.
Recent commits:

 

Usage of the nginx vhost creator script :
1. Login as root user, or the user who have access to edit the nginx configuration files and modify permissions to access to web root directory.
2. Execute the php script by using php-cli – for example :
3. Edit the host file which is located at /etc/hosts to point an IP to this newly created vhost. for example, I had mapped this domain to my localhost :
4. Now point your browser to the this newly created host. For ex.
5. You can see the phpinfo() output on the screen.
6. Thats it!!

 

  • Awesome things here. I am very glad to peer your article. Thank you a lot and I’m
    having a look ahead to touch you. Will you please drop me a
    e-mail?