-
jeffsmith posted this
Computer:~/Downloads/simplelog_2.0.2 username$ chmod 755 log/
Computer:~/Downloads/simplelog_2.0.2 username$ chmod 755 theme_backup/
Computer:~/Downloads/simplelog_2.0.2 username$ chmod 755 public/dispatch.fcgi
Input the above commands into Terminal (or your command line tool of choice) while in the unzipped Simplelog directory.
Next we’re going to set up our database and configuration settings. First, open config/database.yml and edit it to match your database details (using the DB name, username, and password we set up earlier). For those that are setting up Simplelog on a host other than A Small Orange (or those wanting to use a PostgresSQL DB) there are a couple of other example database.yml files in the config directory. If your MySQL server address is anything other than ‘localhost’, you’ll want to use the database_dreamhost.yml for your example. It contains a ‘host’ field that will allow you to type in a named MySQL address for your server (i.e. mysql.mydomain.com).
One last thing before we upload everything to our A Small Orange server, since ASO is running Rails through FCGI, we’ll need to force Simplelog to run in production mode. Running in production mode will speed things up for us and will put a lot less strain on our shared server (Rails apps should always be run in production mode on your shared server, development should be done locally or on your own development server). So to force production mode, we’re going to open up the environment.rb file in the config directory and add this line to it around line 39: ENV['RAILS_ENV'] ||= 'production'.
Another step that you’ll notice that I’ve skipped (that you would normally have to take care of for most Rails apps) is opening the .htaccess file in the public folder of Simplelog to point to dispatch.fcgi instead of dispatch.cgi. The reason that I’ve skipped over this is because Simplelog is already configured this way when downloaded, so you don’t have to worry about it.
Now that we’ve done all this, we’ll upload Simplelog to our server. Since this isn’t a normal HTML/PHP/etc. application, we’re going to be uploading it to our main user directory (/home/username/). I prefer to keep all my Rails applications in one directory by themselves, so I’ve created a rails folder in my home directory. Change to that folder and upload the Simplelog folder from your local machine.
Once everything is finished uploading, we’re going to SSH into the server to bootstrap our database (bootstrapping includes importing the database schema and a bit of sample data). To bootstrap our database we’ll want to run these commands once we’re logged in to our server:
username@Server [~]# cd rails/simplelog_2.0.2
username@Server [~]# rake simplelog:install
You should now get a message that rake tasks have been completed if the install was successful.
Just one last step before we can start blogging using Simplelog. Since we’ve put Simplelog somewhere other than in our public_html folder, we need to create a symbolic link to the public folder of Simplelog so that visitors will see something when they reach our website.
This next step will delete all of the data that currently resides in your public_html directory. Make sure to make a complete backup of public_html before continuing with the next step!
While still logged in to our server via SSH, we’re going to cd back to our home directory:
username@Server [~]# cd ../..
After making a complete backup of our public_html folder we’ll run the following commands:
rm -rf ~/public_html
ln -sf ~/rails/simplelog/public ~/public_html
There, now we can log out of our server and visit our website (http://yourdomain.com/) to make sure that everything went as it should. The first time that you visit your Simplelog install, it will take a little longer than normal for your site to load. This is because Simplelog is running through FCGI, so the extra load time is to wait for the dispatch.fcgi process to start up. After a brief wait you should see the default template for Simplelog show up and now you can visit http://yourdomain.com/admin and log in using the default email/password for Simplelog: Email: temp@email.com/Password: !@gonow (make sure to change this when you log in for the first time).
Now we’re all set to start blogging!
This article is merely a guide. If you’re having problems getting Simplelog installed properly, please visit the Simplelog Wiki or the Simplelog Forums for more help and support.