Creating a occupyboston.org Development Environment: Difference between revisions

From wiki.occupyboston.org
Jump to navigation Jump to search
(→‎Theme Setup: another TODO)
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= Creating a occupyboston.org development environment =  
= Creating a occupyboston.org (wordpress) development environment =  


== Obtaining the Source ==
== Obtaining the Source ==
Line 7: Line 7:
cd occupyboston.org
cd occupyboston.org
git init
git init
git remote add origin occubos@boggs.mayfirst.org
git remote add origin occubos@boggs.mayfirst.org:/home/members/occupyboston/sites/occupyboston.org/users/occubos/occupyboston.org/include/site_hub
git fetch origin
git fetch origin
git merge origin/master
git merge origin/master
Line 34: Line 34:
$ mysql -uUSERNAME -p
$ mysql -uUSERNAME -p
mysql> create database occubos_wp;
mysql> create database occubos_wp;
mysql> grant all privileges on occubos_wp.* to 'occubos_wp'@'localhost' identified by 'secret-password';
mysql> exit
mysql> exit
</pre>
</pre>
Line 39: Line 40:
== Configuration Setup ==
== Configuration Setup ==


<pre>
  cd occupyboston.org  # this is the document root
  cd occupyboston.org  # this is the document root
  Edit the file wp-config.php
  cp wp-config-sample.php wp-config.php
</pre>
 
=== Configuration Changes ===
 
Edit wp-config.php; focus on the below lines.
 
<pre>
define('DB_NAME', 'database_name_here');
 
/** MySQL database username */
define('DB_USER', 'username_here');
 
/** MySQL database password */
define('DB_PASSWORD', 'password_here');
</pre>
 
Modify 'database_name_here', 'username_here', 'password_here' to the correct values above.


== Web Based Installation ==


=== Noteworthy Configuration Directives ===
Start up a web browser and enter the following URL:
http://occupyboston.local/.  If all has gone well, you'll be
redirected to http://occupyboston.local/wp-admin/install.php.  Follow
the instructions to finish the installation.


If you'd like to use mod_rewrite, add the following to your
Afterwards, log into your development site via http://occupyboston.local/wp-login.php.
webserver's virtualhost definition:


    RewriteEngine On
At this point, you'll have a wordpress installation, containing all of
    RewriteRule ^/*$ http://obwiki.local/wiki/Main_Page [L]
the plug-ins used by occupyboston.org. It won't look anything like
    RewriteRule ^/?wiki/(.*)$ /index.php?title=$1  [PT,L,QSA]
occupyboston.org, yet.


If you don't want to use mod_rewrite, add this line to LocalSettings.php
=== Theme Setup ===


  $wgArticlePath = false;
'''Theme'''.  Go to http://occupyboston.local/wp-admin/themes.php.  Activate theme
"OccupyBoston 1.1.1".


You may also want to add
'''News Banner'''.  Click "Widgets" option for the OccupyBoston 1.1.1
theme.  Put a text widget into "Widget area 2".  Give a title of
"LATEST NEWS" and body of "Latest news".  This will become news bar
content at the top of the site.  If you don't perform this step,
you'll see the text "Disabled" where the news banner would normally
be.


  $wgUseSquid = false;
'''Logo'''.  occupyboston.org's logo is not version controlled.  To
get a local copy:


  cd DOCUMENT_ROOT/wp-content
  mkdir -m 777 uploads
  cd uploads
  wget URL -O logo.png


== Additional Setup for Plugins ==
DOCUMENT_ROOT represents the document root of your wordpress
installation.  URL represents the url of occupyboston.org's logo.
(<nowiki>http://www.occupyboston.org/wp-content/uploads/2011/10/Occupy-Boston-Header2.png</nowiki>, or something along those lines)


We enable several MediaWiki plugins, and some of these plugins require
Once you've done this,
additional database tablesTo install the additional database
<nowiki>http://occupyboston.local/wp-content/uploads/logo.png</nowiki> should display a
tables:
logoIn the Themes section, click "CP Minimal settings", and provide
the URL of your logo image.


  cd mediawiki
'''Menus'''. occupyboston.org menus are provided by the
  php maintenance/update.php
jquery-mega-menu plugin. This plugin will be present (but not
activiated) in a new development environment.  ('''TODO''': menu setup
instructions).


At this point, you should be able to create and edit pages in your development environment.
'''General Options'''.  Go to
http://occupyboston.local/wp-admin/options-general.php, and set
whatever options you'd like.  For example, you might want to give a
Site Title of "Occupy Boston Dev".


On http://occupyboston.local/wp-admin/options-permalink.php, select
the "Day and name" option.
'''TODO''': additional plugin setup?


== Miscellaneous Notes ==
== Miscellaneous Notes ==


If you'd like to look at boggs server configuration for
The live apache configuration is <tt>~occubos/occupyboston.org/.red/apache2</tt>. There's not much to it.  <code>.htaccess</code> (from git) contains the bulk of the apache configuration.
wiki.occupyboston.org, you'll find it in
<tt>~obwiki/wiki.occupyboston.org/.red/apache2</tt>.
 
The live document root is
<tt>~obwiki/wiki.occupyboston.org/web/mediawiki/</tt>.  Note that this
is a checked out copy of git repository.

Latest revision as of 14:46, 13 May 2012

Creating a occupyboston.org (wordpress) development environment

Obtaining the Source

mkdir occupyboston.org
cd occupyboston.org
git init
git remote add origin occubos@boggs.mayfirst.org:/home/members/occupyboston/sites/occupyboston.org/users/occubos/occupyboston.org/include/site_hub
git fetch origin
git merge origin/master

The "occupyboston.org" directory will be your document root.

Setup a Virtual Host

Add an IP/hostname mapping to your hosts file (e.g., /etc/hosts). For example:

 127.0.0.1     occupyboston.local

Add a virtualhost to your web server. For example:

 <VirtualHost localhost:80>
   ServerName occupyboston.local
   DocumentRoot /PATH/TO/occupyboston.org/
 </VirtualHost>

Create a Database

Run

$ mysql -uUSERNAME -p
mysql> create database occubos_wp;
mysql> grant all privileges on occubos_wp.* to 'occubos_wp'@'localhost' identified by 'secret-password';
mysql> exit

Configuration Setup

 cd occupyboston.org   # this is the document root
 cp wp-config-sample.php wp-config.php


Configuration Changes

Edit wp-config.php; focus on the below lines.

define('DB_NAME', 'database_name_here');

/** MySQL database username */
define('DB_USER', 'username_here');

/** MySQL database password */
define('DB_PASSWORD', 'password_here');

Modify 'database_name_here', 'username_here', 'password_here' to the correct values above.

Web Based Installation

Start up a web browser and enter the following URL: http://occupyboston.local/. If all has gone well, you'll be redirected to http://occupyboston.local/wp-admin/install.php. Follow the instructions to finish the installation.

Afterwards, log into your development site via http://occupyboston.local/wp-login.php.

At this point, you'll have a wordpress installation, containing all of the plug-ins used by occupyboston.org. It won't look anything like occupyboston.org, yet.

Theme Setup

Theme. Go to http://occupyboston.local/wp-admin/themes.php. Activate theme "OccupyBoston 1.1.1".

News Banner. Click "Widgets" option for the OccupyBoston 1.1.1 theme. Put a text widget into "Widget area 2". Give a title of "LATEST NEWS" and body of "Latest news". This will become news bar content at the top of the site. If you don't perform this step, you'll see the text "Disabled" where the news banner would normally be.

Logo. occupyboston.org's logo is not version controlled. To get a local copy:

 cd DOCUMENT_ROOT/wp-content
 mkdir -m 777 uploads
 cd uploads 
 wget URL -O logo.png

DOCUMENT_ROOT represents the document root of your wordpress installation. URL represents the url of occupyboston.org's logo. (http://www.occupyboston.org/wp-content/uploads/2011/10/Occupy-Boston-Header2.png, or something along those lines)

Once you've done this, http://occupyboston.local/wp-content/uploads/logo.png should display a logo. In the Themes section, click "CP Minimal settings", and provide the URL of your logo image.

Menus. occupyboston.org menus are provided by the jquery-mega-menu plugin. This plugin will be present (but not activiated) in a new development environment. (TODO: menu setup instructions).

General Options. Go to http://occupyboston.local/wp-admin/options-general.php, and set whatever options you'd like. For example, you might want to give a Site Title of "Occupy Boston Dev".

On http://occupyboston.local/wp-admin/options-permalink.php, select the "Day and name" option.

TODO: additional plugin setup?

Miscellaneous Notes

The live apache configuration is ~occubos/occupyboston.org/.red/apache2. There's not much to it. .htaccess (from git) contains the bulk of the apache configuration.