<?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>nerdcenter &#187; Linux / Unix</title>
	<atom:link href="http://nerdcenter.de/category/linux-unix/feed/" rel="self" type="application/rss+xml" />
	<link>http://nerdcenter.de</link>
	<description>IT-Kniffe eines Webentwicklers.</description>
	<lastBuildDate>Sun, 10 Apr 2011 16:55:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>wget untar on the fly</title>
		<link>http://nerdcenter.de/wget-untar-on-the-fly/</link>
		<comments>http://nerdcenter.de/wget-untar-on-the-fly/#comments</comments>
		<pubDate>Fri, 21 Jan 2011 12:26:46 +0000</pubDate>
		<dc:creator>kcore</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Linux / Unix]]></category>

		<guid isPermaLink="false">http://nerdcenter.de/?p=118</guid>
		<description><![CDATA[

Downloading and extracting large tarballs usually takes plenty of time. Extracting tarballs during the their transfer reduces the waiting time because you a) don&#8217;t need to do wait for the transfer to finishes before starting the extraction and b) the machine doesn&#8217;t have to read the tarball from the disk while simultaneously writing to it.
One [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>Downloading and extracting large tarballs usually takes plenty of time. Extracting tarballs during the their transfer reduces the waiting time because you a) don&#8217;t need to do wait for the transfer to finishes before starting the extraction and b) the machine doesn&#8217;t have to read the tarball from the disk while simultaneously writing to it.</p>
<p>One way to extract tarballs on the fly while downloading them is using wget to fetch the file and piping it&#8217;s output (the downloaded data) to tar.<br />
<code>wget --user=&quot;username&quot; --password=&quot;my secret password&quot;  -O - &quot;ftp://foo.bar/foobar.tgz&quot; | tar -xvzf -</code></p>
<p>Hint: You may want to turn hoff Bash&#8217;s history expansion if your username or password contains exclamation marks. The fastest way doing so is starting a new bash process with the corresponding argument (+H):<br />
<code>bash +H<br />
wget...</code></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://nerdcenter.de/wget-untar-on-the-fly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting MBR Partition Tables to GPT</title>
		<link>http://nerdcenter.de/convert-mbr-partition-tables-gpt/</link>
		<comments>http://nerdcenter.de/convert-mbr-partition-tables-gpt/#comments</comments>
		<pubDate>Thu, 23 Sep 2010 09:54:00 +0000</pubDate>
		<dc:creator>kcore</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[GPT fdisk]]></category>
		<category><![CDATA[GUID Partition Table]]></category>
		<category><![CDATA[MBR]]></category>

		<guid isPermaLink="false">http://nerdcenter.de/?p=110</guid>
		<description><![CDATA[

MSDOS MBR Partition Tables make it impossible to use Partitions larger than 2 TiB. This is a pitfall you maybe will be faced with after expension of a RAID array. The only solution is to convert the MBR Partition Table to GPT (GUID Partition Table).
This can be done quite easily by using GPT fdisk.
GPT fdisk [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>MSDOS MBR Partition Tables make it impossible to use Partitions larger than 2 TiB. This is a pitfall you maybe will be faced with after expension of a RAID array. The only solution is to convert the MBR Partition Table to GPT (GUID Partition Table).</p>
<p>This can be done quite easily by using <a href="http://www.rodsbooks.com/gdisk/">GPT fdisk</a>.<br />
GPT fdisk includes the sgdisk program which can convert MBR Partition Tables to GUID Partition Tables using the following command:</p>
<pre>sgdisk -g device</pre>
<p>(for example sgdisk -g /dev/sda)</p>
<p><strong>Warning: doing this will make your system unbootable as there&#8217;s no longer a master boot record existing.</strong><br />
The <a href="http://grub.enbug.org/BIOS_Boot_Partition">BIOS Boot Partition</a> replaces the MBR. Make sure you have enough unused space to create it.</p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://nerdcenter.de/convert-mbr-partition-tables-gpt/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Solr Multicore: Installation, Configuration</title>
		<link>http://nerdcenter.de/solr-multicore-installation-configuration/</link>
		<comments>http://nerdcenter.de/solr-multicore-installation-configuration/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 11:48:33 +0000</pubDate>
		<dc:creator>kcore</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[Solr]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[multicore]]></category>

		<guid isPermaLink="false">http://nerdcenter.de/?p=103</guid>
		<description><![CDATA[

If you start Solr with the default configuration, there will be only one instance running. That&#8217;s enough if you have only one website which you want to index but if you have several websites, you probably don&#8217;t want them to share an index as you then would get search results from both websites.
Luckily Solr already [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>If you start Solr with the default configuration, there will be only one instance running. That&#8217;s enough if you have only one website which you want to index but if you have several websites, you probably don&#8217;t want them to share an index as you then would get search results from both websites.<br />
Luckily Solr already brings the so called multicore feature with it. It allows you to run multiple instances that use different configuration sets and indexes.</p>
<p>This little howto will show you how to install / configure Solr to make use of the multicore feature.</p>
<p>1. Install the Sun Java Runtime Environment<br />
On Debian Linux you will do this by executing apt-get install sun-java6-jre</p>
<p>2. Choose the directory in which you want to install Solr. In this example we will use /opt.<br />
If it doesn&#8217;t exist already, create the directory and cd to it.<br />
<code>cd /opt</code></p>
<p>3. Go to http://www.apache.org/dyn/closer.cgi/lucene/solr/ and choose a mirror. In this example we will use http://ftp-stud.hs-esslingen.de/pub/Mirrors/ftp.apache.org/dist//lucene/solr/. Download the latest Solr version, currently 1.4.1:<br />
<code>wget http://ftp-stud.hs-esslingen.de/pub/Mirrors/ftp.apache.org/dist//lucene/solr/1.4.1/apache-solr-1.4.1.tgz</code></p>
<p>4. Extract the downloaded archive:<br />
<code>tar xzf apache-solr-1.4.1.tgz</code></p>
<p>5. Copy the Solr examples directory. In this example we will copy it to /opt/solr/.<br />
<code>cp -R apache-solr-1.4.1/example/ solr</code></p>
<p>6. cd to /opt/solr/<br />
<code>cd /opt/solr/</code></p>
<p>7. Remove the following directories (you probably won&#8217;t need them):<br />
- example-DIH<br />
- exampledocs<br />
- work</p>
<p><code>rm -Rf example-DIH exampledocs work</code></p>
<p>8. Copy /opt/solr/multicore/solr.xml to /opt/solr/solr/solr.xml and remove the multicore directory.<br />
solr.xml describes the name and location of the cores to use.<br />
<code>cp /opt/solr/multicore/solr.xml /opt/solr/solr/ &#038;&#038; rm -Rf /opt/solr/multicore/</code></p>
<p>9. Edit /opt/solr/solr/solr.xml and modify it to match your needs. For example:<br />
<code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;<br />
&lt;solr persistent=&quot;true&quot;&gt;<br />
  &lt;cores adminPath=&quot;/admin/cores&quot;&gt;<br />
    &lt;core name=&quot;myfirstwebsite&quot; instanceDir=&quot;site_myfirstwebsite&quot; /&gt;<br />
    &lt;core name=&quot;mysecondwebsite&quot; instanceDir=&quot;site_mysecondwebsite&quot; /&gt;<br />
  &lt;/cores&gt;<br />
&lt;/solr&gt;</code></p>
<p>10. Create the directories you specified as &quot;instanceDir&quot; in step 9. Copy /opt/solr/solr/conf into them and create data directories.<br />
<code>mkdir -p /opt/solr/solr/site_myfirstwebsite/data &#038;&#038; cp -R /opt/solr/solr/conf/ /opt/solr/solr/site_myfirstwebsite/<br />
mkdir -p /opt/solr/solr/site_mysecondwebsite/data &#038;&#038; cp -R /opt/solr/solr/conf/ /opt/solr/solr/site_mysecondwebsite/</code></p>
<p>11. Edit /opt/solr/solr/site_myfirstwebsite/conf/solrconfig.xml and /opt/solr/solr/site_mysecondwebsite/conf/solrconfig.xml. Change the dataDir-tag to match the new data directories you created in step 10:<br />
&lt;dataDir&gt;/opt/solr/solr/site_myfirstwebsite/data&lt;/dataDir&gt; respectively &lt;dataDir&gt;/opt/solr/solr/site_mysecondwebsite/data&lt;/dataDir&gt;</p>
<p>12. Start Solr. We will use Jetty here because we wouldn&#8217;t need Tomcat for anything else but Solr.<br />
<code>java -jar -server -Xmx128M -Dfile.encoding=UTF8 -Djava.headless=True /opt/solr/start.jar</code></p>
<p>After Solr has been startet you can access the Solr Admin at http://SOLR_HOSTNAME:8983/solr/ (you should find a link pointing to the Solr Admin for every core you have configured before). Solr queries need to go to http://SOLR_HOSTNAME:8983/solr/CORE_NAME/, f.exp. http://192.168.10.41:8983/solr/myfirstwebsite/select/?q=*%3A*&#038;version=2.2&#038;start=0&#038;rows=10&#038;indent=on</p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://nerdcenter.de/solr-multicore-installation-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redmine, Apache, Subversion: Could not read status line</title>
		<link>http://nerdcenter.de/redmine-apache-subversion-could-not-read-status-line/</link>
		<comments>http://nerdcenter.de/redmine-apache-subversion-could-not-read-status-line/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 08:45:24 +0000</pubDate>
		<dc:creator>kcore</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[redmine]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://nerdcenter.de/?p=99</guid>
		<description><![CDATA[

If you use a combination of Redmine.pm, Apache and SVN and are wondering about error messages telling you &#34;COPY of &#8216;foobar&#8217; : Could not read status line: connection was closed by server&#34; or &#34;COPY of &#8216;foobar&#8217; : Could not read status line: secure connection truncated&#34; you probably will want to switch to apache2-mpm-prefork to get [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>If you use a combination of Redmine.pm, Apache and SVN and are wondering about error messages telling you <strong>&quot;COPY of &#8216;foobar&#8217; : Could not read status line: connection was closed by server&quot;</strong> or <strong>&quot;COPY of &#8216;foobar&#8217; : Could not read status line: secure connection truncated&quot;</strong> you probably will want to switch to apache2-mpm-prefork to get rid of them.</p>
<p>A combination of Redmine.pm, apache2-mpm-worker and Redmine.pm doesn&#8217;t seem to be stable at all.</p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://nerdcenter.de/redmine-apache-subversion-could-not-read-status-line/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How-to: Debian: Automatically mounted loopback images with dm-crypt, LUKS, pam_mount</title>
		<link>http://nerdcenter.de/howto-debian-loopback-dm-crypt-luks-pam-mount/</link>
		<comments>http://nerdcenter.de/howto-debian-loopback-dm-crypt-luks-pam-mount/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 13:42:02 +0000</pubDate>
		<dc:creator>kcore</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[Sicherheit]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[dm-crypt]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[libpam-mount]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[loopback]]></category>
		<category><![CDATA[LUKS]]></category>
		<category><![CDATA[pam_mount]]></category>
		<category><![CDATA[Squeeze]]></category>

		<guid isPermaLink="false">http://nerdcenter.de/?p=82</guid>
		<description><![CDATA[

How to create encrypted loopback images with dm-crypt and LUKS + automatically mounting them after login with pam_mount
I recommend using debian squeeze for this scenario as lenny includes a very old version of libpam-mount and I had lots of problems when I tried using it.
Using only the libpam-mount package and its dependencies from squeeze maybe [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<h3>How to create encrypted loopback images with dm-crypt and LUKS + automatically mounting them after login with pam_mount</h3>
<p>I recommend using debian squeeze for this scenario as lenny includes a very old version of libpam-mount and I had lots of problems when I tried using it.<br />
Using only the libpam-mount package and its dependencies from squeeze maybe (I didn&#8217;t try it and I wouldn&#8217;t recommend it either) does the job too, but at least has a very bitter after taste if you take a closer look at the dependencies.</p>
<p>1. Make sure you have the required kernel modules loaded. If you use the stock debian kernel, this will be the case. if you don&#8217;t, make sure you&#8217;ve set the following options:</p>
<ul>
<li>CONFIG_BLK_DEV_DM=y or CONFIG_BLK_DEV_DM=M</li>
<li>CONFIG_DM_CRYPT=y or CONFIG_DM_CRYPT=M</li>
<li>CONFIG_CRYPTO_CBC=y</li>
</ul>
<p>Additionally, you need to include support for at least one cipher.</p>
<p>In make menuconfig, you can find the required kernel modules at the following locations:</p>
<pre>
Device Drivers  --->
	Multi-device support (RAID and LVM)  --->
		<*> Device mapper support
		<*> Crypt target support

Cryptographic options  --->
	<M> SHA256 digest algorithm
	<M> AES cipher algorithms (x86_64)
</pre>
<p>To avoid a reboot, you can build all of these options as modules. If you chose to do so, you can later load the modules by using modprobe <MODULE_NAME>.</p>
<p>2. Install the required packages<br />
apt-get install cryptsetup libpam-mount<br />
&#8230;apt-get should take care of all dependencies</p>
<p>3. Generate a random key and assign it to a variable for later use</p>
<pre>KEY=`tr -cd [:graph:] < /dev/urandom | head -c 79`</pre>
<p>4. Encrypt the key and save it to a file</p>
<pre>echo $KEY | openssl aes-256-cbc > container.key</pre>
<p>5. Create the loopback file and fill it with random data</p>
<pre>dd if=/dev/urandom of=~/container.img bs=1G count=10</pre>
<p>This will create a 10GB file and fill it with random data taken from /dev/urandom.<br />
Another option (which will be much faster especially on older hardware) is using /dev/zero to fill the loopback file with zeros:</p>
<pre>dd if=/dev/zero of=~/container.img bs=1G count=10</pre>
<p>6. Set up a loop device</p>
<pre>losetup /dev/loop0 ~/container.img</pre>
<p>7. LuksFormat it</p>
<pre>echo $KEY | cryptsetup -v -c aes -s 256 luksFormat /dev/loop0</pre>
<p>8. Open it</p>
<pre>cryptsetup luksOpen /dev/loop0 container</pre>
<p>9. Make a filesystem of your choice</p>
<pre>mkfs.xfs /dev/mapper/container</pre>
<p>10. Close it and delete loop</p>
<pre>cryptsetup luksClose container &#038;&#038; losetup -d /dev/loop0</pre>
<p>11. Configure pam_mount<br />
Open /etc/security/pam_mount.conf.xml in your favorite text editor and change it to the following:</p>
<pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;&nbsp;?&gt;

&lt;!DOCTYPE pam_mount SYSTEM &quot;pam_mount.conf.xml.dtd&quot;&gt;
&lt;pam_mount&gt;
	&lt;debug enable=&quot;1&quot; /&gt;
	&lt;mkmountpoint enable=&quot;1&quot; remove=&quot;true&quot; /&gt;

	&lt;msg-sessionpw&gt;reenter password for pam_mount:&lt;/msg-sessionpw&gt;
	&lt;volume user=&quot;foobar&quot; path=&quot;/home/foobar/container.img&quot; mountpoint=&quot;/home/foobar/containercontents&quot;
		options=&quot;cipher=aes-cbc-essiv:sha256,hash=sha512,keysize=256&quot; fstype=&quot;crypt&quot; fskeycipher=&quot;aes-256-cbc&quot;

		fskeypath=&quot;/home/foobar/container.key&quot; fskeyhash=&quot;md5&quot; /&gt;
&lt;/pam_mount&gt;</pre>
<p>Using this configuration the image /home/foobar/container.img will get mounted into /home/foobar/containercontents when the user foobar logs in.<br />
Enabling debugging is pretty usefull if something isn't working as it should. In this case you can take a look at /var/log/auth.log.</p>
<p>12. Include /etc/pam.d/common-pammount in the PAM configuration files of the services that should use it (for example: SSHd)<br />
Open /etc/security/sshd in your favorite text editor. Look for the line "@include common-session" and add a new line after it:</p>
<pre>...
@include common-session
@include common-pammount
...</pre>
<p>13. If needed, change the configuration of the relevant services (for example: SSHd)<br />
Open /etc/ssh/sshd_config in your favority text editor and make sure you have the following lines in there:</p>
<pre># pam_mount
UsePAM yes
PasswordAuthentication yes
ChallengeResponseAuthentication no
UsePrivilegeSeparation no
PermitUserEnvironment yes</pre>
<p>If you disable PasswordAuthentication and use keys instead you have to enter the users password after connecting via SSH.</p>
<p>14. Test if anything works as expected<br />
Open a root session or use sudo and watch the auth log by using tail -f /var/log/auth.log. Then login as the user for which you have configured a volume earlier.<br />
If the encrypted loopback image gets mounted, also test if it gets unmounted again, when the user logs out.<br />
If anything works remove the debug line from /etc/security/pam_mount.conf.xml.</p>
<p>Many thanks go to the users tuxophil and pillgrim from the gentoo forums. Large parts of this howto were taken from their postings at <a href="http://forums.gentoo.org/viewtopic-t-274651.html">http://forums.gentoo.org/viewtopic-t-274651.html</a>.</p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://nerdcenter.de/howto-debian-loopback-dm-crypt-luks-pam-mount/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debian Lenny: pam_mount, files and loop devices</title>
		<link>http://nerdcenter.de/debian-lenny-pam-mount-files-loop-devices/</link>
		<comments>http://nerdcenter.de/debian-lenny-pam-mount-files-loop-devices/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 07:35:21 +0000</pubDate>
		<dc:creator>kcore</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[devices]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[libpam-mount]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[pam_mount]]></category>

		<guid isPermaLink="false">http://nerdcenter.de/?p=77</guid>
		<description><![CDATA[

When I was trying to automatically mount an encrypted image at login using pam_mount, I encountered a strange problem:
I wasn&#8217;t able to find any errors in my configuration (at least none connected to this behaviour), but mount.crypt was unable to mount the image.
Enabling debugging in pam_mount.conf.xml (&#60;debug enable=&#34;1&#34; /&#62;) revealed the command used for mounting:
pam_mount(misc.c:272) [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>When I was trying to automatically mount an encrypted image at login using pam_mount, I encountered a strange problem:<br />
I wasn&#8217;t able to find any errors in my configuration (at least none connected to this behaviour), but mount.crypt was unable to mount the image.<br />
Enabling debugging in pam_mount.conf.xml (&lt;debug enable=&quot;1&quot; /&gt;) revealed the command used for mounting:</p>
<p><b>pam_mount(misc.c:272) command: mount.crypt [-o loop] [/home/foobar/container] [/home/foobar/crypto]</b></p>
<p>In Debians libpam-mount 0.44-1+lenny3, /sbin/mount.crypt is a bash script that calls cryptsetup with parameters generated during its runtime.<br />
Debugging it (set -x), I stumpled upon the following command:</p>
<p><i>cryptsetup -c aes -h ripemd160 -s 256 create _home_foobar_container /home/foobar/container</i></p>
<p>&#8230;which returned the following error message:</p>
<p><b>Command failed: BLKROGET failed on device: Inappropriate ioctl for device</b></p>
<p>So mount.crypt has been passed the loop option but cryptsetup was told to mount the encrypted image instead of the associated loopback device (normally mount.crypt executes losetup to create this association in its function _losetup, but this apparently has never been called).</p>
<p>Long story short:<br />
There seems to be a bug in Debians libpam-mount 0.44-1+lenny3.<br />
The case statement at line 110 in /sbin/mount.crypt doesn&#8217;t work as expected because the variable $KEY used for option comparison has an ordinary space at its values beginning.<br />
To fix this, you can either change the way how passed options are saved in the OPTION variable (starting at line 60) or change line 110 to the following:</p>
<p><b>case ${KEY/ /} in</b></p>
<p>This will remove all spaces.</p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://nerdcenter.de/debian-lenny-pam-mount-files-loop-devices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>suPHP und PHP Opcode Caches</title>
		<link>http://nerdcenter.de/suphp-php-opcode-cache/</link>
		<comments>http://nerdcenter.de/suphp-php-opcode-cache/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 11:02:37 +0000</pubDate>
		<dc:creator>kcore</dc:creator>
				<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Webserver]]></category>

		<guid isPermaLink="false">http://nerdcenter.de/?p=63</guid>
		<description><![CDATA[

Eigentlich ist suPHP eine nette Sache. Das Apache Modul mod_suphp sorgt in Kombination mit einem SetUID Binary dafür, dass PHP-Skripte mit den Berechtigungen des Benutzers, dem sie gehören, ausgeführt werden. Damit das funktioniert muss man in Binär-Distributionen wie etwa Debian Linux nicht mehr tun, als dass Modul zu installieren, einen Blick auf dessen Konfiguration zu [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>Eigentlich ist suPHP eine nette Sache. Das Apache Modul mod_suphp sorgt in Kombination mit einem SetUID Binary dafür, dass PHP-Skripte mit den Berechtigungen des Benutzers, dem sie gehören, ausgeführt werden. Damit das funktioniert muss man in Binär-Distributionen wie etwa Debian Linux nicht mehr tun, als dass Modul zu installieren, einen Blick auf dessen Konfiguration zu werfen und es anschließend zu aktivieren. Vielleicht ist es gerade diese Einfachheit (deren Preis die Starrheit ist), die es so beliebt macht.</p>
<p>Ein großes Problem tut sich aber dann auf, wenn man PHP-Caches wie APC, TurckMM oder eAccelerator verwenden möchte. Denn all diese Caches funktionieren nicht im Zusammenspiel mit suPHP. Zwar lässt sich eine solche Kombination verwenden, doch ist sie leider nutzlos, da nichts gecached wird.</p>
<p>Eine wundervolle Alternative zu der Verwendung von suPHP ist eine Kombination aus Apache, SuExec, FCGID und PHP-CGI. Mit dieser Kombination funktioniert auch das Caching problemlos. Eine Anleitung zum Aufsetzen dieser Kombination findet sich bei <a href="http://wiki.hetzner.de/index.php/Apache_PHP5_fcgi_und_SuExec">Hetzner.de</a>.</p>
<p>Wer seine Websites nicht in dem von der jeweils genutzten Linux Distribution dafür vorgesehenen Verzeichnis ablegt sondern stattdessen beispielsweise in /home/*/public_html/ muss darauf achten, SuExec selbst zu kompilieren oder auf Debian-Systemen die gepatchte Version apache2-suexec-common zu verwenden. Aus Sicherheitsgründen erwartet SuExec bereits bei der Kompilierung den Pfad zum Docroot. Bei der Verwendung von apache2-suexec-common lässt sich das Docroot in der Datei /etc/apache2/suexec/www-data angeben.</p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://nerdcenter.de/suphp-php-opcode-cache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XEN Loop Disk Image vergrößern</title>
		<link>http://nerdcenter.de/xen-loop-disk-image-vergrosern/</link>
		<comments>http://nerdcenter.de/xen-loop-disk-image-vergrosern/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 11:47:13 +0000</pubDate>
		<dc:creator>kcore</dc:creator>
				<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[XEN]]></category>
		<category><![CDATA[disk]]></category>
		<category><![CDATA[domU]]></category>
		<category><![CDATA[grow]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[resize]]></category>
		<category><![CDATA[vergrößern]]></category>

		<guid isPermaLink="false">http://nerdcenter.de/xen-loop-disk-image-vergrosern/</guid>
		<description><![CDATA[

Das Loop Disk Image einer XEN DomU ist zu klein geworden? Solang die Festplatte des Hypervisors noch genügend Platzreserven hat, ist das glücklicherweise kein unlösbares Problem. Loop Disk Images können mit Bordmitteln vergrößert werden. Zwei kleine Beispiele für die Vorgehensweise bei EXT2, EXT3 und XFS Dateisystem:
EXT2 / EXT3 Dateisystem
VM herunterfahren:
xm shutdown domu.blub.local
Image um 30GB vergrößern:
dd [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>Das Loop Disk Image einer XEN DomU ist zu klein geworden? Solang die Festplatte des Hypervisors noch genügend Platzreserven hat, ist das glücklicherweise kein unlösbares Problem. Loop Disk Images können mit Bordmitteln vergrößert werden. Zwei kleine Beispiele für die Vorgehensweise bei EXT2, EXT3 und XFS Dateisystem:</p>
<p><strong>EXT2 / EXT3 Dateisystem</strong><br />
VM herunterfahren:</p>
<pre>xm shutdown domu.blub.local</pre>
<p>Image um 30GB vergrößern:</p>
<pre>dd if=/dev/zero bs=1024k count=30720 >> disk.img</pre>
<p>Fehler im Dateisystem korrigieren:</p>
<pre>e2fsck -f disk.img</pre>
<p>Dateisystem auf die Größe des Images vergrößern:</p>
<pre>resize2fs disk.img</pre>
<p><strong>XFS Dateisystem</strong><br />
VM herunterfahren:</p>
<pre>xm shutdown domu.blub.local</pre>
<p>Image um 30GB vergrößern:</p>
<pre>dd if=/dev/zero bs=1024k count=30720 >> disk.img</pre>
<p>Fehler im Dateisystem korrigieren:</p>
<pre>xfs_repair -f disk.img</pre>
<p>Dateisystem auf die Größe des Images vergrößern:</p>
<pre>mount disk.img /mnt/tmp/ -o loop
xfs_growfs -d /mnt/tmp/</pre>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://nerdcenter.de/xen-loop-disk-image-vergrosern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Module &#8216;json&#8217; already loaded in Unknown on line 0</title>
		<link>http://nerdcenter.de/module-json-already-loaded-in-unknown-on-line-0/</link>
		<comments>http://nerdcenter.de/module-json-already-loaded-in-unknown-on-line-0/#comments</comments>
		<pubDate>Sun, 08 Feb 2009 22:35:32 +0000</pubDate>
		<dc:creator>kcore</dc:creator>
				<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.nerdcenter.de/module-json-already-loaded-in-unknown-on-line-0/</guid>
		<description><![CDATA[

Mir sind gerade fast die Augen rausgefallen als ich bei einem Blick ins Error-Log des Apache Webservers unter Debian Etch abertausende Zeilen mit der Fehlermeldung &#34;PHP Warning: Module &#8216;json&#8217; already loaded in Unknown on line 0&#34; sah. Jeder Seitenaufruf erzeugte diesen Fehler. Die installierten Pakete (php5-cgi + Module sowie apache2 + Module) entstammen dem offiziellen [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>Mir sind gerade fast die Augen rausgefallen als ich bei einem Blick ins Error-Log des Apache Webservers unter Debian Etch abertausende Zeilen mit der Fehlermeldung <strong>&quot;PHP Warning: Module &#8216;json&#8217; already loaded in Unknown on line 0&quot;</strong> sah. Jeder Seitenaufruf erzeugte diesen Fehler. Die installierten Pakete (php5-cgi + Module sowie apache2 + Module) entstammen dem offiziellen Debian Etch Repository, das Problem betrifft also wahrscheinlich auch noch viele weitere Systeme, bei denen nicht ständig ins Error-Log geschaut wird. Wahrscheinlich wird beim Start des php-cgi Prozesses noch eine andere Konfigurationsdatei als <em>/etc/php5/cgi/php.ini</em>, mit der Anweisung das Modul zu laden, ausgelesen.</p>
<p>Beheben lässt sich das Problem durch das Editieren von <em>/etc/php5/cgi/php.ini</em>. Dort die Zeile, die das json-Modul lädt, einfach auskommentieren und den Apache neustarten.</p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://nerdcenter.de/module-json-already-loaded-in-unknown-on-line-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>phpDocumentor bei SVN commit starten</title>
		<link>http://nerdcenter.de/phpdocumentor-bei-svn-commit-starten/</link>
		<comments>http://nerdcenter.de/phpdocumentor-bei-svn-commit-starten/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 18:58:48 +0000</pubDate>
		<dc:creator>kcore</dc:creator>
				<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpdocumentor]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.nerdcenter.de/phpdocumentor-bei-svn-commit-starten/</guid>
		<description><![CDATA[

Was ist Code ohne Dokumentation? Genau: total daneben.
Zum Glück gibt es ja praktische Helfer wie phpDocumentor, um aus Kommentaren eine richtig anständige Dokumentation zu zaubern. Aber das verdammte Ding nach jedem SVN commit anzustoßen ist auf Dauer ganz schön nervig&#8230;
Abhilfe verspricht der post-commit hook. In dem Wurzelverzeichnis jedes SVN Repositorys befindet sich ein Verzeichnis namens [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>Was ist Code ohne Dokumentation? Genau: total daneben.</p>
<p>Zum Glück gibt es ja praktische Helfer wie <strong>phpDocumentor</strong>, um aus Kommentaren eine richtig anständige Dokumentation zu zaubern. Aber das verdammte Ding nach jedem <strong>SVN commit</strong> anzustoßen ist auf Dauer ganz schön nervig&#8230;</p>
<p>Abhilfe verspricht der <strong>post-commit hook</strong>. In dem Wurzelverzeichnis jedes SVN Repositorys befindet sich ein Verzeichnis namens hooks. Dort können beliebige ausführbare Dateien hinterlegt werden, die je nach deren Dateinamen zu einem bestimmten Zeitpunkt ausgeführt werden (Beispiele / Templates sind bereits in dem Verzeichnis enthalten).<br />
Um phpDocumentor nach einem erfolgreichen SVN commit zu starten kann man ein Bash-script verwenden, indem man diesem den Dateinamen post-commit verpasst und das Executebit setzt (chmod +x foo).</p>
<p>Der Ablauf im Script ist dann wie folgt:<br />
1. SVN checkout anwerfen<br />
2. phpdoc -d anwerfen<br />
3. Quellcode löschen (bei Bedarf)</p>
<p>Das Script bekommt bei seinem Aufruf 2 Argumente: den absoluten Pfad zum betroffenen Repository sowie die Reversion nach dem commit.</p>
<p>Besonders praktisch finde ich daran die Möglichkeit den Quelltext zusammen mit der entsprechenden Dokumentation im Intranet zugänglich zu machen.</p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://nerdcenter.de/phpdocumentor-bei-svn-commit-starten/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

