Go to file
2019-05-06 22:49:23 -07:00
CHANGELOG Add CHANGELOG 2019-05-06 22:38:07 -07:00
CONTRIBUTING.md Add CONTRIBUTING 2019-05-06 22:35:04 -07:00
README.md Update README.md 2019-05-06 22:49:23 -07:00
scotchbox.local.conf Update scotchbox.local.conf 2019-05-06 13:44:40 -07:00
Vagrantfile Add Vagrantfile 2019-05-06 13:42:14 -07:00

Vagrantfile

Vagrantfile 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:

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
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 my code of conduct, and the process for submitting pull requests to me.

Versioning

I 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