<?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>Supporting Open Source weblog: Tag typo</title>
    <link>http://blog.sos.be/articles/tag/typo?tag=typo</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Startup script for Typo</title>
      <description>&lt;p&gt;This is an init script you can use so that typo will be started after an system reboot. Using &lt;code&gt;chkconfig&lt;/code&gt;, it wil be activated in the runlevel system (&lt;code&gt;/etc/rc[0-6].d&lt;/code&gt;)&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://blog.sos.be/articles/2007/02/02/installing-typo-with-the-installer"&gt;Also see: Installing typo with the installer&lt;/a&gt;&lt;/p&gt;


&lt;pre&gt;
#!/bin/bash
#
#       /etc/rc.d/init.d/typo_sos
#
# Start typo blogging engine
#
# chkconfig: - 65 35
# description: Typo blogging engine
# processname: typo
# Source function library.
. /etc/init.d/functions

TYPO=/usr/bin/typo
TYPODIR=/var/www/your-website-directory/blog

test -x $TYPO || exit 0

RETVAL=0
prog="Typo blogging engine" 

start() {
        echo -n $"Starting $prog: " 
        cd $TYPODIR
        $TYPO start $TYPODIR
        RETVAL=$?
        echo
}

stop() {
        echo -n $"Stopping $prog: " 
        cd $TYPODIR
        $TYPO stop $TYPODIR
        RETVAL=$?
        echo
}

#
#       See how we were called.
#
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        stop
        start
        RETVAL=$?
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart}" 
        exit 1
esac

exit $RETVAL
&lt;/pre&gt;&lt;h3&gt;chkconfig&lt;/h3&gt;


	&lt;p&gt;On fedora you can use &lt;code&gt;chkconfig&lt;/code&gt; to activate the startup script. Please also read the &lt;code&gt;chkconfig&lt;/code&gt; man page.&lt;/p&gt;


To be manageable by chkconfig, the script needs a special section, an example follows:
&lt;pre&gt;
# chkconfig: - 65 35
# description: Typo blogging engine
# processname: typo
&lt;/pre&gt;

Active? And in wich runlevels?
&lt;pre&gt;
chkconfig --list typo_sos
service typo_sos supports chkconfig, but is not referenced in any runlevel (run 'chkconfig --add typo_sos')
&lt;/pre&gt;

So it is added, but not yet activated:
&lt;pre&gt;
chkconfig --add typo_sos
chkconfig --list typo_sos
typo_sos        0:off   1:off   2:off   3:off   4:off   5:off   6:off
&lt;/pre&gt;

	&lt;p&gt;And, to activate:&lt;/p&gt;


&lt;pre&gt;
chkconfig typo_sos on

chkconfig --list typo_sos
typo_sos        0:off   1:off   2:on    3:on    4:on    5:on    6:off
&lt;/pre&gt;</description>
      <pubDate>Mon, 26 Mar 2007 08:30:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:d26399ea-6f48-481e-a78e-bda4eb692153</guid>
      <author>Paul Verreth</author>
      <link>http://blog.sos.be/articles/2007/03/26/startup-script-for-typo</link>
      <category>quick refs</category>
      <category>typo</category>
      <category>rails</category>
      <category>linux</category>
    </item>
    <item>
      <title>Installing typo with the installer</title>
      <description>&lt;p&gt;(&lt;a href="http://blog.sos.be/articles/2007/01/17/typo-installeren-met-de-installer"&gt;De nederlandse versie van dit artikel&lt;/a&gt;)&lt;/p&gt;


	&lt;p&gt;The most recent version (4.0.3) of typo has a gem based installer included. Installing the typo weblog server is now fairly easy to do.&lt;/p&gt;&lt;p&gt;See also: &lt;a href="http://scottstuff.net/blog/articles/2006/07/23/typo-installer"&gt;ScottStuff&lt;/a&gt;&lt;/p&gt;


&lt;pre&gt;
gem install typo --include-dependencies

typo install directory bind-address=127.0.0.1 port-number=3010 database=mysql
db_name=xxx db_user=xxx db_password=xxx
&lt;/pre&gt;

	&lt;p&gt;For installing typo: &lt;code&gt;typo install directory var1=val1 var2=val2 ...&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;To modify the config: &lt;code&gt;typo config directory var1=val1 var2=val2 ...&lt;/code&gt;&lt;/p&gt;


&lt;hr/&gt;

	&lt;p&gt;&lt;strong&gt;But attention:&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;Modification for the database params, as mentioned above, have no effect. You need to change them manually in the rails database config:&lt;/em&gt; &lt;code&gt;/path/to/typo/config/database.yml&lt;/code&gt;&lt;/p&gt;


&lt;hr/&gt;

	&lt;p&gt;For displaying the current config: &lt;code&gt;typo config directory&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;Wich gives the following result, and at once the possible parameters:&lt;/p&gt;


&lt;pre&gt;
typo config typo

database=mysql
db_name=typo
db_user=xxx
db_password=xxx
port-number=xxx
rails-environment=production
threads=2
web-server=mongrel
&lt;/pre&gt;

Other useful options/variables are:
&lt;pre&gt;
bind-address
url-prefix
&lt;/pre&gt;

	&lt;h2&gt;To start and to stop:&lt;/h2&gt;


&amp;nbsp;
&lt;pre&gt;
typo start /path/to/typo

typo stop /path/to/typo
&lt;/pre&gt;</description>
      <pubDate>Fri, 02 Feb 2007 22:05:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:9ede8578-44c5-4fc5-9671-d2538f7fb2fe</guid>
      <author>Paul Verreth</author>
      <link>http://blog.sos.be/articles/2007/02/02/installing-typo-with-the-installer</link>
      <category>artikels</category>
      <category>typo</category>
    </item>
    <item>
      <title>Typo: probleem met de google sitemap</title>
      <description>&lt;p&gt;Om je website optimaal te laten scoren in google is het aangewezen om een &lt;a href="https://www.google.com/webmasters/tools/docs/en/protocol.html"&gt;google sitemap&lt;/a&gt; in te dienen.&lt;/p&gt;


	&lt;p&gt;Bij typo wordt deze sitemap automatisch gegenereerd, maar blijkbaar is er iets mis met het formaat. Was google vroeger misschien minder streng?&lt;/p&gt;


	&lt;p&gt;Het formaat is nochtans duidelijk:&lt;/p&gt;&lt;pre&gt;
&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
  &amp;lt;urlset xmlns="http://www.google.com/schemas/sitemap/0.84"&amp;gt;
   &amp;lt;url&amp;gt;
    &amp;lt;loc&amp;gt;http://www.example.com/&amp;lt;/loc&amp;gt;
    &amp;lt;lastmod&amp;gt;2005-01-01&amp;lt;/lastmod&amp;gt;
    &amp;lt;changefreq&amp;gt;monthly&amp;lt;/changefreq&amp;gt;
    &amp;lt;priority&amp;gt;0.8&amp;lt;/priority&amp;gt;
   &amp;lt;/url&amp;gt;  
  &amp;lt;/urlset&amp;gt; 
&lt;/pre&gt;

	&lt;h4&gt;Oplossing&lt;/h4&gt;


	&lt;p&gt;In &lt;code&gt;/app/views/xml/&lt;/code&gt; (rails) van typo, staan 4 xml-generators met de naam &lt;code&gt;_googlesitemap_item_*.xml&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;In al die bestanden moeten volgende wijzigingen gebeuren:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;code&gt;xml.item&lt;/code&gt; moet worden &lt;code&gt;xml.url&lt;/code&gt;&lt;/li&gt;
		&lt;li&gt;&lt;code&gt;xml.link&lt;/code&gt; moet worden &lt;code&gt;xml.loc&lt;/code&gt;&lt;/li&gt;
	&lt;/ul&gt;


&lt;code&gt;_googlesitemap_item_article.rxml&lt;/code&gt; zal er dus zo uitzien:

&lt;pre&gt;xm.url do
  xm.loc post_link(item)
  xm.lastmod item.updated_at.xmlschema
  xm.priority 0.8
end
&lt;/pre&gt;

	&lt;p&gt;Als alle 4 de files zijn aangepast, doen moet je enkel de cache ledigen. (admin -&amp;gt; settings -&amp;gt; &amp;#8220;Rebuild cached &lt;span class="caps"&gt;HTML&lt;/span&gt;&amp;#8221;).&lt;/p&gt;</description>
      <pubDate>Tue, 23 Jan 2007 15:59:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:7c7b3336-8301-47bb-9b2f-dc41bc61585e</guid>
      <author>Paul Verreth</author>
      <link>http://blog.sos.be/articles/2007/01/23/typo-probleem-met-de-google-sitemap</link>
      <category>artikels</category>
      <category>tips</category>
      <category>typo</category>
      <category>rails</category>
      <category>web</category>
    </item>
    <item>
      <title>Typo installeren met de installer</title>
      <description>&lt;p&gt;(&lt;a href="http://blog.sos.be/articles/2007/02/02/installing-typo-with-the-installer"&gt;English version of this article&lt;/a&gt;)&lt;/p&gt;


	&lt;p&gt;De recentste versie van typo heeft een installer functionaliteit. Opzetten van een typo blogserver is daardoor in een mum van tijd te doen.&lt;/p&gt;&lt;p&gt;Zie ook: &lt;a href="http://scottstuff.net/blog/articles/2006/07/23/typo-installer"&gt;ScottStuff&lt;/a&gt;&lt;/p&gt;


&lt;pre&gt;
gem install typo --include-dependencies

typo install directory bind-address=127.0.0.1 port-number=3010 database=mysql
db_name=xxx db_user=xxx db_password=xxx
&lt;/pre&gt;

	&lt;p&gt;Typo kan geïnstalleerd worden door &lt;code&gt;typo install directory var1=val1 var2=val2 ...&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Zie ook:&lt;/strong&gt; De rails-app-installer gem.&lt;/p&gt;


	&lt;p&gt;De configuratie aanpassen gebeurt met &lt;code&gt;typo config directory var1=val1 var2=val2 ...&lt;/code&gt;&lt;/p&gt;


&lt;hr/&gt;

	&lt;p&gt;&lt;strong&gt;Maar opgelet:&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;Wijzigingen aan de database-instellingen, zoals hierboven beschreven, hebben geen effect. Die moeten manueel worden aangepast in de rails databankconfiguratie:&lt;/em&gt; &lt;code&gt;/path/to/typo/config/database.yml&lt;/code&gt;&lt;/p&gt;


&lt;hr/&gt;

	&lt;p&gt;De huidige configuratie opvragen gebeurt als volgt: &lt;code&gt;typo config directory&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;Het resultaat hiervan zie je hieronder, en geeft ook een overzicht van de verschillende opties::&lt;/p&gt;


&lt;pre&gt;
typo config typo

database=mysql
db_name=typo
db_user=xxx
db_password=xxx
port-number=xxx
rails-environment=production
threads=2
web-server=mongrel
&lt;/pre&gt;

Andere configuratie opties/variabelen zijn:
&lt;pre&gt;
bind-address
url-prefix
&lt;/pre&gt;

	&lt;h2&gt;Starten en stoppen&lt;/h2&gt;


&amp;nbsp;
&lt;pre&gt;
typo start /path/to/typo

typo stop /path/to/typo
&lt;/pre&gt;</description>
      <pubDate>Wed, 17 Jan 2007 20:50:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:1afcac7c-1a80-41f4-949e-350d031c47cf</guid>
      <author>Paul Verreth</author>
      <link>http://blog.sos.be/articles/2007/01/17/typo-installeren-met-de-installer</link>
      <category>typo</category>
      <category>rails</category>
      <category>web</category>
    </item>
  </channel>
</rss>
