Create a Virtualhost in nginx during laravel project creation
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.
First, download the Larahost installer using Composer:
composer global require ankitjain28may/larahost
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
cd /usr/local/etc/nginx/servers/ curl https://raw.githubusercontent.com/ankitjain28may/larahost/master/nginx_conf/example.conf -O
Export these variables in $PATH.
export NGINX_EXAMPLE_FILE='/usr/local/etc/nginx/servers/example.conf' export NGINX_DEST='/usr/local/etc/nginx/servers/'
Once everything is setup, the
larahostnew command will create a fresh Laravel installation in the directory you specify.
larahost new blog
Feel free to contribute
Copyright (c) 2019 Ankit Jain - Released under the MIT License