<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Ruby Asylum: Tag 1</title>
    <link>http://www.rubyasylum.com/articles_controller.rb/tag?tag=1</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>A place for those crazy about Ruby</description>
    <item>
      <title>Typo Installation (Shared cPanel Servers)</title>
      <description>&lt;p&gt;&lt;em&gt;This version of Typo requires FastCGI and Rails version 1.1.  The current servers that this will work on are Gallifrey and Telos.&lt;/em&gt;&lt;/p&gt;
 
&lt;p&gt;A. Creating your database for Typo:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Log into cPanel and click on &lt;strong&gt;MySQL Databases&lt;/strong&gt; icon:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/mysqldatabases.gif" alt="MySQL Databases" /&gt;&lt;/center&gt;
&lt;li&gt;As per the example below, enter &lt;span style="color:red"&gt;typo&lt;/span&gt; in the "New Database" field under &lt;em&gt;Current Databases&lt;/em&gt; area, then click "Create Database" button.  Your full database name will then show as &lt;span style="color:red"&gt;cPaneluser_typo&lt;/span&gt;.&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/currentdatabases.gif" alt="Curent Databases" /&gt;&lt;/center&gt;
&lt;li&gt;Under &lt;em&gt;Current Users&lt;/em&gt; area as seen in the example below, enter &lt;span style="color:red"&gt;typo&lt;/span&gt; for the "Username" field and enter a password that you write in your notes for the "Password" field, then click "Create User" button.  Your full database user's name will then show as &lt;span style="color:red"&gt;cPaneluser_typo&lt;/span&gt;.&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/currentusers.gif" alt="Curent Users" /&gt;&lt;/center&gt;
&lt;li&gt;Under &lt;em&gt;Add Users to Your Database&lt;/em&gt; area as shown below, select in the "User" dropdown &lt;span style="color:red"&gt;cPaneluser_typo&lt;/span&gt; and select in the "Database" dropdown &lt;span style="color:red"&gt;cPaneluser_typo&lt;/span&gt;, then click "Add User to Database" button.&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/adduserstoyourdatabases.gif" alt="Add Users to Your Databases" /&gt;&lt;/center&gt;
&lt;/ol&gt;
&lt;/p&gt;

&lt;p&gt;B. Get a Copy of typo.tar.gz&lt;/p&gt;

&lt;p&gt;Download a copy of the current release (svn copy) from &lt;a href="http://rubyasylum.com/typo.tar.gz"&gt;here&lt;/a&gt;.  After obtaining a copy that you have saved to your system, you can then proceed with the next steps.&lt;/p&gt;

&lt;p&gt;C. Upload Typo Using cPanel:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Log into cPanel.&lt;/li&gt;
&lt;li&gt;Click on "File Manager" icon:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/filemanager.gif" alt="File Manager" /&gt;&lt;/center&gt;
&lt;li&gt;A new window will open. In that new window, click on "Upload File(s)" link toward the top:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/uploadfiles.gif" alt="Upload File(s)" /&gt;&lt;/center&gt;&lt;br /&gt;
&lt;li&gt;The page will load new content.  Click one of the "Browse..." buttons:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/browse.gif" alt="Browse" /&gt;&lt;/center&gt;&lt;br /&gt;
&lt;li&gt;The Windows "File Upload" dialog prompt will open. Navigate to where you saved &lt;strong&gt;typo.tar.gz&lt;/strong&gt; on your system, highlight &lt;strong&gt;typo.tar.gz&lt;/strong&gt;, then click the "Open" button.&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/fileupload.gif" alt="File Upload" /&gt;&lt;/center&gt;&lt;br /&gt;
&lt;li&gt;Back at the File Manager screen where you have the "Browse..." button, click the "Upload" button:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/upload.gif" alt="Upload button" /&gt;&lt;/center&gt;&lt;br /&gt;
&lt;li&gt;Typo will begin uploading.  Please note that it might take awhile for it to upload due to the size, usually around 3-15 minutes depending on your connection speed.&lt;/li&gt;
&lt;/ol&gt;
&lt;/p&gt;

&lt;p&gt;D. Upload Typo via FTP:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;If you prefer to use FTP to upload so you see the progress of the file upload, try the following instead&lt;/em&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Open your FTP client and access your account via FTP with most clients using the following to connect:&lt;br /&gt;
&lt;strong&gt;Host/Address:&lt;/strong&gt; domain.com&lt;br /&gt;
&lt;strong&gt;Username:&lt;/strong&gt; cPanelusername&lt;br /&gt;
&lt;strong&gt;Password:&lt;/strong&gt; cPanelpassword&lt;br /&gt;&lt;/li&gt;

&lt;li&gt;Highlight the file &lt;strong&gt;typo.tar.gz&lt;/strong&gt; on your system where you saved it and right click.&lt;/li&gt;
&lt;li&gt;Select upload (it needs to be uploaded to your main directory not inside public_html folder, so you should be at the level where you see public_html listed as a folder)&lt;/li&gt;
&lt;li&gt;Wait for the file to complete uploading.&lt;/li&gt;
&lt;li&gt;You can view an image of what Filezilla FTP client would look like for this process at &lt;a href="http://rubyasylum.com/images/filezillaftp.gif"&gt;this location&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;/p&gt;

&lt;p&gt;E. Extracting Typo:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Log into cPanel if you aren't already logged into it.&lt;/li&gt;
&lt;li&gt;Click on "File Manager" icon if you aren't already in there:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/filemanager.gif" alt="File Manager" /&gt;&lt;/center&gt;
&lt;li&gt;A new window will open for File Manager, then click on the &lt;strong&gt;typo.tar.gz&lt;/strong&gt; file name (not the icon):&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/typotargz.gif" alt="Typo File" /&gt;&lt;/center&gt;&lt;br /&gt;
&lt;li&gt;In the upper right hand corner, there are a list of links.  Select "Extract File Contents" link in that list:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/extractfilecontents.gif" alt="Extract File Contents" /&gt;&lt;/center&gt;&lt;br /&gt;
&lt;li&gt;A new window will open with the extracted files and folders listed as the extraction processes.  Wait until this finishes (will say Done at the bottom left of most browsers once completed), then close the new window.&lt;/li&gt;
&lt;li&gt;In the File Manager window, refresh your browser.  You should now see a folder called &lt;strong&gt;typo&lt;/strong&gt; there:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/typofolder.gif" alt="Typo Folder" /&gt;&lt;/center&gt;
&lt;/ol&gt;
&lt;/p&gt;

&lt;p&gt;F. Changing the database.yml file for your database details:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;In File Manager, click on the folder icon to the left of the &lt;strong&gt;typo&lt;/strong&gt; folder:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/typofoldericon.gif" alt="Typo Folder Icon" /&gt;&lt;/center&gt;&lt;br /&gt;
&lt;li&gt;Click on the folder icon to the left of the &lt;strong&gt;config&lt;/strong&gt; folder:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/configfoldericon.gif" alt="Config Folder Icon" /&gt;&lt;/center&gt;&lt;br /&gt;
&lt;li&gt;Click on the &lt;strong&gt;database.yml&lt;/strong&gt; file name (not the icon):&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/databaseymlfile.gif" alt="database.yml File" /&gt;&lt;/center&gt;&lt;br /&gt;
&lt;li&gt;In the upper right hand corner, click on "Edit File" link as shown below.&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/editfile.gif" alt="Edit File" /&gt;&lt;/center&gt;&lt;br /&gt;
&lt;li&gt;A new window will open with the following in it:&lt;br /&gt;
&lt;code&gt;login: &amp;login&lt;br /&gt;
  adapter: mysql&lt;br /&gt;
  host: localhost&lt;br /&gt;
  username: cPaneluser_typo&lt;br /&gt;
  password: database user pass here&lt;br /&gt;
&lt;br /&gt;
development:&lt;br /&gt;
  database: cPaneluser_typo&lt;br /&gt;
  &lt;&lt;: *login&lt;br /&gt;
&lt;br /&gt;
test:&lt;br /&gt;
  database: cPaneluser_tests&lt;br /&gt;
  &lt;&lt;: *login&lt;br /&gt;
&lt;br /&gt;
production:&lt;br /&gt;
  database: cPaneluser_typo&lt;br /&gt;
  &lt;&lt;: *login&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;
&lt;li&gt;Replace &lt;span color="color:red"&gt;cPaneluser&lt;/span&gt; with your cpanel username (there are 4 instances of this on lines 4, 8, 12 and 16).  Do not remove the &lt;span style="color:red"&gt;_typo&lt;/span&gt; or &lt;span style="color:red"&gt;_tests&lt;/span&gt; part.  For example, I would replace &lt;span style="color:red"&gt;cPaneluser_typo&lt;/span&gt; with &lt;span style="color:red"&gt;rubyasyl_typo&lt;/span&gt; for my rubyasylum.com account.&lt;/li&gt;
&lt;li&gt;In the &lt;span style="color:red"&gt;password:&lt;/span&gt; line (line 5), input the password you used when creating your database user earlier.&lt;/li&gt;
&lt;li&gt;Click the "Save" button, then close that window (keep the File Manager Window open though).&lt;/li&gt;
&lt;/ol&gt;
&lt;/p&gt;

&lt;p&gt;G. Importing the database:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;In File Manager, click on the "Up one level" link toward the top to go back to the main &lt;strong&gt;typo&lt;/strong&gt; folder:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/uponelevel.gif" alt="Up one level" /&gt;&lt;/center&gt;&lt;br /&gt;
&lt;li&gt;Click on the folder icon to the left of the &lt;strong&gt;db&lt;/strong&gt; folder:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/dbfoldericon.gif" alt="Db Folder Icon" /&gt;&lt;/center&gt;&lt;br /&gt;
&lt;li&gt;Click on the &lt;strong&gt;schema.mysql-v3.sql&lt;/strong&gt; file name (not the icon):&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/schemamysqlv3sqlfile.gif" alt="schema.mysql-v3.sql File" /&gt;&lt;/center&gt;&lt;br /&gt;
&lt;li&gt;In the upper right hand corner, click on the "Show File" link:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/showfile.gif" alt="Show File" /&gt;&lt;/center&gt;&lt;br /&gt;
&lt;li&gt;A new window will open.  Copy the contents of that file from the &lt;span style="color:red"&gt;--This file is autogenerated by the Rail schema generator, using&lt;/span&gt; line to the bottom of the file.  Paste those contents into notepad or some note program (do not use MS Word).&lt;/li&gt;
&lt;li&gt;Close the File Edit Window and Close File Manager Window.&lt;/li&gt;
&lt;li&gt;Back in the main cPanel area, click on "MySQL Databases" icon:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/mysqldatabases.gif" alt="MySQL Databases" /&gt;&lt;/center&gt;
&lt;li&gt;Sroll to the bottom of that area, then click on the "phpMyAdmin" link, which opens a new window:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/phpmyadmin.gif" alt="phpMyAdmin" /&gt;&lt;/center&gt;&lt;br /&gt;
&lt;li&gt;In the new window, click on the name of your database (should be &lt;span style="color:red"&gt;cPaneluser_typo&lt;/span&gt; where &lt;span style="color:red"&gt;cPaneluser&lt;/span&gt; is your cPanel username) on the left hand side:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/phpmyadmin-dbselection.gif" alt="phpMyAdmin Database Selection" /&gt;&lt;/center&gt;&lt;br /&gt;
&lt;li&gt;In the top center, click on the "SQL" tab:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/sqltab.gif" alt="SQL Tab" /&gt;&lt;/center&gt;&lt;br /&gt;
&lt;li&gt;Take the Notepad contents that you copied above in this section Step 3, then paste all of that into the &lt;strong&gt;Run SQL query/queries on database box&lt;/strong&gt; in phpMyAdmin:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/runsqlquery.gif" alt="Run SQL Query/Queries on Database Box" /&gt;&lt;/center&gt;&lt;br /&gt;
&lt;li&gt;Click the "Go" button:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/sql-gobutton.gif" alt="SQL Go Button" /&gt;&lt;/center&gt;&lt;br /&gt;
&lt;li&gt;Close out of the phpMyAdmin window.&lt;/li&gt;
&lt;/ol&gt;
&lt;/p&gt;

&lt;p&gt;H. Symlinking your folder to typo:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;In cPanel main area, click on "Cron Jobs" icon:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/cronjobs.gif" alt="Cron Jobs" /&gt;&lt;/center&gt;
&lt;li&gt;Click "Advanced (Unix Style)" button:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/cronjobs-advancedunix.gif" alt="Advanced (Unix Style) Button" /&gt;&lt;/center&gt;
&lt;li&gt;Enter the following as an example in the Advanced area:&lt;br /&gt;
&lt;pre style="font-size:12px"&gt;Minute Hour Day Month Weekday
10     7    *   *     * &lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;This would run the cron at 7:10am Pacific time each day of the week.  Change the &lt;span style="color:red"&gt;10&lt;/span&gt; to a time 5 minutes from the current hour (so if it is currently 11:27am, change to &lt;span style="color:red"&gt;32&lt;/span&gt; for the Minute).  Change the hour to the current hour (so if it is currently 11:27am, change to &lt;span style="color:red"&gt;11&lt;/span&gt;).&lt;/li&gt; 
&lt;li&gt;Enter the following for the Command field:&lt;br /&gt;
&lt;pre style="font-size:12px"&gt;cd /home/username/public_html &amp;&amp; ln -s ../typo/public typo&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Replace &lt;span style="color:red"&gt;username&lt;/span&gt; in the command path with your cPanel username, then click "Commit changes" button.  See the image below for an example of what the area might look like before you click that button:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/cronjobs-symlink.gif" alt="Cron Jobs Advanced Screen" /&gt;&lt;/center&gt;&lt;br /&gt;
&lt;li&gt;After you click "Commit changes" button, then click the Go Back link on the new screen:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/goback.gif" alt="Go Back link" /&gt;&lt;/center&gt;&lt;br /&gt;
&lt;li&gt;Wait for the cron job to process (around 10 minutes after you created it), then delete the cron using the "Delete" link to the far right of it in the "Advanced (Unix Style)" area:
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/delete.gif" alt="Delete" /&gt;&lt;/center&gt;&lt;br /&gt;
Please note that it is &lt;span style="color:red; font-weight:bold"&gt;very&lt;/span&gt; important that you perform this delete step so this cron does not keep running daily as you only want it to run this one time for the symlink creation.&lt;/li&gt;
&lt;li&gt;You can check if the symlink actually worked by going into "File Manager" area, clicking on the folder icon next to &lt;strong&gt;public_html&lt;/strong&gt;, then on the folder icon next to the new &lt;strong&gt;typo&lt;/strong&gt; folder that should now be in public_html folder.  It should have the same contents that &lt;strong&gt;/home/username/typo/public&lt;/strong&gt; does.&lt;/li&gt;
&lt;/ol&gt;
&lt;/p&gt;

&lt;p&gt;I. Running rake migrate in cron:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;In cPanel main area, click on "Cron Jobs" icon again:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/cronjobs.gif" alt="Cron Jobs" /&gt;&lt;/center&gt;
&lt;li&gt;Click "Advanced (Unix Style)" button:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/cronjobs-advancedunix.gif" alt="Advanced (Unix Style) Button" /&gt;&lt;/center&gt;
&lt;li&gt;Enter the following as an example in the Advanced area:&lt;br /&gt;
&lt;pre style="font-size:12px"&gt;Minute Hour Day Month Weekday
10     7    *   *     * &lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;As before, this would run the cron at 7:10am Pacific time each day of the week.  Change the &lt;span style="color:red"&gt;10&lt;/span&gt; to a time 5 minutes from the current hour (so if it is currently 11:27am, change to &lt;span style="color:red"&gt;32&lt;/span&gt; for the Minute).  Change the hour to the current hour (so if it is currently 11:27am, change to &lt;span style="color:red"&gt;11&lt;/span&gt;).&lt;/li&gt; 
&lt;li&gt;Enter the following for the Command field:&lt;br /&gt;
&lt;pre style="font-size:12px"&gt;cd /home/username/typo &amp;&amp; /usr/local/bin/rake migrate&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Replace &lt;span style="color:red"&gt;username&lt;/span&gt; in the command path with your cPanel username, then click "Commit changes" button.&lt;/li&gt;
&lt;li&gt;After you click "Commit changes" button, then click the Go Back link on the new screen:&lt;/li&gt;
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/goback.gif" alt="Go Back link" /&gt;&lt;/center&gt;&lt;br /&gt;
&lt;li&gt;Wait for the cron job to process (around 10 minutes after you created it), then delete the cron using the "Delete" link to the far right of it in the "Advanced (Unix Style)" area:
&lt;center&gt;&lt;img src="http://rubyasylum.com/images/delete.gif" alt="Delete" /&gt;&lt;/center&gt;&lt;br /&gt;
Please note that it is &lt;span style="color:red; font-weight:bold"&gt;very&lt;/span&gt; important that you perform this delete step so this cron does not keep running daily as you only want it to run this one time for the database migration.&lt;/li&gt;
&lt;/ol&gt;
&lt;/p&gt;

&lt;p&gt;J. Loading up Typo in a browser:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Now you can load up your Typo script in a browser using &lt;a href="http://yourdomain.com/typo/"&gt;http://yourdomain.com/typo/&lt;/a&gt; (replace yourdomain.com with your actual domain name).&lt;/li&gt;
&lt;li&gt;If th rake migrate cron job in Section I failed, you would see a MySQL error about &lt;strong&gt;cPaneluser_typo.triggers&lt;/strong&gt;.  If you are unable to get the rake migrate cron to process for you, please open a ticket to &lt;a href="mailto:support@lunarpages.com"&gt;support@lunarpages.com&lt;/a&gt; with the last 4 digits of your credit card on file with us or the billing address, zip code, telephone number and the first and last characters of your cPanel password for confirmation along with the request to run &lt;span style="color:red"&gt;rake migrate&lt;/span&gt; from your &lt;strong&gt;/home/username/typo&lt;/strong&gt; folder. Please ensure you provide your cPanel username in the ticket and the url for typo in a browser that is returning the error (so &lt;a href="http://yourdomain.com/typo/"&gt;http://yourdomain.com/typo/&lt;/a&gt; where yourdomain.com should be replaced by your actual domain name).  This way once we run the command we will know if the script is working as we will be able to test the Typo page in a browser.&lt;/li&gt;
&lt;li&gt;Once the command has been processed (by your cron or by us running the command), you should then see the Signup screen where you can pick your login details and password for the administrative area.  The administrative area will be at &lt;a href="http://yourdomain.com/typo/admin"&gt;http://yourdomain.com/typo/admin/&lt;/a&gt;, while your site blog will be at &lt;a href="http://yourdomain.com/typo/"&gt;http://yourdomain.com/typo/&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/p&gt;

&lt;p&gt;Have fun blogging!&lt;/p&gt;</description>
      <pubDate>Fri, 02 Jun 2006 08:53:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:20fa3187-0a84-460a-90b6-59ddaa055cdf</guid>
      <author>Miraenda</author>
      <link>http://www.rubyasylum.com/articles/2006/06/02/installing-typo-on-shared-linux-cpanel-servers</link>
      <category>Shared Server Tutorials</category>
      <category>svn</category>
      <category>1</category>
      <category>shared</category>
      <category>install</category>
      <category>installation</category>
      <category>typo</category>
      <category>rails</category>
      <trackback:ping>http://www.rubyasylum.com/articles/trackback/3</trackback:ping>
    </item>
  </channel>
</rss>
