Difference between revisions of "GPG guide/Setting Up Your Local Development Environment"

From LibrePlanet
Jump to: navigation, search
(Created page with "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...")
 
Line 10: Line 10:
 
==Enable server-side include module==
 
==Enable server-side include module==
  
  <nowiki>
+
  <nowiki>a2enmod include</nowiki>
a2enmod include
 
</nowiki>
 
  
 
If this doesn't work, you may not have Apache installed. Install the
 
If this doesn't work, you may not have Apache installed. Install the
Line 47: Line 45:
 
==Enable virtual host==
 
==Enable virtual host==
  
  <nowiki>
+
  <nowiki>a2ensite esd</nowiki>
a2ensite esd
 
</nowiki>
 
  
 
==Restart Apache==
 
==Restart Apache==
  
  <nowiki>
+
  <nowiki>service apache2 restart</nowiki>
service apache2 restart
 
</nowiki>
 
  
 
==Edit your hosts file==
 
==Edit your hosts file==
Line 61: Line 55:
 
Edit your system's `/etc/hosts` file and add the following to the bottom:
 
Edit your system's `/etc/hosts` file and add the following to the bottom:
  
  <nowiki>
+
  <nowiki>127.0.0.1 esd-local-dev.fsf.org</nowiki>
127.0.0.1 esd-local-dev.fsf.org
 
</nowiki>
 
  
 
==Test==
 
==Test==

Revision as of 14:46, 27 May 2016

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.