PHP Classes


Recommend this page to a friend!
  Classes of Ankit Jain   Laravel Nginx Configuration   Download  
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Laravel Nginx Configuration
Create a Virtualhost in nginx for a Laravel site
Author: By
Last change:
Date: 3 years ago
Size: 1,704 bytes


Class file image Download


Build Status Latest Stable Version Packagist

Larahost is the extended plugin written over the laravel/installer plugin to set up the nginx virtualhost for the application automatically while installing.


It requires nginx to be installed in the system.

  1. First, download the Larahost installer using Composer:

        composer global require ankitjain28may/larahost
  2. Download the nginx configuration and put it in the nginx virtualhosts folder according to OS. Make necessary changes in the file related to port and PHP FastCGI configuration.

    For example- It is `/usr/local/etc/nginx/servers/` for Mac.

        cd /usr/local/etc/nginx/servers/
        curl -O
  3. Export these variables in $PATH.

        export NGINX_EXAMPLE_FILE='/usr/local/etc/nginx/servers/example.conf'
        export NGINX_DEST='/usr/local/etc/nginx/servers/'
  4. Once everything is setup, the `larahost` new command will create a fresh Laravel installation in the directory you specify.

        larahost new blog

    ## Contribute

>Feel free to contribute


>Copyright (c) 2019 Ankit Jain - Released under the MIT License