Add README.md
This commit is contained in:
commit
f9c0aacaec
121
README.md
Normal file
121
README.md
Normal file
@ -0,0 +1,121 @@
|
||||
# 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
|
||||
|
||||
* virtualbox - https://www.virtualbox.org;
|
||||
* Vagrant - https://www.vagrantup.com;
|
||||
|
||||
### 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]" \
|
||||
</VirtualHost>
|
||||
nokeepalive ssl-unclean-shutdown \
|
||||
downgrade-1.0 force-response-1.0
|
||||
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
|
||||
```
|
||||
|
||||
## 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
|
||||
|
||||
* [virtualbox](https://www.virtualbox.org)
|
||||
* [Vagrant](https://www.vagrantup.com)
|
||||
* [scothcbox](https://box.scotchbox.io) - Box with many software installed
|
||||
|
||||
## Contributing
|
||||
|
||||
Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.
|
||||
|
||||
## Versioning
|
||||
|
||||
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags).
|
||||
|
||||
## Authors
|
||||
|
||||
* **André Almeida** - [andrealmeida.net](https://andrealmeida.net)
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
|
||||
|
||||
Loading…
Reference in New Issue
Block a user