-
Notifications
You must be signed in to change notification settings - Fork 275
Added Vagrantfile for easy launching #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bluebaroncanada
wants to merge
9
commits into
bshaffer:master
Choose a base branch
from
bluebaroncanada:vagrant
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ebc6aea
Added Vagrantfile
oauth2-middleware a8f26ef
Clearer instructions about mapping for xdebug
oauth2-middleware 2ce8b16
Added PhpStorm instructions for xdebug with images
oauth2-middleware 74cba77
Informed user that xdebug is optional
oauth2-middleware 1994822
Automatic composer install
oauth2-middleware e5a0df5
Add the root directory instead for debugging inside the vendor direct…
oauth2-middleware 0f4817f
Opened connections for 8081 and updated paramters.json automatically
oauth2-middleware aa5585c
Added Vagrant installation instructions and post-install instructions.
oauth2-middleware 5d5fe26
Moved Vagrant preamble and linked to https://www.vagrantup.com properly.
oauth2-middleware File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| # -*- mode: ruby -*- | ||
| # vi: set ft=ruby : | ||
|
|
||
| VAGRANTFILE_API_VERSION = '2' | ||
|
|
||
| @script = <<SCRIPT | ||
| # Install dependencies | ||
|
|
||
| add-apt-repository ppa:ondrej/php -y | ||
| apt-get update | ||
| apt-get install -y apache2 php5.6 php5.6-curl php5.6-sqlite php5.6-xdebug curl php5.6-curl zip unzip | ||
| apt remove -y php7.1-cli | ||
|
|
||
| # Configure Apache | ||
| echo "<VirtualHost *:8080> | ||
| DocumentRoot /var/www/web | ||
| AllowEncodedSlashes On | ||
|
|
||
| <Directory /var/www/web> | ||
| Options +FollowSymLinks -MultiViews | ||
| DirectoryIndex index.php index.html | ||
| Order allow,deny | ||
| Allow from all | ||
| AllowOverride All | ||
| RewriteEngine On | ||
| RewriteCond %{REQUEST_FILENAME} !-d | ||
| RewriteCond %{REQUEST_FILENAME} !-f | ||
| RewriteRule ^ index.php [QSA,L] | ||
| </Directory> | ||
|
|
||
|
|
||
| ErrorLog ${APACHE_LOG_DIR}/error.log | ||
| CustomLog ${APACHE_LOG_DIR}/access.log combined | ||
| </VirtualHost> | ||
| <VirtualHost *:8081> | ||
| DocumentRoot /var/www/web | ||
| AllowEncodedSlashes On | ||
|
|
||
| <Directory /var/www/web> | ||
| Options +FollowSymLinks -MultiViews | ||
| DirectoryIndex index.php index.html | ||
| Order allow,deny | ||
| Allow from all | ||
| AllowOverride All | ||
| RewriteEngine On | ||
| RewriteCond %{REQUEST_FILENAME} !-d | ||
| RewriteCond %{REQUEST_FILENAME} !-f | ||
| RewriteRule ^ index.php [QSA,L] | ||
| </Directory> | ||
|
|
||
|
|
||
| ErrorLog ${APACHE_LOG_DIR}/error.log | ||
| CustomLog ${APACHE_LOG_DIR}/access.log combined | ||
| </VirtualHost>" > /etc/apache2/sites-available/000-default.conf | ||
|
|
||
| a2enmod rewrite | ||
| echo "xdebug.remote_enable=on" >> /etc/php/5.6/apache2/conf.d/xdebug.ini | ||
| echo "xdebug.remote_host=192.168.34.1" >> /etc/php/5.6/apache2/conf.d/xdebug.ini | ||
| sed -i 's/Listen 80/Listen 8080/' /etc/apache2/ports.conf | ||
|
|
||
| echo Listen 8081 >> /etc/apache2/ports.conf | ||
| service apache2 restart | ||
|
|
||
| cd /var/www/ | ||
| cp data/parameters.json.dist data/parameters.json | ||
| sed -i 's?"grant"?"http://localhost:8081/lockdin/token"?g' data/parameters.json | ||
| sed -i 's?"access"?"http://localhost:8081/lockdin/resource"?g' data/parameters.json | ||
|
|
||
|
|
||
| if [ -e /usr/local/bin/composer ]; then | ||
| /usr/local/bin/composer self-update | ||
| else | ||
| curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | ||
| fi | ||
|
|
||
| cd /var/www/ | ||
| composer install | ||
|
|
||
| # Reset home directory of vagrant user | ||
| if ! grep -q "cd /var/www" /home/vagrant/.profile; then | ||
| echo "cd /var/www" >> /home/vagrant/.profile | ||
| fi | ||
|
|
||
|
|
||
| SCRIPT | ||
|
|
||
| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | ||
| config.vm.box = 'bento/ubuntu-16.04' | ||
| config.vm.network "private_network", ip: "192.168.34.2" | ||
| config.vm.network "forwarded_port", guest: 8080, host: 8080 | ||
| config.vm.network "forwarded_port", guest: 8081, host: 8081 | ||
| config.vm.synced_folder '.', '/var/www' | ||
| config.vm.provision 'shell', inline: @script | ||
|
|
||
| config.vm.provider "virtualbox" do |vb| | ||
| vb.customize ["modifyvm", :id, "--memory", "1024"] | ||
| vb.customize ["modifyvm", :id, "--name", "oauth2-demo-php"] | ||
| end | ||
| end | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This address seems oddly specific (
192.168.34.1). Why is that?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that 33 is the default. I could be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
33 definitely used to be/possibly is still the default. Doing a quick Google search returns tons of documents with
192.168.33.1.