Installing mephisto
February 17th, 2007
Installing mephisto is a straightforward process but can be a little challenging if you are new to web development(remember z’Grunt is also new as well) or new to working in a terminal.
My current host that I am using, who I plan to use for a long time because of the awesome service and helpful forum, is hostingrails.com. I assume that most shared hosting services come with a ‘control panel’ where you can graphically create mysql databases. Here is what I did…
Create the database- Go to your mysql icon in your control panel and create a database. You can title it mephisto if you’d like.
- Now, create a user and password with all the necessary permissions and add this user to your newly created mephisto database.
- Take note of the user name and database name that was created. Some hosting companies append your login name to the username and database name
Create a subdomain (optional) ##This is pretty straight forward. Just go to the add subdomain option and create a place holder for your blog. so you can have myphisto.myhotsauce.com if you like, or skip this step if you plan on using your main domain name.
Downloading mephisto- Log into your web account via a terminal window. In my case, I need to ssh (“secure shell”) login to my account. If you don’t currently have ssh, you can download putty if your on a windows machine. I am using a mac so ssh capability comes built-in. ssh is basically a secure way to communicate information to another computer. The ip number to use should be found in your account details. The command i type is “ssh username@ip-number”
- Once logged in, create a directory by typing ‘mkdir mephisto’. You can use whatever name you like.
- Now lets download the latest version of mephisto. You can find the latest version by going here As of now, the latest version is 0.7.3. Grab it by typing this: “svn co http://svn.techno-weenie.net/projects/mephisto/tags/rel-0.7.3 mephisto” What this does is it downloads mephisto and places it in your mephisto directory that you just created in step 2.
- Now you will make some configurations. type ‘cd mephisto’ and type ‘ls’. You will now see all the directories for mephisto. In there you will see a folder titled config. type ‘cd config’. Now remember when the Grunt said to take note of your database and database user? here is where we will use it. Open the file database.yml by using a terminal editor. In my case all i needed to do was type “pico database.yml”. In this file, you can delete everything except for the production and the lines of code underneath it. You can use ‘control k’ to cut the lines faster and when your finshed editing the file, just use control x and save.
production:adapter: mysql
database: databasename
username: username
password: password
host: localhost
- Next open the environment.rb file and delete the pound symbol in front of ”#ENV[‘RAILS_ENV’] ||= ‘production’”
- Now that is done, go back up 1 directory by typing ‘cd ..’
- Option, if your host is not using the latest rails 1.2, you may need to freeze it by typing “rake rails:freeze:edge”.
- Once that is complete, go to your public directory by typing ‘cd public’. Type “whereis ruby” and take note where ruby is installed in your hosting service. In my case, ruby is installed at /usr/local/bin/ruby. Type “pico dispatch.cgi”. In the file you will see a #!/opt/local/bin/ruby…change this to where ruby is installed on your machine, in my case #!/usr/local/bin/ruby.
- Next open the .htaccess file and change this line of code “RewriteRule ^(.)$ dispatch.cgi [QSA,L]” to “RewriteRule ^(.)$ dispatch.fcgi [QSA,L]” and comment out the line of code that says ’# AddHandler fastcgi-script .fcgi’. save and exit
- Type this as well in the public folder to make sure the dispatch files have the correct permissions, ” chmod 755 disp*”
- Now go back up to your mephisto root directory(cd.. if you forgot how to move up) and type “rake RAILS_ENV=production db:bootstrap” . This now creates all the tables in your database that your mephisto blog will be using. If you run into any errors, most likely you entered the incorrect information in your database.yml file, or didn’t add the correct permissions to the user.
- Now, if you are installing mephisto on a subdomain, go to your public_html directory in your home folder. Delete the symlink that was created for your subdomain. If you choose mephisto as a subdomain, just type “del mephisto”.
- Now create the simlink to your mephisto blog by typing ‘ln -s ~/mephisto/public ~/public_html/mephisto’. What this does is that when someone visits mephisto.mypage.com, it will go to your mephisto blog page.
Now point your browser to your url like mephisto.myhotsuace.com and all should be well.
This may seem like alot of steps but really its not that much. As you get more comfortable working in a terminal, it becomes easy to configure things in rails. Hope this helps anyone and if there are mistakes here, please drop me a message so I can improve it. Thanks!