Skip to content

Setting Up and Running in a Local Environment

Alexsuperfly edited this page Jul 20, 2017 · 1 revision

Stegasaurus is a web application. As such, it will require some setup to build and run locally. Typically, this site would be accessed by a simple URL if the site was live and in production online. For best results please follow this guide closely.

Download the zip containing all of the files you need for this setup and then follow the guide according to your operating system below.

Stegasaurus Project Zip Download


Setup for Mac OSX

Setup for Windows

Setup for Unix/Linux


###What are you making me install?

The only thing this setup will install onto your system directly are Python 3, pip for Python3, and PostgreSQL (if you do not already have them). All other dependencies such as Django and the packages used by Stegasaurus will be installed in a Python Virtual Environment and will not be polluting your global machine space.


#Mac OSX

##1 - Prerequisites (Required before you can do anything else!)

If you already have Python 3 and PostgreSQL you can continue on to step 2.

Python 3.0 or newer: https://www.python.org/downloads/

PostgreSQL (Installation steps 1.1 - 1.3)

1.1 - Download the zip from http://postgresapp.com/. Unzip it, and move the PostgreSQL app into your Applications folder.

1.2 - For the setup script in the next step to be able to access psql from the terminal, you must add PostgreSQL to your path. To do so, open a terminal and execute the following command (it is one long command which this document wraps so just copy paste the entire command into your terminal):

echo 'export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/latest/bin' >> ~/.bash_profile

1.3 - After executing this command, exit out all terminal windows. We do this to ensure that the next time we open a terminal window, bash shell is updated with the PostgreSQL addition so that we can successfully execute the setup script.

##2 - Set up and Build Stegasaurus (Only needs to be done once, the first time.)

2.1 - Open a terminal window and move into the Stegasaurus directory you unzipped using cd followed by the path where that directory is. If you were to type ls -l into the terminal you should see the USAGE.pdf document as well as setup.sh and dbsetup.sql among other files and the site directory.

lsscreenshot

2.2 - Make sure setup.sh has executable privileges on your machine. You can check by doing ls -l and looking at the letters in the far left column next for setup.sh. If you see -rwxr-x--x the file is executable. If you do not see this, type chmod 751 setup.sh into your terminal. This will guarantee that you can execute the setup script by giving it executable privileges.

2.3 - Run the setup script by typing ./setup.sh into your terminal window and let it run. This script will completely set up a local environment within that same directory along with all of the dependencies needed to run this site (within a virtual environment) so that you can run it on your machine.

You will be prompted at one point to create an admin username, email, and password before the script can finish. This will allow you to log into the admin side of the Stegasaurus site. This prompt will look something like this:

createsuperuser

When the script is done, you should see something like this in your terminal:

setupcomplete

##3 - Run Stegasaurus

To run Stegasaurus, make sure you are still in that same directory as before. If you do ls -l again, you should see all the same files including a makefile.

Type make into your terminal to run Stegasaurus. When the site server is running successfully, you should see something like this:

runsteg

Open any browser window and type http://127.0.0.1:8000 into the URL bar to get to the site. If all went well, you should see the Stegasaurus home page.


#Windows

##1 - Install a Virtual Machine

Windows users cannot run the server from a Windows host. They must install a virtual machine so that they can run the server from a Linux host. Oracle VM VirtualBox was used by our team.

##2 - Setup Linux Image on Virtual Machine

Go to the Ubuntu download page and download the image for version 16.04.1 LTS.

Open VirtualBox and select the New button.

Name your virtual machine, select Type as Linux, and Version as Ubuntu 64 bit (or 32 bit depending on your machine) and then click next.

Select your memory size. At least 2 GB is recommended for machine to not lag. Click next.

Select create a virtual hard disk, and click Create.

Select a hard disk file type, and select create. Select whether you want to dynamically allocate the storage or not.The recommended 8.00 GB of space is fine for the purposes of running this site.

Click Create and your machine will show up on the left side of your VirtualBox Manager. Select your VM and press click Start. You will be prompted to select a start-up disk. Navigate to where you downloaded the .iso file if it is not already selected and click open. Then click Start. The disk will boot into a live version. Select install Ubuntu, and follow the on-screen installation instructions.

##3 - Follow the Linux Instructions.

Now that you have a virtual machine installed, from within the virtual machine, all of the instructions will be identical to those of the Unix/Linux instructions below. Setup for Unix/Linux.


#Unix/Linux

These instructions are specific to Ubuntu 16.04.1 LTS, but they should work on other Debian derived systems.

##1 - Prerequisites (Required before you can do anything else!)

If you already have Python 3 you can continue on to step 2.

Python 3.0 or newer: https://www.python.org/downloads/

##2 - Set up and Build Stegasaurus (Only needs to be done once, the first time.)

2.1 - Open a terminal window and move into the Stegasaurus directory you unzipped using cd followed by the path where that directory is. If you were to type ls -l into the terminal you should see the USAGE.pdf document as well as setup.sh and dbsetup.sql among other files and the site directory. If you see something similar to this, you are in the right spot.

linls

2.2 - Make sure setup.sh has executable privileges on your machine. You can check by doing ls -l and looking at the letters in the far left column next to setup.sh. If you see -rwxr-x--x the file is executable. If you do not see this, type chmod 751 setup.sh into your terminal. This will guarantee that you can execute the setup script by giving it executable privileges.

2.3 - Run the setup script by typing ./setup.sh into your terminal window and let it run. This script will completely set up a local environment within that same directory along with installing PostgreSQL and all of the dependencies needed to run this site (within a virtual environment) so that you can run it on your machine.

You will be prompted at one point to create an admin username, email, and password before the script can finish. This will allow you to log into the admin side of the Stegasaurus site. This prompt will look something like this:

lincreatesuperuser

When the script is done, you should see something like this in your terminal:

donelin

##3 - Run Stegasaurus

To run Stegasaurus, make sure you are still in that same directory as before. If you do ls -l again, you should see all the same files including a makefile.

Type make into your terminal to run Stegasaurus. When the site server is running successfully, you should see something like this:

runlin

Open any browser window and type http://127.0.0.1:8000 into the URL bar to get to the site. If all went well, you should see the Stegasaurus home page.

Clone this wiki locally