How to create RRR from scratch » History » Version 5

Daniele Barchiesi, 2013-12-02 04:50 PM

1 1 Daniele Barchiesi
h1. How to create RRR from scratch
2 1 Daniele Barchiesi
3 5 Daniele Barchiesi
h2. Setup Drupal website environment
4 1 Daniele Barchiesi
5 5 Daniele Barchiesi
This will depend on whether you are developing the website on your local machine or on a remote server.
6 1 Daniele Barchiesi
7 5 Daniele Barchiesi
h3. Local machine (tested on MacBook air)
8 5 Daniele Barchiesi
   
9 5 Daniele Barchiesi
* Install XAMMP - web stack including database and web server apache
10 5 Daniele Barchiesi
** Download relevant version from http://www.apachefriends.org/en/xampp-macosx.html#849
11 5 Daniele Barchiesi
** Run the installer
12 5 Daniele Barchiesi
** Open XAMPP manager application and start all the servers (MySQL, Apache and ProFTPD)
13 5 Daniele Barchiesi
* Navigate to your XAMMP/htdocs/ folder
14 1 Daniele Barchiesi
15 5 Daniele Barchiesi
h3. Remote server (tested on a Linux machine running Ubuntu)
16 5 Daniele Barchiesi
17 5 Daniele Barchiesi
* ssh to remote machine
18 5 Daniele Barchiesi
* setup http web server (e.g. apache)
19 5 Daniele Barchiesi
* edit web server configuration files
20 5 Daniele Barchiesi
* go to your /var/www folder
21 5 Daniele Barchiesi
22 5 Daniele Barchiesi
h2. Install software, using for example, apt-get install
23 5 Daniele Barchiesi
24 1 Daniele Barchiesi
   * Install drush - command line utility to manage Drupal websites
25 1 Daniele Barchiesi
   * Install git - command line utility to manage version control
26 1 Daniele Barchiesi
27 5 Daniele Barchiesi
h2. Install drupal and use git to track its repository
28 5 Daniele Barchiesi
* run the following command 
29 1 Daniele Barchiesi
<pre>
30 1 Daniele Barchiesi
drush dl drupal --package-handler=git_drupalorg
31 1 Daniele Barchiesi
</pre>
32 5 Daniele Barchiesi
* Rename the folder with the name of your site site_name
33 1 Daniele Barchiesi
34 5 Daniele Barchiesi
 h2. Create new database
35 1 Daniele Barchiesi
36 5 Daniele Barchiesi
      * run the following command
37 4 Daniele Barchiesi
<pre>
38 4 Daniele Barchiesi
mysqladmin -u root -p create dbname
39 4 Daniele Barchiesi
</pre>
40 4 Daniele Barchiesi
 where dbname is the name of the database and root is the user
41 4 Daniele Barchiesi
42 4 Daniele Barchiesi
      * set privileges following instructions in the INSTALL.dbtype file in the Drupal folder (where dbtype is the kind of database used - e.g. MySQL)
43 4 Daniele Barchiesi
44 5 Daniele Barchiesi
 h2. Create new site
45 4 Daniele Barchiesi
46 4 Daniele Barchiesi
      * Point a browser to localhost/site_name
47 5 Daniele Barchiesi
      * Start the Drupal configuration
48 5 Daniele Barchiesi
h3. Verify requirements
49 5 Daniele Barchiesi
* Enable php GD extension
50 4 Daniele Barchiesi
<pre>
51 5 Daniele Barchiesi
apt-get install php5-gd (enable php gd extension)
52 5 Daniele Barchiesi
/etc/init.d/apache2 restart
53 4 Daniele Barchiesi
</pre>
54 5 Daniele Barchiesi
* Create writable files directory
55 4 Daniele Barchiesi
<pre>
56 5 Daniele Barchiesi
mkdir site_name/sites/default/files
57 5 Daniele Barchiesi
chmod ga+w site_name/sites/default/files
58 4 Daniele Barchiesi
</pre>
59 5 Daniele Barchiesi
* Create writable settings file
60 5 Daniele Barchiesi
<pre>
61 5 Daniele Barchiesi
cp site_name/sites/default/default.settings.php site_name/sites/default/settings.php
62 5 Daniele Barchiesi
chmod ga+w site_name/sites/default/settings.php
63 5 Daniele Barchiesi
</pre>
64 5 Daniele Barchiesi
h3. Configure site
65 5 Daniele Barchiesi
* Revoke public and group write permissions to avoid security issues
66 5 Daniele Barchiesi
<pre>
67 5 Daniele Barchiesi
chmod ga-w site_name/sites/default/settings.php
68 5 Daniele Barchiesi
chmod ga-w site_name/sites/default/
69 5 Daniele Barchiesi
</pre>
70 5 Daniele Barchiesi
At this point, you have a clean Drupal website that can be accessed locally at http://host/site_name
71 3 Daniele Barchiesi
72 3 Daniele Barchiesi
h2. Obtain RRR modules and settings
73 3 Daniele Barchiesi
* Clone the RR repository to a folder of your choice by running the command
74 3 Daniele Barchiesi
<pre>
75 3 Daniele Barchiesi
hg clone https://code.soundsoftware.ac.uk/hg/rr-repo
76 3 Daniele Barchiesi
</pre>
77 1 Daniele Barchiesi
* Copy the features module rr-repo/sites/all/modules/experiments_list to the modules folder of your website XAMPP/htdocs/site_name/sites/all/modules
78 1 Daniele Barchiesi
* Enable modules by running
79 1 Daniele Barchiesi
<pre>
80 1 Daniele Barchiesi
drush pm-enable experiments_list
81 1 Daniele Barchiesi
</pre>