GPG guide/Setting Up Your Local Development Environment

From LibrePlanet
< GPG guide
Revision as of 14:46, 27 May 2016 by Zakkai (talk | contribs)
Jump to: navigation, search

Apache is required in order to replicate the appearance of the website on the live and staging servers on your machine. If you don't want to install Apache, you can still work on the site, you just won't be able to see what it looks like until you push to the remote.

Modifying Apache's configuration files and running its executables typically requires root access. So, you will most likely need to run the commands below as the root user using `sudo`.

Enable server-side include module

a2enmod include

If this doesn't work, you may not have Apache installed. Install the package apache2 from your package manager.

Create virtual host

Create a new file called esd.conf in `/etc/apache2/sites-available` with the following contents:

<VirtualHost *:80>
RewriteEngine on
        ServerName esd-local-dev.fsf.org
        ServerAdmin webmaster@localhost
        DocumentRoot /PATH-TO-ESD-REPO
        <Directory /PATH-TO-ESD-REPO/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Require all granted
            Order deny,allow
            deny from none
            allow from all
            SSILegacyExprParser on
            Options +Includes
            XBitHack on
        </Directory>
        ErrorLog /PATH-TO-LOG-DIRECTORY/error.log
        CustomLog /PATH-TO-LOG-DIRECTORY/access.log combined
</VirtualHost>

Replace all instances of `PATH-TO-ESD-REPO` with the full path to the root directory of your local git repository AND 'PATH-TO-LOG-DIRECTORY' with a a path to a directory where you want to keep your logs (up to you, but please not in the git repository). It's not generally a good idea to turn off the logging.

Enable virtual host

a2ensite esd

Restart Apache

service apache2 restart

Edit your hosts file

Edit your system's `/etc/hosts` file and add the following to the bottom:

127.0.0.1 esd-local-dev.fsf.org

Test

Visit <http://enc-local-dev.fsf.org/en> in your web browser. If everything is configured properly, you will see the English version of the site, and the language translation dropdown will work.