Posted on: 2012-12-12 15:07:52.000
I'm now starting to use Rockets for projects at work, so I need a way to create the user database from scratch. Anyone wanting to start using the newLISP on Rockets Blog source code will need to do the same thing. So our desires align!
I've created a simple installation script called setup-rockets.lisp. It needs to be run from the command line:
sudo newlisp setup-rockets.lisp
This will ask you a few questions (database, name, password, etc) and set up a new database for you with the right tables and create an admin user. Obviously you never want this to be run by someone else over the web, so make sure that it can't be viewed over your web server (either by permissions, or by using my Apache .htaccess directive that excludes all files ending in .lisp from being viewed (.lsp files are fine though!)
# Prevent framework source from being accessed
<Files ~ "\.lisp$">
Order allow,deny
Deny from all
</Files>
# Prevent database files from being accessed
<Files ~ "\.db$">
Order allow,deny
Deny from all
</Files>
Once the database is created (it will append the ".db" extension as well... you notice I've excluded those files so that you can't download the database from the web or via wget) you need to make sure it has the permissions to read and write by the owner:
chown www-data:www-data DATABASENAME.db
chmod 755 DATABASENAME.db
and you should be ready to go!