Editing the website

From Einstein Toolkit Documentation
Jump to: navigation, search

The Einstein Toolkit website http://einsteintoolkit.org/ is stored in the SVN repository https://svn.einsteintoolkit.org/www/. The main page is index.php. If you commit changes to this repository, they will be automatically reflected on the main site. The same applies to the Simulation Factory website http://simfactory.org, which is stored in the repository https://svn.cct.lsu.edu/repos/numrel/simfactory2/www/.

Since these sites use absolute URLs in their pages, it is not possible to test them before committing simply by pointing your browser at index.php in your local checkout. If you want to test one of these sites locally, you will need to use a local web server, and you will need its document root to be set appropriately. You can achieve this by using a virtual host in Apache.

The following instructions are appropriate for the default Apache installation that is shipped with Mac OS, but it should be trivial to adapt them to other installations.

First edit /etc/apache2/httpd.conf and enable the line

	Include /private/etc/apache2/extra/httpd-vhosts.conf
        LoadModule rewrite_module /usr/libexec/apache2/mod_rewrite.so

and edit httpd-vhosts.conf to contain:

<VirtualHost *:80>
    ServerAdmin your.email@address
    DocumentRoot "/path/to/simfactory/web/checkout"
    ServerName simfactory.local
    ErrorLog "/private/var/log/apache2/simfactory.localhost-error_log"
    CustomLog "/private/var/log/apache2/simfactory.localhost-access_log" common
    <Directory "/path/to/simfactory/web/checkout">
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin your.email@address
    DocumentRoot "/path/to/einsteintoolkit/web/checkout"
    ServerName einsteintoolkit.local
    ErrorLog "/private/var/log/apache2/einsteintoolkit.localhost-error_log"
    CustomLog "/private/var/log/apache2/einsteintoolkit.localhost-access_log" common
    <Directory "/path/to/einsteintoolkit/web/checkout">
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin your.email@address
    DocumentRoot "/Library/WebServer/Documents"
    ServerName localhost
    ErrorLog "/private/var/log/apache2/error_log"
    CustomLog "/private/var/log/apache2/access_log" common
</VirtualHost>

The last entry is necessary because once virtual hosts are enabled, the default host will not work any more, so you have to add a virtual host for it.

Next, edit /etc/hosts to contain:

127.0.0.1       simfactory.local
127.0.0.1       einsteintoolkit.local

You can now navigate to http://simfactory.local/ or http://einsteintoolkit.local/ and see the local versions of the web sites working correctly before committing them.