Cornucopt requires PHP 4.0 or higher, and MySQL. The contents of the Cornucopt archive are intended to go anywhere you want them inside the document root of your web server – there’s one directory related to Smarty (the template engine which comes with Cornucopt, so you don’t need to install it separately) that likes to be somewhere else, but we’ll get to that.
0) Unpack the cornucopt.zip package and move its contents onto your web server.
The only other dorking around you have to do on the server side is to make a directory, at the same level as Corny’s top-level files (index.php and all that), name it “tmp”, and give it 777 access. This is where Corny keeps its PHP session files; we did this because PHP’s default storage position for sessions tends not to work on shared hosting. This solution is not very secure. At all. In fact, you should put a blank index.html file in there at the minimum. You can also forbid access with an .htaccess file if you’re fancy.
1) Set up the MySQL database.
At the moment, we don’t have anything fancy like an install script that will set up the database structure for you; if you or your ISP have PHPMyAdmin handy, that will make database setup easiest. If you don’t, the command-line tool mysqladmin is your ticket. Before you fire that up, though, have a look at the file ‘cornucopt.sql’ in the text editor of your choice. Find the line that looks like this:
INSERT INTO `users` VALUES (2, 'admin', 'Administrator', '', 'admin', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '', '');
And edit it thusly:
INSERT INTO `users` VALUES (2, 'admin', 'Administrator', '', 'whatever.password.you.want', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '', '');
...where “whatever.password.you.want” is, um, whatever password you want. Do not skip this step unless you want just anyone to be able to wander up and mess with your site in very, very bad ways. (We know that we need a nicer way of doing this.)
Save that change, and then go ahead and fire up your database management thingy of choice. PHPMyAdmin offers a method of running the contents of cornucopt.sql that is fairly straightforward. If you’ve got to use mysqladmin instead, open a terminal, navigate to the directory you put Cornucopt in, and type this:
mysql -u your.mysql.username --password=your.mysql.password your.database.name < cornucopt.sql
Obviously, you’ll want to put your own info in the proper places there. If that all goes well, and it should, you should probably delete cornucopt.sql, since it’s plaintext and has your admin password in it. Then you are ready for the next step.
2) Edit your copy of config.php.
Before Cornucopt can take advantage of your shiny new database, it has to know how to find it. That’s the bulk of what happens in config.php, a file that lives in Corny’s ‘includes’ directory.
Fire up your text editor again and edit config.php. The comments in that file should tell you what’s going on. Save those changes and you are ready to go.
3) Point a web browser at the directory into which you installed Cornucopt.
If things look weird at this stage, you might have a browser that isn’t so happy with the latest CSS. By default, Cornucopt’s templates use layout technologies that are supported by the most recent web browsers and degrade gracefully in older ones. You can change all that if you’d like, but right now, no matter how things look (unless you have a screen full of errors), you should have a prominent Login link near the top of the page. Click that, and
4) Log in with username ‘Admin’ and the password you specified earlier.
Once that has worked out,
5) Point your browser to (the directory that Cornucopt lives in)/admin/index.php.
The screen you’ll see here gives you the chance to edit a lot of sitewide variables, most of which you don’t really have to care about. The ones to change now are ‘sitename’ and ‘siteurl’. Set these according to the onscreen instructions and hit the ‘Save ALL Fields’ button at the bottom.
That should have you all set up. Click your new site name at the top of the screen and get to editing. By default, you have to be logged in to Cornucopt to edit pages. You might want to do some work under an account other than your Admin account; click Logout and then Register to create one.
Destinations for when you are feeling all expert:
How to Customize CoCo Templates – Field Guide to CoCo Code