Skip to content

Running GraphSpace on Apache

JingVT edited this page Mar 29, 2018 · 5 revisions

This section describes the steps required to launch GraphSpace on a server that has apache2 running on it. First, please follow the steps in Running GraphSpace locally. Next, execute the instructions below.

  1. Create a directory for python_eggs. mkdir /path_to_python_eggs
  2. Follow instructions 1-5 in Running GraphSpace locally
  3. Add settings file production.py by copying local settings file. cp graphspace/settings/local.py graphspace/settings/production.py
  4. Update your production.py settings file. (a). InSet URL_PATH to the URL where your server will be running. Note: Please add the ending '/' character at the end of this value: For example: http://graphspace.org/ (b). Modify the PATH to point to where GraphSpace directory exists. Note: Please add the ending '/' character at the end of this value: For example: /home/ubuntu/GraphSpace/
  5. Visit the apache2 directory: cd /path_to/apache2. An example of the full path to this directory is /etc/apache2.
  6. Navigate to the sites-enabled directory: cd sites-enabled
  7. Create a file called graphspace.conf and access this file using admin privileges: `sudo vim graphspace.conf'
  8. Inside this file, copy and paste following lines, after replacing all path_to_GraphSpace with the name of the directory where you downloaded GraphSpace and replacing path_to_python_eggs with the name of the directory for python_eggs you created at the beginning:
WSGIDaemonProcess GraphSpace python-path=/path_to_GraphSpace:/path_to_GraphSpace/venv/lib/python2.7/site-packages/ python-eggs=/path_to_python_eggs
WSGIProcessGroup GraphSpace
WSGIScriptAlias / /path_to_GraphSpace/graphspace/wsgi.py

 <Directory /path_to_GraphSpace/graphspace/>
    <Files wsgi.py>
        Order deny,allow
        Require all granted
    </Files>
 </Directory>
 
 Alias /static/ /path_to_GraphSpace/static/
 
 <Directory /path_to_GraphSpace/static/>
     Require all granted
 </Directory>
 
 <Directory /path_to_GraphSpace>
  Options Indexes FollowSymLinks
  AllowOverride None
  Require all granted
 </Directory>
  1. Install module to recognize Django application through apache2: sudo apt-get install libapache2-mod-wsgi
  2. Give permission to access static files through apache2. Navigate outside GraphSpace and type: chmod 777 GraphSpace
  3. Give permission to access static files through apache2. chmod 777 /path_to_python_eggs
  4. Restart the apache server. On a computer running Ubuntu, the command is sudo service apache2 restart

Refer to https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/modwsgi/ if any problems occur with the setup.

Clone this wiki locally