PHP Classes
elePHPant
Icontem

Laravel Nginx Configuration: Create a Virtualhost in nginx for a Laravel site

Recommend this page to a friend!
  Info   View files Example   View files View files (9)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2019-08-12 (1 month ago) RSS 2.0 feedNot yet rated by the usersTotal: 36 This week: 4All time: 9,647 This week: 75Up
Version License PHP version Categories
larahost 1.0MIT/X Consortium ...5.5PHP 5, Systems administration, Libraries, C..., P..., C...
Description Author

This package can create a Virtualhost in nginx for a Laravel site.

It provides a PHP script that should be run from the command line shell to take a parameter of a given domain name.

The package calls a shell script to actually generate values for a Nginx Web server to make it ready to handle requests for the given domain with the current Laravel application being configured to run under that domain.

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

Innovation Award
PHP Programming Innovation award nominee
August 2019
Nominee
Vote
Many PHP applications are based on the Laravel framework use the Nginx framework.

This package makes it easier to configure a virtual host for a domain to run a Laravel based application by generating configuration files for the Nginx Web server.

Manuel Lemos
Name: Ankit Jain <contact>
Classes: 4 packages by
Country: India India
Age: 23
All time rank: 3316227 in India India
Week rank: 67 Up11 in India India Up
Innovation award
Innovation award
Nominee: 2x

 

Details

Larahost

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.

Installation

It requires nginx to be installed in the system.

  1. First, download the Larahost installer using Composer:

    `shell 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.

    `shell cd /usr/local/etc/nginx/servers/ curl https://raw.githubusercontent.com/ankitjain28may/larahost/master/nginx_conf/example.conf -O `

  3. Export these variables in $PATH.

    `shell 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.

    `shell larahost new blog `

    ## Contribute

>Feel free to contribute

License

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

  Files folder image Files  
File Role Description
Files folder imagenginx_conf (1 file)
Files folder imagesrc (1 file)
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file larahost Example Example script
Accessible without login Plain text file LICENSE.md Lic. License text
Accessible without login Plain text file nginx.sh Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  nginx_conf  
File Role Description
  Accessible without login Plain text file example.conf Data Auxiliary data

  Files folder image Files  /  src  
File Role Description
  Plain text file LarahostCommand.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:36
This week:4
All time:9,647
This week:75Up