<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Vita di un sys-admin &#187; wordpress</title>
	<atom:link href="http://blog.angelofailla.com/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.angelofailla.com</link>
	<description>Storie, esperienze e pensieri da Dublino.</description>
	<lastBuildDate>Sun, 14 Aug 2011 22:11:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Migliorare la pagina &#8220;archive&#8221; di WordPress.</title>
		<link>http://blog.angelofailla.com/2008/08/08/migliorare-la-pagina-archive-di-wordpress/</link>
		<comments>http://blog.angelofailla.com/2008/08/08/migliorare-la-pagina-archive-di-wordpress/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 20:43:16 +0000</pubDate>
		<dc:creator>pallotron</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Informatica]]></category>
		<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Software Libero]]></category>
		<category><![CDATA[Tempo libero]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[archive]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.angelofailla.com/?p=967&#038;langswitch_lang=en</guid>
		<description><![CDATA[E&#8217; venerdi&#8217;. Che cosa fa uno Venerdi&#8217; in Irlanda? Va a riempirsi di birra! Per poi finire cosi&#8217;: Beh io questa volta passo. Mi avevano invitato indirettamente ad un leaving party al Pravda ma ho deciso di rimanere a casa, per vari motivi, uno di questi motivi e&#8217; che mi trovavo in the middle di [...]]]></description>
			<content:encoded><![CDATA[<p>E&#8217; venerdi&#8217;. Che cosa fa uno Venerdi&#8217; in Irlanda? Va a riempirsi di birra! Per poi finire cosi&#8217;:</p>
<p><a href="http://blog.angelofailla.com/wp-content/uploads/2008/08/drunk-man-falls-hurts-head-hoboken.jpg"><img class="aligncenter size-full wp-image-968" title="drunk-man-falls-hurts-head-hoboken" src="http://blog.angelofailla.com/wp-content/uploads/2008/08/drunk-man-falls-hurts-head-hoboken.jpg" alt="" width="420" height="300" /></a></p>
<p>Beh io questa volta passo. <img src='http://blog.angelofailla.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
Mi avevano invitato indirettamente ad un leaving party al Pravda ma ho deciso di rimanere a casa, per vari motivi, uno di questi motivi e&#8217; che mi trovavo in the middle di una sezione di hacking molto proficua di wordpress.</p>
<p>Ieri sera ero in chat con una amica che vuole trasferirsi, e le ho detto di consultare il blog per consigli, scorrendo le pagine mi sono ricordato di cose successe anni fa, e anche di curiosi foto ritocchi, specie gli ultimi post prima di partire. <img src='http://blog.angelofailla.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Questa situazione mi e&#8217; servita da inpulso oggi pomeriggio, mentre ero al lavoro, per installare, fra un cosa e l&#8217;altra da fare, un nuovo plug-in per la pagina <a href="/archive/">archive</a>. Si chiama <a href="http://justinblanton.com/projects/smartarchives/">smartarchives</a>.</p>
<p>Che cos&#8217;e'? Niente di meglio della descrizione sulla home page ufficiale:</p>
<blockquote><p>Smart Archives is a rather simple <a href="http://wordpress.org/">WordPress</a> plugin that will allow you to display your archives in a much &#8220;cleaner&#8221; format.  You can see it in action on my <a href="http://justinblanton.com/archives/">archives page</a>. You&#8217;ll notice that everything on the page is hyperlinked (years, months, posts) and that all of the respective links are future-proofed.</p></blockquote>
<p>Il problema di questo plug-in e&#8217; che mantiene le stesse impostazioni del blog, quindi nel mio caso 5 post per pagina, e ordinamento discendente. Io volevo, solo per la pagina /archive/, un ordinamento normale, ascendente, e nessun limite sul numero di post. In piu&#8217; volevo anche la data accanto ad ogni post che si vede nella root page di /archive.</p>
<p>Cosa ho fatto?</p>
<p>Dopo qualche oretta di lettura di documentazione per gli sviluppatori di wordpess, che tralaltro ho trovato molto completa (rispetto a quando ho iniziato ad usare wordpress nel 2005), ho prodotto le seguenti linee di codice che ho inserito nel file functions.php del mio tema.</p>
<pre>function pallotron_nopaging($query) {
   if ( !is_home() &#038;&#038; !is_feed() &#038;&#038; '' == $query->get('nopaging') ) {
      $query->set('nopaging', 1);
      $query->set('order', 'asc');
   }
}

add_action('parse_query', 'pallotron_nopaging');</pre>
<p>Per completare l&#8217;opera ho dovuto fare anche un po&#8217; di modifiche al plugin, cambiando delle clausole di order by da DESC ad ASC (il default):</p>
<pre>ORDER BY post_date");</pre>
<p>E due cicli for che diventano cosi&#8217; (commentato la vecchia linea):</p>
<pre>//for ($currentMonth = 12; $currentMonth >= 1; $currentMonth--) {
for ($currentMonth = 1; $currentMonth <= 12; $currentMonth++) {</pre>
<p>Adesso i lettori possono navigare la pagina archive e vedere tutte le cazzate scritte da Ottobre 2005 a ora.</p>
<p>References:</p>
<p><a href="http://codex.wordpress.org/Query_Overview">http://codex.wordpress.org/Query_Overview</a><br />
<a href="http://justinblanton.com/projects/smartarchives/">http://justinblanton.com/projects/smartarchives/</a><br />
<a href="http://codex.wordpress.org/Developer_Documentation">http://codex.wordpress.org/Developer_Documentation</a><br />
<a href="http://codex.wordpress.org/Conditional_Tags">http://codex.wordpress.org/Conditional_Tags</a></p>
<img src="http://blog.angelofailla.com/?ak_action=api_record_view&id=967&type=feed" alt="" /><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.angelofailla.com%2F2008%2F08%2F08%2Fmigliorare-la-pagina-archive-di-wordpress%2F&amp;title=Migliorare%20la%20pagina%20%26%238220%3Barchive%26%238221%3B%20di%20WordPress." id="wpa2a_2"><img src="http://blog.angelofailla.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.angelofailla.com/2008/08/08/migliorare-la-pagina-archive-di-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Plugin wordpress per ordinare come si vuole i post d&#8217;archivio</title>
		<link>http://blog.angelofailla.com/2010/01/31/plugin-wordpress-per-ordinare-come-si-vuole-i-post-darchivio/</link>
		<comments>http://blog.angelofailla.com/2010/01/31/plugin-wordpress-per-ordinare-come-si-vuole-i-post-darchivio/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 23:05:04 +0000</pubDate>
		<dc:creator>pallotron</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Informatica]]></category>
		<category><![CDATA[informativa]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[web2.0]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.angelofailla.com/?p=1690&#038;langswitch_lang=en</guid>
		<description><![CDATA[Avviso ai blogghisti utilizzatori di wordpress. Dopo l&#8217;ultimo post sui due anni mi sono reso conto che wordpress di default non sia molto fruibile per leggere i post in cronologia, ho trovato questo plugin che potrebbe essere utile a molti di voi: http://moshublog.com/2007/10/30/custom-query-string-reloaded-for-wordpress-23-with-tag-support/ A chi usa ancora blogger dico solo che hanno tutta la mia [...]]]></description>
			<content:encoded><![CDATA[<p>Avviso ai blogghisti utilizzatori di wordpress.</p>
<p>Dopo l&#8217;ultimo post sui due anni mi sono reso conto che wordpress di default non sia molto fruibile per leggere i post in cronologia, ho trovato questo plugin che potrebbe essere utile a molti di voi:</p>
<p><a href="http://moshublog.com/2007/10/30/custom-query-string-reloaded-for-wordpress-23-with-tag-support/">http://moshublog.com/2007/10/30/custom-query-string-reloaded-for-wordpress-23-with-tag-support/</a></p>
<p>A chi usa ancora blogger dico solo che hanno tutta la mia compassione <img src='http://blog.angelofailla.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<img src="http://blog.angelofailla.com/?ak_action=api_record_view&id=1690&type=feed" alt="" /><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.angelofailla.com%2F2010%2F01%2F31%2Fplugin-wordpress-per-ordinare-come-si-vuole-i-post-darchivio%2F&amp;title=Plugin%20wordpress%20per%20ordinare%20come%20si%20vuole%20i%20post%20d%26%238217%3Barchivio" id="wpa2a_4"><img src="http://blog.angelofailla.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.angelofailla.com/2010/01/31/plugin-wordpress-per-ordinare-come-si-vuole-i-post-darchivio/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting up WordPress Multisite on Debian 5.0 (lenny)</title>
		<link>http://blog.angelofailla.com/2010/12/29/setting-up-wordpress-multisite-on-debian-5-0-lenny/</link>
		<comments>http://blog.angelofailla.com/2010/12/29/setting-up-wordpress-multisite-on-debian-5-0-lenny/#comments</comments>
		<pubDate>Wed, 29 Dec 2010 18:09:35 +0000</pubDate>
		<dc:creator>pallotron</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Informatica]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[multisite]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp3]]></category>

		<guid isPermaLink="false">http://blog.angelofailla.com/?p=2095</guid>
		<description><![CDATA[This post explains how to install WordPress 3.x on a Debian lenny and to set up a multisite installation on your Debian server. All the blogs will log into the same file /var/log/apache2/access.log; the first column will be the blog host and port (see the LogFormat configured below). This chapter is based on information collected [...]]]></description>
			<content:encoded><![CDATA[<p>This post explains how to install WordPress 3.x on a Debian lenny and to set up a multisite installation on your Debian server.</p>
<p>All the blogs will log into the same file <code>/var/log/apache2/access.log</code>; the first column will be the blog host and port (see the LogFormat configured below).</p>
<p>This chapter is based on information collected at http://codex.wordpress.org/Create_A_Network and in <code>/usr/share/doc/wordpress/README.Debian</code>.</p>
<p>All WordPress blogs will use the same shared PHP code in <code>/usr/share/wordpress</code>.</p>
<p><strong>Assumptions</strong></p>
<ul>
<li>Main website will be http://domain.com</li>
<li>Blogs will be under http://${blogname}.domain.com</li>
</ul>
<p>File uploaded into the main blog (www.domain.com) will be stored in <code>/srv/www/wp-uploads/domain.com/%year/%month/</code></p>
<p>Files uploaded into the <code>*.domain.com</code> blogs will be stored in <code>/usr/share/wordpress/wp-content/blogs.dir/${blog_id}/files/%year/%month/</code>, where <code>${blog_id}</code> is the numeric id of the blog, as managed by the Multisite feature.</p>
<p><strong>Configuration of Debian lenny-backports repository and installation</strong></p>
<p>WordPress 3.x is not in lenny so we have to use the backport repository.<br />
Excute this as root:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;deb http://backports.debian.org/debian-backports lenny-backports main&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>sources.list
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&lt;&lt;</span>EOF <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>preferences
Package: <span style="color: #000000; font-weight: bold;">*</span>
Pin: release <span style="color: #007800;">a</span>=lenny-backports
Pin-Priority: <span style="color: #000000;">200</span>
EOF
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> update
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #660033;">-t</span> lenny-backports <span style="color: #c20cb9; font-weight: bold;">install</span> wordpress</pre></div></div>

<p><strong>Installation of non free swf plugin</strong></p>
<p>As stated in <code>/usr/share/doc/wordpress/README.Debian</code> WordPress originally comes with a Flash-based tool that allows to upload files. However, that tool violates the Debian Policy, as stated in the<br />
bug #591195. That is why this tool is not shipped with the Debian package anymore. If you want to enable this feature, you need to install the Flash file yourself with the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">-O</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>wordpress<span style="color: #000000; font-weight: bold;">/</span>wp-includes<span style="color: #000000; font-weight: bold;">/</span>js<span style="color: #000000; font-weight: bold;">/</span>swfupload<span style="color: #000000; font-weight: bold;">/</span>swfupload.swf http:<span style="color: #000000; font-weight: bold;">//</span>core.svn.wordpress.org<span style="color: #000000; font-weight: bold;">/</span>branches<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">3.0</span><span style="color: #000000; font-weight: bold;">/</span>wp-includes<span style="color: #000000; font-weight: bold;">/</span>js<span style="color: #000000; font-weight: bold;">/</span>swfupload<span style="color: #000000; font-weight: bold;">/</span>swfupload.swf</pre></div></div>

<p><strong>Configure your DNS server</strong></p>
<p>Add the following records in your zone (I suppose you know how to deal with your DNS zone):</p>

<div class="wp_syntax"><div class="code"><pre class="bind" style="font-family:monospace;">; wp multisite
$ORIGIN        IN A       ${IP}
www            IN A       ${IP}
*.domain.com.  IN CNAME   www</pre></div></div>

<p><strong>Apache configuration</strong></p>
<p>Configure the <code>vhost_combined</code> log format in <code>/etc/apache2/apache2.conf</code> modifying the default one:</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">LogFormat</span> <span style="color: #7f007f;">&quot;%{Host}i:%p %h %l %u %t <span style="color: #000099; font-weight: bold;">\&quot;</span>%r<span style="color: #000099; font-weight: bold;">\&quot;</span> %&gt;s %O <span style="color: #000099; font-weight: bold;">\&quot;</span>%{Referer}i<span style="color: #000099; font-weight: bold;">\&quot;</span> <span style="color: #000099; font-weight: bold;">\&quot;</span>%{User-Agent}i<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span> vhost_combined</pre></div></div>

<p>Configure apache in <code>/etc/apache2/sites-available/wordpress-multisite</code> :</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">VirtualHost</span> *:<span style="color: #ff0000;">80</span>&gt;
<span style="color: #00007f;">UseCanonicalName</span>    <span style="color: #0000ff;">Off</span>
&nbsp;
<span style="color: #00007f;">ServerAlias</span> *.domain.com domain.com
<span style="color: #00007f;">ServerName</span> www.domain.com
<span style="color: #00007f;">DocumentRoot</span> /srv/www/domain.com/
&nbsp;
<span style="color: #00007f;">Options</span> <span style="color: #0000ff;">All</span>
<span style="color: #00007f;">ServerAdmin</span> you@domain.com
&nbsp;
<span style="color: #adadad; font-style: italic;"># Store uploads of www.domain.com in /srv/www/wp-uploads/$0</span>
<span style="color: #00007f;">RewriteEngine</span> <span style="color: #0000ff;">On</span>
<span style="color: #00007f;">RewriteRule</span> ^/wp-uploads/(.*)$ /srv/www/wp-uploads/%{HTTP_HOST}/$1
&nbsp;
&lt;<span style="color: #000000; font-weight:bold;">Directory</span> /&gt;
        <span style="color: #00007f;">Options</span> <span style="color: #0000ff;">FollowSymLinks</span>
        <span style="color: #00007f;">AllowOverride</span> <span style="color: #0000ff;">All</span>
&lt;/<span style="color: #000000; font-weight:bold;">Directory</span>&gt;
&nbsp;
<span style="color: #00007f;">CustomLog</span> /var/log/apache2/access.log vhost_combined
&nbsp;
<span style="color: #adadad; font-style: italic;"># this is needed when activating multisite, WP needs to to a </span>
<span style="color: #adadad; font-style: italic;"># fopen(&quot;http://randomname.domain.com&quot;) to verify</span>
<span style="color: #adadad; font-style: italic;"># that apache is correctly configured</span>
<span style="color: #00007f;">php_admin_flag</span> allow_url_fopen <span style="color: #0000ff;">on</span>
&nbsp;
&lt;/<span style="color: #000000; font-weight:bold;">VirtualHost</span>&gt;</pre></div></div>

<p>Configure <code>/etc/wordpress/htaccess</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">IfModule</span> mod_rewrite.c&gt;
<span style="color: #00007f;">RewriteEngine</span> <span style="color: #0000ff;">On</span>
<span style="color: #00007f;">RewriteBase</span> /
<span style="color: #00007f;">RewriteRule</span> ^index\.php$ - [L]
<span style="color: #adadad; font-style: italic;">## uploaded files</span>
<span style="color: #00007f;">RewriteRule</span> ^files/(.+) wp-<span style="color: #0000ff;">includes</span>/ms-files.php?file=$1 [L]
<span style="color: #adadad; font-style: italic;">## real files dealt directly</span>
<span style="color: #00007f;">RewriteCond</span> %{REQUEST_FILENAME} -f [OR]
<span style="color: #00007f;">RewriteCond</span> %{REQUEST_FILENAME} -d
<span style="color: #00007f;">RewriteRule</span> ^ - [L]
<span style="color: #adadad; font-style: italic;">## other go through index.php</span>
<span style="color: #00007f;">RewriteRule</span> . index.php [L]
&lt;/<span style="color: #000000; font-weight:bold;">IfModule</span>&gt;</pre></div></div>

<p>Enable the config executing this as root:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">a2ensite wordpress-multisite
a2enmod rewrite <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> a2enmod vhost_alias
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</pre></div></div>

<p><strong>Setting some permissions</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># required to allow the main site to upload content</span>
<span style="color: #c20cb9; font-weight: bold;">chown</span> www-data <span style="color: #000000; font-weight: bold;">/</span>srv<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">chown</span> www-data <span style="color: #000000; font-weight: bold;">/</span>srv<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># required to allow subdomains site to upload content</span>
<span style="color: #c20cb9; font-weight: bold;">chgrp</span> www-data <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>wordpress<span style="color: #000000; font-weight: bold;">/</span>wp-content<span style="color: #000000; font-weight: bold;">/</span>blogs.dir<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">chmod</span> g+<span style="color: #c20cb9; font-weight: bold;">w</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>wordpress<span style="color: #000000; font-weight: bold;">/</span>wp-content<span style="color: #000000; font-weight: bold;">/</span>blogs.dir<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># required in order to be able to install/update themes/plugins </span>
<span style="color: #666666; font-style: italic;"># from the webgui (only on the main site)</span>
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> www-data:www-data <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>wordpress<span style="color: #000000; font-weight: bold;">/</span>wp-content<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> www-data:www-data <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>wordpress<span style="color: #000000; font-weight: bold;">/</span>wp-admin<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p><strong>Creating main site</strong></p>
<p>At this stage we can create the main site using this bash script:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">bash</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>doc<span style="color: #000000; font-weight: bold;">/</span>wordpress<span style="color: #000000; font-weight: bold;">/</span>examples<span style="color: #000000; font-weight: bold;">/</span>setup-mysql <span style="color: #660033;">-n</span> main domain.com</pre></div></div>

<p>This script creates the DB &#038; tables and it also creates a file called <code>/etc/wordpress/config-domain.com.php</code>.</p>
<p>You should end up with the following files:</p>
<ul>
<li><code>/etc/wordpress/config-domain.com.php</code>
</li>
<li><code>/srv/www/domain.com</code> symlink to -> <code>/usr/share/wordpress</code>
</li>
<li><code>/srv/www/wp-uploads/domain.com/</code></li>
</ul>
<p><strong>Activating Network (aka multisite)</strong></p>
<p>At this stage you should log into http://domain.com and follow the on screen instructions.<br />
Once you are in the backend you can than click into the &#8220;Tools -> Network&#8221; link and enable the mulsite, this will create some tables in your db and it will ask you to copy&#038;paste some lines into <code>/etc/wordpress/config-domain.com.php</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'SUBDOMAIN_INSTALL'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$base</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'/'</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'DOMAIN_CURRENT_SITE'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'domain.com'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'PATH_CURRENT_SITE'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'/'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'SITE_ID_CURRENT_SITE'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'BLOG_ID_CURRENT_SITE'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'AUTH_KEY'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'blabla'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'SECURE_AUTH_KEY'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'blabla'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'LOGGED_IN_KEY'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'blabla'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'NONCE_KEY'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'blabla'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'AUTH_SALT'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'blabla'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'SECURE_AUTH_SALT'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'blabla'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'LOGGED_IN_SALT'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'blabla'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'NONCE_SALT'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'blabla'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'MULTISITE'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># for debugging purposes only
</span><span style="color: #666666; font-style: italic;"># define('WP_DEBUG', true);</span></pre></div></div>

<p>After that you&#8217;re ready to go <img src='http://blog.angelofailla.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Logging as super admin and going into the SuperAdmin webgui area you can create new subdomains (blogs), and users, when you can create blogs an email is sent to the owner, you can personalize templates, decide how much storage space you want to assign to every single blog, etc, etc.</p>
<p>At this point you should be able to also install/upgrade plugins and themes straight from the web gui.<br />
Note that <code>define('WP_CORE_UPDATE', false);</code> in your config file will disable the auto update, your wordpress update cycle will be managed using Debian apt tool.</p>
<p>That&#8217;s it folks, any question please comment <img src='http://blog.angelofailla.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://blog.angelofailla.com/?ak_action=api_record_view&id=2095&type=feed" alt="" /><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.angelofailla.com%2F2010%2F12%2F29%2Fsetting-up-wordpress-multisite-on-debian-5-0-lenny%2F&amp;title=Setting%20up%20WordPress%20Multisite%20on%20Debian%205.0%20%28lenny%29" id="wpa2a_6"><img src="http://blog.angelofailla.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.angelofailla.com/2010/12/29/setting-up-wordpress-multisite-on-debian-5-0-lenny/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

