print Creating a Scorpio development environment

Creating a user and getting the framework

Now we have the applications we need we can begin the proper work of setting up the environment. The first part of this is creating a new user that some of the scorpio components will run under (e.g. daemons or CLI scripts). This is not essential so if you don't want to do this step, you can ignore it.

groupadd -r scorpio
useradd -r -s /sbin/nologin -g scorpio -l -M scorpio

Installing the framework

We will now get the latest development snapshot of the framework directly from SubVersion and store it in a folder called "sites" within "home". First we need to create the folder structure:

mkdir -p /home/sites/scorpio

Change to the newly created folder:

cd /home/sites/scorpio

And finally we can export from SVN:

svn export https://scorpiofwork.svn.sourceforge.net/svnroot/scorpiofwork/scorpio/trunk ./

Notice that we are EXPORTing from SVN and not doing a checkout. This copy will be detached from the repository because we want to be able to add to it later. Performing an export also means that it can added to a local version control system.

If you created a scorpio user previously, now is the time to update the ownership:

chown -R scorpio.scorpio /home/sites/scorpio

And the general permissions:

chmod -R 775 /home/sites/scorpio 

Finally, both logs and temp need to be world writable as these will contain any (funnily enough) any log files or temporary files generated by the framework.

chmod 777 /home/sites/scorpio/logs /home/sites/scorpio/temp

With that done, we can create a couple of default sites and configure those as well. As this is just a dev environment you can call them pretty much anything you like. This tutorial is going to use .local and the base sites will be site.local and admin.site.local. Change to the websites folder:

cd /home/sites/scorpio/websites

And create two new folders for our sites:

mkdir site.local admin.site.local

To make life a little easier for us, copy the controllerMap.xml file from the base to site.local. The controllerMap.xml files define the controllers that are available to the sites. Without one, the site cannot function and will fail. Each site must have a controllerMap.xml file - it cannot be inherited from other sites.

cp base/controllerMap.xml site.local/

Along with the controllerMap.xml file, a site must have a config.xml file that defines the basic settings for it. Again, sites must have their own config.xml file. We will create two basic config files for each site, first the site.local file:

nano site.local/config.xml

I use nano for text editing on the command line, this is an alternative to pico and I like it because it is simple to use. If you prefer vi or emacs or some other editor, then use that instead. Either way, the config.xml file will need the following XML code:

<config>
    <section name="site" override="1">
        <option name="parent" value="base" override="1" />
        <option name="active" value="1" override="1" />
    </section>
</config>

In nano, now press the Ctrl key (lower left hand side of the keyboard) and O (that's the o owww key and NOT zero) to writeout the changes, then Ctrl+X to exit.

Note: the baseAdminSite was removed from Scorpio version 0.3 and above.

On a production box you should set a .htaccess rule to prevent public access to any configuration files.