Topic Type:
Information
I organized some documents on the Farm Hack Hack Pad site into a "Farm Hack Web Committee" Collection. Check it out here.
Join the conversation! The forum activity is now at GOATeach.org! We are working to cross pollinate our conversations. Document and share tools at farm hack and talk at GOAT! Also join GOAT riot and introduce yourself and your projects!
I organized some documents on the Farm Hack Hack Pad site into a "Farm Hack Web Committee" Collection. Check it out here.
Note the requirements!
Spent Monday evening with RJ trying to create a sandbox FarmHack.net site. Got it working!
Assumptions are:
If you don't understand any of the above assumptions, then you should get a mentor to help. RJ Steinert, Mike Stenta, or Bruce Dawson have experience as of this writing.
The procedure (for Ubuntu) is as follows:
cd ../sites-enabled/sudo ln -s ../sites-available/farmhack.sandbox .
sudo /etc/init.d/apache2 reload
Make farmhack.sandbox a host by adding it to your /etc/hosts file:
sudo vi /etc/hosts
At then end of the file, add the line:127.0.0.1 farmhack.sandbox
and exit the editor.Create the database by loading what you copied from the getpantheon live backup site, specificially the database file. First you'll have to unzip it:
gunzip farmhack_live_2014-12-23T00-07-18_UTC_database.sql.gz
This will create a farmhack_live_2014-12-23T00-07-18_UTC_database.sql file - and remove the ...gz file. You'll note the .sql file is larger than the .gz file - the gunzip command simply uncompresses the file. The next step will be to create the database.mysqladmin -u debian-sys-maint -p create rjstatic_farmhack_beta1
The above mysqladmin command will create the database (but not populate it). However, you have to give the command a privileged user and password (-u debian-sys-maint, and -p). The user and password is found in /etc/mysql/debian.cnf (you'll need to use sudo to view the file). The next thing you have to do is permit the user and password in the settings.php file to have access to the database. This is done by using the mysql command to grant permissions to that user:mysql -u debian-sys-maint -p mysqlcreate user 'rjstatic_beta1'@'localhost' identified by 'XXX';grant all on rjstatic_farmhack_beta1.* to 'rjstatic_beta1'@'localhost';flush privileges;
In the above, replace 'XXX' with the password that you got from the settings.php file
Now, load the data into the database with the following command:
mysql -u rjstatic_beta1 -p rjstatic_farmhack_beta1 <farmhack_live_2014-12-23T00-07-18_UTC_database.sql
Next, change the $base_url variable in the settings.php file to:
$base_url = 'http://farmhack.sandbox'; // NO trailing slash!
The settings.php file is in the sites/default directory of the website. In my instance, this was ~/Desktop/FarmHack/devweb/sites/default/setings.php
The next step is to reset the caches:
sudo drush vset preprocess_js 0 --yessudo drush vset preprocess_css 0 --yessudo drush vset cache 0 --yes
Now, you have to create a temporary directory:
cd ~/Desktop/FarmHack/devwebmkdir tmpchmod 777 tmp
The last step is to login to the web site as the first user - also known as the admin user.drush uli
Finally, you should go to http://farmhack.sandbox, and you should be logged in as user1.
You can now work on the site without disturbing the production site at http://farmhack.net