Difference between revisions of "Dreamhack Getting Started"
m (→Stop Apache: it helps if I close my tags properly) |
(→A note about TheSchwartz) |
||
Line 101: | Line 101: | ||
==A note about TheSchwartz== | ==A note about TheSchwartz== | ||
− | + | Some process-heavy features are only available through running [[TheSchwartz]] workers. Notifications, search, crossposts, and imports are examples of these. If you aren't working on these features, then you don't need to worry about workers. | |
− | + | However, if you need them, your Dreamhack is already set up to let you use [[Workers]]. Just be sure to stop them when you're done. | |
− | + | ||
− | + | ||
− | + | ||
− | + |
Revision as of 20:04, 15 June 2013
The Dreamhack service is a hosted development sandbox environment where you can do Dreamwidth development without having to have your own server. Dreamhack accounts are available free of charge for anyone who's interested in working on the Dreamwidth code.
When you get your Dreamhack account first created, most of the setup will be done for you. There are still a bunch of things you should do at first to make sure that your development environment is properly set up for you to work on, though. This guide is a walkthrough of all the steps you should take (in order) when you first log into your Dreamhack account.
You should also read Beginning dev checklist for more background information; if you are on Windows, Newbie Guide: Getting Started on Windows might be useful. If you wind up in difficulty, take a look at Dreamhack Troubleshooting.
Contents
Get a SSH client
To connect to your Dreamhack and work on things, you'll need a program that will do SSH, or "secure shell". It lets you connect to the Dreamhack server and work with the files, which you can't do through your browser. If you're running Windows, download PuTTY. If you're on a Mac or a Linux distribution, you won't need a separate program; the Terminal (Applications/Utilities/Terminal on the Mac) will let you connect.
Connect to your Dreamhack
Once you have an SSH client, you can connect to Dreamhack. In PuTTY, put "hack.dreamwidth.net" for the server, and use the username and password you were given in your welcome email. In Terminal, type:
ssh dh-username@hack.dreamwidth.net
Change your password
Change your password to something you can remember. Type:
passwd
and follow the prompts.
Set the system password
Your Dreamhack installation has a user named 'system', which has all the admin privs and owns all the system styles. The system account is the first account on the server. You need to set a password so you can log into it. Type:
$LJHOME/bin/upgrading/make_system.pl
Pick something you'll remember. (If you ever forget the system password, though, you can just run make_system.pl again and re-set it.)
Get acquainted with the command line
If you haven't used a command line before, it can be a strange experience. You may want to check out the Command line tutorial before carrying on, as it explains a few of the concepts that we'll be using in the sections below.
Edit the config files
You'll need to edit a few config files to make for easier development. Do the following:
cd $LJHOME nano -w etc/config.pl
(The "nano" text editor is probably the best one for new developers. If you're more experienced, or want to try something a little more powerful, check out the list of editors at the Configuring editors page.)
You'll need to use the arrow keys to scroll through the file when using nano, because it won't respond to the mouse.
Take a look for the following line:
$USE_ACCT_CODES = 1;
This line governs whether invite codes are used. If the value is 1, then new accounts will need invites before they can be created. If the value is 0, then anybody can create an account. You can edit this value, if you like.
When you're done, press Ctrl-X to exit nano. It'll ask you if you want to save - press Y. It'll then ask you where you want to save the file. At this point, just press RETURN; you already told nano where to save it when you launched it, and pressing RETURN tells nano just to use that. You'll then find yourself back at the command line.
You should also edit your $LJHOME/ext/local/etc/config-local.pl file for some other local settings:
cd $LJHOME nano -w ext/local/etc/config-local.pl
Values you may want to change and/or set:
$SITENAME = "Some LiveJournal Site"; $SITENAMESHORT = "YourSite"; $SITENAMEABBREV = "YS"; # these are all used in various places throughout the site
Remember to save and exit when you're done.
Start Apache
Once all of this is done, you're ready to start Apache. Type:
start-apache
Your Dreamhack will now appear at http://www.yourusername.hack.dreamwidth.net.
Update your code regularly
Before you do any development work, it's a good idea to update your code to the most recent version. See Dev Maintenance for instructions.
Get familiar with version control
Read Version Control and get familiar with how things work.
Hack away!
You can now start hacking! For more information, check out the Category: Development category, especially the Beginning dev checklist, Dev Getting Started, and Programming Guidelines pages. If you run into problems, the #dreamwidth-dev IRC channel and the dw_dev_training community are good places to go for help.
A quick and easy way to populate your Dreamhack with lots of users is to run Sophie's Script:_create-users.
We're looking forward to seeing your first patch!
Stop Apache
At the end of a Dreamhack session, remember to stop-apache
so that the Dreamhack machine isn't running too many web servers that aren't being used.
A note about TheSchwartz
Some process-heavy features are only available through running TheSchwartz workers. Notifications, search, crossposts, and imports are examples of these. If you aren't working on these features, then you don't need to worry about workers.
However, if you need them, your Dreamhack is already set up to let you use Workers. Just be sure to stop them when you're done.