https://github.com/magepsycho/nginx-virtual-host-bash-script
Nginx Virtual Host Bash Script
https://github.com/magepsycho/nginx-virtual-host-bash-script
bash-script laravel laravel-framework laravel5 magento magento2 nginx shell shell-script virtual-hosts wordpress wordpress-development
Last synced: 3 months ago
JSON representation
Nginx Virtual Host Bash Script
- Host: GitHub
- URL: https://github.com/magepsycho/nginx-virtual-host-bash-script
- Owner: MagePsycho
- Created: 2018-03-17T20:00:27.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-23T08:17:30.000Z (over 5 years ago)
- Last Synced: 2025-02-01T04:31:38.202Z (3 months ago)
- Topics: bash-script, laravel, laravel-framework, laravel5, magento, magento2, nginx, shell, shell-script, virtual-hosts, wordpress, wordpress-development
- Language: Shell
- Homepage: https://blog.magepsycho.com/
- Size: 244 KB
- Stars: 38
- Watchers: 6
- Forks: 15
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Nginx Virtual Host Creator (Magento 1, Magento 2, Laravel, WordPress)
This Script creates Nginx virtual host for different applications.
Some of the supported applications are:
- Magento 1
- Magento 2
- WordPress
- Laravel
- Html
- ~~Others~~## INSTALL
To install, simply download the script file and give it the executable permission.
```
curl -0 https://raw.githubusercontent.com/MagePsycho/nginx-virtual-host-bash-script/master/src/vhost-nginx.sh -o vhost-nginx.sh
chmod +x vhost-nginx.sh
```To make it system wide command
```
sudo mv vhost-nginx.sh /usr/local/bin/vhost-nginx
```
OR
(may not work with `sudo`)
```
mv vhost-nginx.sh ~/bin/vhost-nginx
```
Make sure your `$HOME/bin` folder is in executable path## USAGE
### To display help
```
sudo ./vhost-nginx.sh --help
```
### To Create Virtual Host for Magento 1
```
sudo ./vhost-nginx.sh --domain=magento1938.test --app=magento1 --root-dir=/var/www/magento1/magento1938
```### To Create Virtual Host for Magento 2
```
sudo ./vhost-nginx.sh --domain=magento223ce.test --app=magento2 --root-dir=/var/www/magento2/magento223ce
```### To Create Virtual Host for WordPress
```
sudo ./vhost-nginx.sh --domain=wordpress494.test --app=wordpress --root-dir=/var/www/wordpress/wordpress494
```### To Create Virtual Host for Laravel
```
sudo ./vhost-nginx.sh --domain=laravel560.test --app=laravel --root-dir=/var/www/laravel/laravel560
```### To Create Virtual Host for Default (Html)
```
sudo ./vhost-nginx.sh --domain=website.test --app=laravel --root-dir=/var/www/html/website
```**Notes**
- In case of system-wide command, you can omit the `--root-dir` parameter if you run the command from the root directory of application.## Screenshots

Screentshot - Nginx Virtual Host Creator Help
Screentshot - Nginx Virtual Host Creator Result## RoadMap
- [ ] To Support multiple applications:
- [x] Magento 1
- [x] Magento 2
- [x] WordPress
- [x] Laravel
- [x] Html
- [ ] OroCrm
- [ ] OroCommerce
- etc.
- [ ] Flexible settings for Nginx
- fastcgi_pass: tcp port (127.0.0.1:9000) or unix socket (/var/run/php-fpm.sock)
- [ ] Option to configure virtual host template from separate file.
- [ ] Option to add SSL configuration