Commit 293aaedc by David Baumgold

Vagrant: install edx-platform under /opt

Compatibility with the Filesystem Hierarchy Standard: http://www.pathname.com/fhs/
parent e614d1aa
...@@ -5,8 +5,8 @@ See [code.edx.org](http://code.edx.org/) for other parts of the edX code base. ...@@ -5,8 +5,8 @@ See [code.edx.org](http://code.edx.org/) for other parts of the edX code base.
Installation - The first time Installation - The first time
============================= =============================
The following instructions will help you to download and setup a virtual machine The following instructions will help you to download and setup a virtual machine
with a minimal amount of steps, using Vagrant. It is recommended for a first with a minimal amount of steps, using Vagrant. It is recommended for a first
installation, as it will save you from many of the common pitfalls of the installation, as it will save you from many of the common pitfalls of the
installation process. installation process.
...@@ -18,12 +18,12 @@ installation process. ...@@ -18,12 +18,12 @@ installation process.
6. Enter the project directory: `cd edx-platform/` 6. Enter the project directory: `cd edx-platform/`
7. Start: `vagrant up` 7. Start: `vagrant up`
The last step might require your administrator password to setup NFS. The last step might require your administrator password to setup NFS.
Afterwards, it will download an image, install all the dependencies and configure Afterwards, it will download an image, install all the dependencies and configure
the VM. It will take a while, go grab a coffee. the VM. It will take a while, go grab a coffee.
Once completed, hopefully you should see a "Success!" message indicating that the Once completed, hopefully you should see a "Success!" message indicating that the
installation went fine. (If not, refer to the Troubleshooting section below.) installation went fine. (If not, refer to the Troubleshooting section below.)
Accessing the VM Accessing the VM
...@@ -36,15 +36,15 @@ is finished. You can also type, from another terminal: ...@@ -36,15 +36,15 @@ is finished. You can also type, from another terminal:
$ vagrant ssh $ vagrant ssh
``` ```
Note: This won't work from Windows, install install PuTTY from Note: This won't work from Windows, install install PuTTY from
http://www.chiark.greenend.org.uk/%7Esgtatham/putty/download.html instead. Then http://www.chiark.greenend.org.uk/%7Esgtatham/putty/download.html instead. Then
connect to 127.0.0.1, port 2222, using vagrant/vagrant as a user/password. connect to 127.0.0.1, port 2222, using vagrant/vagrant as a user/password.
Using edX Using edX
--------- ---------
Once inside the VM, you can start Studio and LMS with the following commands Once inside the VM, you can start Studio and LMS with the following commands
(from the `/edx/edx-platform` folder): (from the `/opt/edx-platform` folder):
Learning management system (LMS): Learning management system (LMS):
...@@ -60,12 +60,12 @@ $ rake cms[dev,0.0.0.0:8001] ...@@ -60,12 +60,12 @@ $ rake cms[dev,0.0.0.0:8001]
Once started, open the following URLs in your browser: Once started, open the following URLs in your browser:
* Learning management system (LMS): http://192.168.20.40:8000/ * Learning management system (LMS): http://192.168.20.40:8000/
* Studio (CMS): http://192.168.20.40:8001/ * Studio (CMS): http://192.168.20.40:8001/
You can develop by editing the files directly in the `edx-platform/` directory you You can develop by editing the files directly in the `edx-platform/` directory you
downloaded before, you don't need to connect to the VM to edit them (the VM uses downloaded before, you don't need to connect to the VM to edit them (the VM uses
those files to run edX, mirroring the folder in `/edx/edx-platform`). those files to run edX, mirroring the folder in `/opt/edx-platform`).
Stopping & starting Stopping & starting
------------------- -------------------
...@@ -93,7 +93,7 @@ Troubleshooting ...@@ -93,7 +93,7 @@ Troubleshooting
### Reinstalling ### Reinstalling
If something goes wrong, you can easily recreate the installation from scratch by If something goes wrong, you can easily recreate the installation from scratch by
typing: typing:
``` ```
...@@ -125,7 +125,7 @@ Installation - Advanced ...@@ -125,7 +125,7 @@ Installation - Advanced
Note: The following installation instructions are for advanced users & developers Note: The following installation instructions are for advanced users & developers
who are familiar with setting up Python, Ruby & node.js virtual environments. who are familiar with setting up Python, Ruby & node.js virtual environments.
Even if you know what you are doing, edX has a large code base with multiple Even if you know what you are doing, edX has a large code base with multiple
dependencies, so you might still want to use the method described above the dependencies, so you might still want to use the method described above the
first time, as Vagrant helps avoiding issues due to the different environments. first time, as Vagrant helps avoiding issues due to the different environments.
......
...@@ -13,7 +13,7 @@ Vagrant.configure("2") do |config| ...@@ -13,7 +13,7 @@ Vagrant.configure("2") do |config|
config.vm.network :private_network, ip: "192.168.20.40" config.vm.network :private_network, ip: "192.168.20.40"
nfs_setting = RUBY_PLATFORM =~ /darwin/ || RUBY_PLATFORM =~ /linux/ nfs_setting = RUBY_PLATFORM =~ /darwin/ || RUBY_PLATFORM =~ /linux/
config.vm.synced_folder ".", "/edx/edx-platform", id: "vagrant-root", :nfs => nfs_setting config.vm.synced_folder ".", "/opt/edx-platform", id: "vagrant-root", :nfs => nfs_setting
# Make it so that network access from the vagrant guest is able to # Make it so that network access from the vagrant guest is able to
# use SSH private keys that are present on the host without copying # use SSH private keys that are present on the host without copying
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# Copyright (C) 2013 edX <info@edx.org> # Copyright (C) 2013 edX <info@edx.org>
# #
# Authors: Xavier Antoviaque <xavier@antoviaque.org> # Authors: Xavier Antoviaque <xavier@antoviaque.org>
# David Baumgold <david@davidbaumgold.com>
# #
# This software's license gives you freedom; you can copy, convey, # This software's license gives you freedom; you can copy, convey,
# propagate, redistribute and/or modify this program under the terms of # propagate, redistribute and/or modify this program under the terms of
...@@ -55,16 +56,15 @@ chown vagrant.vagrant ~vagrant/.ssh/known_hosts ...@@ -55,16 +56,15 @@ chown vagrant.vagrant ~vagrant/.ssh/known_hosts
# edX - Development environment ############################################### # edX - Development environment ###############################################
sudo -u vagrant chown vagrant.vagrant /opt/edx-platform
chown vagrant.vagrant /edx # For convenience with `vagrant ssh`, the `edx-platform` virtualenv is always
# For convenience with `vagrant ssh`, the `edx-plateform` virtualenv is always
# loaded after the first run, so we need to deactivate that behavior to run # loaded after the first run, so we need to deactivate that behavior to run
# `create-dev-env.sh`. # `create-dev-env.sh`.
[[ -f ~vagrant/.bash_profile ]] && { [[ -f ~vagrant/.bash_profile ]] && {
mv ~vagrant/.bash_profile ~vagrant/.bash_profile.bak mv ~vagrant/.bash_profile ~vagrant/.bash_profile.bak
} }
sudo -u vagrant -i bash -c "cd /edx/edx-platform && ./scripts/create-dev-env.sh -ynq" sudo -u vagrant -i bash -c "cd /opt/edx-platform && ./scripts/create-dev-env.sh -ynq"
# Virtualenv - Always load #################################################### # Virtualenv - Always load ####################################################
...@@ -76,8 +76,8 @@ sudo -u vagrant -i bash -c "cd /edx/edx-platform && ./scripts/create-dev-env.sh ...@@ -76,8 +76,8 @@ sudo -u vagrant -i bash -c "cd /edx/edx-platform && ./scripts/create-dev-env.sh
# Directory ################################################################### # Directory ###################################################################
grep "cd /edx/edx-platform" ~vagrant/.bash_profile || { grep "cd /opt/edx-platform" ~vagrant/.bash_profile || {
echo -e "\ncd /edx/edx-platform\n" >> ~vagrant/.bash_profile echo -e "\ncd /opt/edx-platform\n" >> ~vagrant/.bash_profile
} }
...@@ -96,7 +96,7 @@ log you in already), you can start Studio & LMS with the following commands: ...@@ -96,7 +96,7 @@ log you in already), you can start Studio & LMS with the following commands:
=> http://192.168.20.40:8000/ => http://192.168.20.40:8000/
- Studio: - Studio:
$ rake cms[dev,0.0.0.0:8001] $ rake cms[dev,0.0.0.0:8001]
=> http://192.168.20.40:8001/ => http://192.168.20.40:8001/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment