vagrant/README.md
2019-05-06 14:01:28 -07:00

2.8 KiB

Vagrant File

Vagrant File with box.scotch.io

Getting Started

If you use Vagrant, this box can help you a lot. https://box.scotch.io

With this Vagrantfile, you can easily use and implement many web apps with a self-certificate signed.

Prerequisites

Installing

Install virtualbox and Vagrant.

After that, go the main project folder and save this file and run the following command:

vagrant up

This command will mount all the environment to you.

Create a self-signed certificate

Run the command:

vagrant ssh

and run the following commands to create a self-signed certificate:

sudo a2enmod ssl
sudo service apache2 restart
sudo mkdir /etc/apache2/ssl
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt
sudo a2ensite default-ssl.conf

Create or move the file scotchbox.local.conf:

sudo nano /etc/apache2/sites-available/scotchbox.local.conf
<VirtualHost *:443>
       ServerAdmin webmaster@localhost
       ServerName scotchbox.local
       ServerAlias www.scotchbox.local
       DocumentRoot /var/www/public
       ErrorLog ${APACHE_LOG_DIR}/error.log
       CustomLog ${APACHE_LOG_DIR}/access.log combined
       SSLEngine on
       SSLCertificateFile /etc/apache2/ssl/apache.crt
       SSLCertificateKeyFile /etc/apache2/ssl/apache.key
       <FilesMatch "\.(cgi|shtml|phtml|php)$">
              SSLOptions +StdEnvVars
       </FilesMatch>
       <Directory /usr/lib/cgi-bin>
              SSLOptions +StdEnvVars
       </Directory>
        BrowserMatch "MSIE [2-6]" \
        nokeepalive ssl-unclean-shutdown \
        downgrade-1.0 force-response-1.0
        BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
</VirtualHost>

Edit Vagrant file for your project

Open your Vagrant file and change the line for your project name:

VagrantDomain=("app1.dev" "app2.dev" "appN.dev")

Edit your hosts, typically sudo nano /etc/hosts - and set: 192.168.33.10 www.app1.dev

After run the command:

vagrant provision

and visit your app in your browser:

https://www.app1.dev

Built With

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details