<?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>monkey-business.biz &#187; Debian</title> <atom:link href="http://www.monkey-business.biz/tag/debian/feed/" rel="self" type="application/rss+xml" /><link>http://www.monkey-business.biz</link> <description>Belästigung der Allgemeinheit - der private Weblog</description> <lastBuildDate>Tue, 24 Jan 2012 14:53:33 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>daily</sy:updatePeriod> <sy:updateFrequency>4</sy:updateFrequency> <item><title>Von Hetzner SysCP Image zu Froxlor</title><link>http://www.monkey-business.biz/1474/von-hetzner-syscp-image-zu-froxlor/</link> <comments>http://www.monkey-business.biz/1474/von-hetzner-syscp-image-zu-froxlor/#comments</comments> <pubDate>Wed, 16 Feb 2011 02:23:38 +0000</pubDate> <dc:creator>Loaden</dc:creator> <category><![CDATA[Belästigung der Allgemeinheit - mein privater Weblog]]></category> <category><![CDATA[Administration]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[Froxlor]]></category> <category><![CDATA[Hetzner]]></category> <category><![CDATA[Hosting]]></category> <category><![CDATA[SysCP]]></category> <category><![CDATA[Tutorial]]></category><guid isPermaLink="false">http://www.monkey-business.biz/?p=1474</guid> <description><![CDATA[Ich möchte vorweg darauf hinweisen, das es bei mir bei dem Update heute nacht um 3 Uhr etwas turbulent zur Sache ging. Keine der Anleitungen die ich online gefunden hatte hatten ihr Froxlor Installationen nach dem Upgrade von SysCP überprüft. Keine dieser Anleitungen verlief Fehlerlos bzw. ohne Folgefehler durch Konfigurationsfehler. Der Server sollte natürlich bis [...]]]></description> <content:encoded><![CDATA[<p>Ich möchte vorweg darauf hinweisen, das es bei mir bei dem Update heute nacht um 3 Uhr etwas turbulent zur Sache ging. Keine der Anleitungen die ich online gefunden hatte hatten ihr Froxlor Installationen nach dem Upgrade von SysCP überprüft. Keine dieser Anleitungen verlief Fehlerlos bzw. ohne Folgefehler durch Konfigurationsfehler. Der Server sollte natürlich bis morgens wieder für Hosting Kunden nutzbar funktionieren. Ich hoffe dieser Ärger bleibt euch mit diesem Tutorial erspart.</p><h3>Vorwort</h3><ul><li>Es wird eine funktionsfähige Hetzner SysCP Image Installtion benötigt (SysCP Root: /var/syscp/web/)</li><li>Der gesamte Installationsvorgang findet über eine SSH Verbindung auf dem Server statt</li><li>Allgemein gilt in diesem Tutorial <NAME> immer durch die entsprechenden Werte zu ersetzen</li></ul><h3>Update Vorbereitungen</h3><ul><li> <strong>SysCP sichern</strong><br /> Zunächst sollten alle Daten von SysCP gesichert werden. Ebenso machen wir ein Backup von /etc/ da wir hier im zuge des Upgrades auch Änderungen vornehmen werden. Wir nutzen für das SysCP Datenbank Backup die Option &#8220;&#8211;add-drop-table&#8221; um ein löschen der alten Inhalte vor dem einspielen der neuen auszulösen. Diese Option benötigen wir da wir im zuge des Updates den veränderten SysCP SQL Dump in diese selbe Datenbank wieder einspielen. Eure MySQL Zugangsdaten findet ihr in der SysCP Konfiguration (/var/syscp/lib/userdata.inc.php /).</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">EMP-S:~<span style="color: #666666; font-style: italic;"># cp -rp /etc/ /root/etc_bak/</span>
EMP-S:~<span style="color: #666666; font-style: italic;"># cd /var/syscp/web/</span>
EMP-S:<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>syscp<span style="color: #000000; font-weight: bold;">/</span>web<span style="color: #000000; font-weight: bold;">/</span><span style="color: #666666; font-style: italic;"># cp -rp * ../../syscp_bak/</span>
EMP-S:<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>syscp<span style="color: #000000; font-weight: bold;">/</span>web<span style="color: #000000; font-weight: bold;">/</span><span style="color: #666666; font-style: italic;"># mysqldump --databases --opt -Q -u&lt;USERNAME&gt; -p&lt;PASSWORT&gt; --add-drop-table syscp &gt; ../../syscp_bak/db.sql</span></pre></div></div></li><li> <strong>sources.list erweitern</strong></li><p>Die Datei /etc/apt/sources.list um erweitern um:</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">deb      http:<span style="color: #000000; font-weight: bold;">//</span>debian.froxlor.org lenny main
deb-src  http:<span style="color: #000000; font-weight: bold;">//</span>debian.froxlor.org lenny main</pre></div></div><p>Kommando zum öffnen der Datei (erspart Tipparbeit):</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">EMP-S:~<span style="color: #666666; font-style: italic;"># nano /etc/apt/sources.list</span></pre></div></div></li><li> <strong>SysCP Cronjobs deaktivieren</strong><br /> Durch auskommentieren der Konfiguration deaktivieren wir die SysCP Cronjobs.<br /> Kommando zum öffnen der Datei:</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">EMP-S:~<span style="color: #666666; font-style: italic;"># nano /etc/cron.d/syscp</span></pre></div></div><p>Dateinhalt nach der Bearbeitung:</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Set PATH, otherwise restart-scripts won't find start-stop-daemon</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Regular cron jobs for the syscp package</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#00 */1 * * *   root    /usr/bin/php5 -q /var/syscp/web/scripts/cron_tasks.php</span>
<span style="color: #666666; font-style: italic;">#0 0 * * *      root    /usr/bin/php5 -q /var/syscp/web/scripts/cron_traffic.php</span>
<span style="color: #666666; font-style: italic;">#30 0 * * *     root    /usr/bin/php5 -q /var/syscp/web/scripts/cron_ticketarchive.php</span>
<span style="color: #666666; font-style: italic;">#0 1 * * *      root    /usr/bin/php5 -q /var/syscp/web/scripts/cron_used_tickets_reset.php</span>
<span style="color: #666666; font-style: italic;">#00 */1 * * *   root    /usr/bin/php5 -q /var/syscp/web/scripts/cron_autoresponder.php</span>
<span style="color: #666666; font-style: italic;">#00 */1 * * *   root    /usr/bin/php5 -q /var/syscp/web/scripts/cron_apsinstaller.php</span>
<span style="color: #666666; font-style: italic;">#*/15 * * * *   root    /usr/bin/php5 -q /var/syscp/web/scripts/cron_apsupdater.php</span></pre></div></div></li><li> <strong>SQL Dump für Froxlor aufbereiten</strong><br /> Hierbei ersetzen wir den Pfad /var/syscp/web/ mit /var/www/froxlor/ und den Pfad /var/syscp/ mit /var/www/ in einer Kopie unseren SysCP SQL Dumps.</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">EMP-S:~<span style="color: #666666; font-style: italic;"># cd /var/sycp_bak/</span>
EMP-S:<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>sycp_bak<span style="color: #000000; font-weight: bold;">/</span><span style="color: #666666; font-style: italic;"># cp db.sql db_new.sql</span>
EMP-S:<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>sycp_bak<span style="color: #000000; font-weight: bold;">/</span><span style="color: #666666; font-style: italic;"># sed -i 's/\/var\/syscp\/web\//\/var\/www\/froxlor\//g' db_new.sql</span>
EMP-S:<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>sycp_bak<span style="color: #000000; font-weight: bold;">/</span><span style="color: #666666; font-style: italic;"># sed -i 's/\/var\/syscp\//\/var\/www\//g' db_new.sql</span></pre></div></div></li></ul><h3>Froxlor Installieren</h3><ul><li> <strong>Froxlor Installation über APT Paketmanagement System</strong></p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">EMP-S:~<span style="color: #666666; font-style: italic;"># apt-get update</span>
EMP-S:~<span style="color: #666666; font-style: italic;"># apt-get install froxlor</span></pre></div></div></li><li> <strong>Besitzer und Gruppe des Froxlor Verzeichnisses anpassen</strong></p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">EMP-S:~<span style="color: #666666; font-style: italic;"># chown -R www-data:www-data /var/www/froxlor/</span></pre></div></div></li><li> <strong>Alte SysCP Konfiguration in Froxlor nutzen</strong></p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">EMP-S:~<span style="color: #666666; font-style: italic;"># cp /var/syscp_bak/lib/userdata.inc.php /var/www/froxlor/lib/</span></pre></div></div></li><li> <strong>Bearbeitete Kopie der SysCP Datenbank für Froxlor einspielen</strong></p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">EMP-S:~<span style="color: #666666; font-style: italic;"># mysql -u&lt;USERNAME&gt; -p&lt;PASSWORT&gt;</span>
mysql<span style="color: #000000; font-weight: bold;">&gt;</span> use syscp  
mysql<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">source</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>syscp_bak<span style="color: #000000; font-weight: bold;">/</span>db_new.sql</pre></div></div></li><li> <strong>Symlinks für phpMyAdmin und Squirrelmail erstellen</strong></p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">EMP-S:~<span style="color: #666666; font-style: italic;"># ln -s /usr/share/phpmyadmin/ /var/www/phpmyadmin</span>
EMP-S:~<span style="color: #666666; font-style: italic;"># ln -s /usr/share/squirrelmail/ /var/www/squirrelmail</span></pre></div></div></li><li> <strong>Verzeichnisse kopieren</strong><br /> Wichtig ist hierbei Rechte und Benutzer beizubehalten. Die User Unterverzeichnise in fcgi/ logs/, tmp/ und webs/ sollten den entsprechenden fcgi Benutzer (Kunden) gehören. Das Verzeichnis mails/ dem Benuter vmail.  Das bewirkt die Option -p beim Kopieren mit cp.</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">EMP-S:~<span style="color: #666666; font-style: italic;"># cp -rp /var/syscp/fcgi/ /var/www/</span>
EMP-S:~<span style="color: #666666; font-style: italic;"># cp -rp /var/syscp/logs/ /var/www/</span>
EMP-S:~<span style="color: #666666; font-style: italic;"># cp -rp /var/syscp/mails/ /var/www/</span>
EMP-S:~<span style="color: #666666; font-style: italic;"># cp -rp /var/syscp/tmp/ /var/www/</span>
EMP-S:~<span style="color: #666666; font-style: italic;"># cp -rp /var/syscp/webs/ /var/www/</span>
EMP-S:~<span style="color: #666666; font-style: italic;"># cp -rp /var/syscp/squirrelmail/ /var/www/</span></pre></div></div></li><li> <strong>Apache Konfiguration für Froxlor anpassen</strong><br /> Hierbei muss der Pfad /var/syscp/web/ in /var/www/froxlor geändert werden. Der Ordnung halber ist es empfehlenswert die Konfigurationsdatei entsprechend umzubenennen und den Symbolischen Link auf die Konfiguration zu ändern.</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">EMP-S:~<span style="color: #666666; font-style: italic;"># sed -i 's/\/var\/syscp\/web\//\/var\/www\/froxlor\//g' /etc/apache2/sites-available/syscp</span>
EMP-S:~<span style="color: #666666; font-style: italic;"># mv /etc/apache2/sites-available/syscp /etc/apache2/sites-available/froxlor</span>
EMP-S:~<span style="color: #666666; font-style: italic;"># rm /etc/apache2/sites-enabled/00-syscp</span>
EMP-S:~<span style="color: #666666; font-style: italic;"># ln -s /etc/apache2/sites-available/froxlor /etc/apache2/sites-enabled/froxlor</span></pre></div></div></li><li> <strong>Suexec Pfade für Froxlor anpassen</strong><br /> In der Datei /etc/apache2/suexec/www-data den Pfad /var/syscp/ in /var/www/ ändern.</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">EMP-S:~<span style="color: #666666; font-style: italic;"># sed -i 's/\/var\/syscp\//\/var\/www\//g' /etc/apache2/suexec/www-data</span></pre></div></div></li><li> <strong>Postfix Konfiguration für Froxlor anpassen</strong><br /> Konfigurations Option virtual_mailbox_base in /etc/postfix/main.cf von /var/syscp/mails/ in /var/www/mails/ ändern.</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">EMP-S:~<span style="color: #666666; font-style: italic;"># sed -i 's/\/var\/syscp\/mails\//\/var\/www\/mails\//g' /etc/postfix/main.cf</span></pre></div></div></li><li> <strong>Squirrelmail Konfiguration für Froxlor anpassen</strong><br /> Die Pfade /var/syscp/squirrelmail/data/ und /var/syscp/squirrelmail/attach/ müssen in der Datei auf /var/www/squirrelmail/*/ angepasst werden.</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">EMP-S:~<span style="color: #666666; font-style: italic;"># sed -i 's/\/var\/syscp\//\/var\/www\//g' /etc/squirrelmail/config.php</span></pre></div></div><p><strong>Anmerkung</strong><br /> In dieser Datei können Providername, Logo und dergleichen für Squirrelmail angepasst werden. Nutzt die Gelegenheit sonst macht ihr das nie.</li><li> <strong>Froxlor Cronjob erstellen</strong><br /> Wir erstellen die Datei /etc/cron.d/froxlor</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">EMP-S:~<span style="color: #666666; font-style: italic;"># nano /etc/cron.d/froxlor</span></pre></div></div><p>und füllen sie mit den Werten für die Froxlor Cronjobs:</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Set PATH, otherwise restart-scripts won't find start-stop-daemon</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #007800;">PATH</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Regular cron jobs for the froxlor package</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #000000; font-weight: bold;">*/</span><span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span>     root    <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php5 <span style="color: #660033;">-q</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>froxlor<span style="color: #000000; font-weight: bold;">/</span>scripts<span style="color: #000000; font-weight: bold;">/</span>froxlor_master_cronjob.php</pre></div></div></li><p><strong>Apache und Postfix neu starten</strong></p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">EMP-S:~<span style="color: #666666; font-style: italic;"># /etc/init.d/apache2 restart</span>
EMP-S:~<span style="color: #666666; font-style: italic;"># /etc/init.d/postfix restart</span></pre></div></div></ul><h3>Froxlor Konfiguration</h3><p>Froxlor ist nun unter Eurer IP:Euerm Port (Standard 81)  erreichbar.</p><ul><li><strong>Installationsassistent</strong><br /> Ich empfehle Froxlor nicht als fcgi auszuführen. Google sagte mir das es dabei Probleme geben soll. Den neuen Prozess Spawn Manager habe ich auch nicht aktiviert. Ich warte erstmal ein paar Erfahrungsberichte ab.</li><li> <strong>Fehlerquelle: php.ini Settings</strong><br /> Die Zeile</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">open_basedir = <span style="color: #ff0000;">&quot;{OPEN_BASEDIR}&quot;</span></pre></div></div><p>sollte in den php.ini Konfigurationen durch</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#123;</span>OPEN_BASEDIR_C<span style="color: #7a0874; font-weight: bold;">&#125;</span>open_basedir = <span style="color: #ff0000;">&quot;{OPEN_BASEDIR}&quot;</span></pre></div></div><p>ersetzt werden. Ansonsten könnte es zu Fehlern in PHP Applikationen kommen. Im Falle Magento bekommt man die Ausgabe &#8220;No input file specified&#8221;.</li></ul><h3>SysCP entfernen</h3><p><strong>Prüft nochmals alle Funktionen bevor ihr euer SysCP vom Server entfernt.</strong></p><ul><li> <strong>SysCP löschen</strong><br /> Das &#8220;immutable&#8221; Attribut von den fcgi Scripts entfernen (chattr -i) und den SysCP Ordner vom Dateisystem löschen.</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">EMP-S:~<span style="color: #666666; font-style: italic;"># chattr -i -R /var/syscp/fcgi/</span>
EMP-S:~<span style="color: #666666; font-style: italic;"># rm -r /var/syscp/</span></pre></div></div><p><strong>Vergesst die Backups nicht.</strong> /root/etc_bak/ und /var/syscp_bak/. Aufheben oder löschen. Wie es euch lieb ist.</li><li><strong>Jagd nach Überlebenden</strong><br /> Wer lustig ist kann nun noch nach überbleibseln von SysCP auf dem Server suchen und diese beseitigen. Den Datenbankname könnte man noch von syscp auf froxlor ändern. Ebenso den Unix Benutzer syscp. Weitere Überbleibsel findet man auch mit dem Kommando:</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-r</span> syscp <span style="color: #000000; font-weight: bold;">*</span></pre></div></div></li></ul><p>Froxlor ist nun via Debian APT Paketmangement Software updatebar installiert und konfiguriert. Ich hoffe bei euch läuft das mit Hilfe der Anleitung weniger turbulent und stressig. Abweichung und weitere Tipps sind erwünscht. Möchte jemand das Tutorial zu einem Update Script zusammenfassen? <img src='http://www.monkey-business.biz/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://www.monkey-business.biz/1474/von-hetzner-syscp-image-zu-froxlor/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>Das Apt für Ruby Gems &#8211; Ruby Pakete für Debian &amp; Ubuntu</title><link>http://www.monkey-business.biz/1282/das-apt-fur-ruby-gems-ruby-pakete-fur-debian-ubuntu/</link> <comments>http://www.monkey-business.biz/1282/das-apt-fur-ruby-gems-ruby-pakete-fur-debian-ubuntu/#comments</comments> <pubDate>Mon, 17 Jan 2011 22:49:08 +0000</pubDate> <dc:creator>Loaden</dc:creator> <category><![CDATA[Belästigung der Allgemeinheit - mein privater Weblog]]></category> <category><![CDATA[Apt]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[Gem]]></category> <category><![CDATA[Ruby]]></category> <category><![CDATA[Ubuntu]]></category><guid isPermaLink="false">http://www.monkey-business.biz/?p=1282</guid> <description><![CDATA[Die erste Frage die einem aufkommt ist: &#8220;Wozu brauche ich Ruby Gems als Apt Pakete?&#8221;. Nach kurzer Zeit fand ich heraus wozu. Die Ruby Pakete enthalten in Debian sind veraltet oder gar nicht erst vorhanden. Bei Ubuntu Hardy ist die Auswahl ebenfalls sehr gering. Auf meiner Debian Lenny Installation war von den Debianern sogar Rubygems [...]]]></description> <content:encoded><![CDATA[<p>Die erste Frage die einem aufkommt ist: &#8220;Wozu brauche ich Ruby Gems als Apt Pakete?&#8221;. Nach kurzer Zeit fand ich heraus wozu. Die Ruby Pakete enthalten in Debian sind veraltet oder gar nicht erst vorhanden. Bei Ubuntu Hardy ist die Auswahl ebenfalls sehr gering. Auf meiner Debian Lenny Installation war von den Debianern sogar Rubygems in der Funktionalität eingeschränkt. Dies wird einem sogar schriftlich vorgehalten:</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gem update <span style="color: #660033;">--system</span> is disabled on Debian. RubyGems can be updated using the official Debian repositories by <span style="color: #c20cb9; font-weight: bold;">aptitude</span> or apt-get.</pre></div></div><p>Das manuelle installieren / kompilieren von Paketen ist ein großer Zeitaufwand. Glücklicherweise fand ich einen Service der Debian Pakete von einem allen relevanten Gem Paketen anbietet. Die Debgem Kurzbeschreibung von der eigenen <a href="http://debgem.com/" title="Debgem Webseite" target="_blank" rel="nofollow">Webseite</a>:</p><blockquote><p> Apt is the package management system of choice for Debian users. Historically, only a very limited number of Ruby programs and libraries are packaged for Debian and installable through Apt. Instead, most Ruby programs and libraries are installed through RubyGems, a separate package management system created specifically for Ruby.</p><p>DebGem provides an Apt repository for Ruby programs and libraries which are currently available as gems. Debian users can now manage all their Ruby software through a single, centralized package manager &#8211; Apt &#8211; thereby making system administration a joy again!</p></blockquote><p>Ich nutze diesen Service derzeit für Ruby 1.8 auf meinem Debian Lenny System und bin vollsten zufrieden damit. Der Haken an der Sache ist, das Debgem nur während der Beta Phase kostenlos bleiben wird. Es bleibt zu hoffen das die Gems bis dahin besser in Debian / Ruby 1.8 integriert sind.</p><p><strong>INFO:</strong> Beim compilieren von Ruby 1.9.* in der neusten Version sollte das Problem nicht mehr bestehen.</p> ]]></content:encoded> <wfw:commentRss>http://www.monkey-business.biz/1282/das-apt-fur-ruby-gems-ruby-pakete-fur-debian-ubuntu/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Frostwire für Ubuntu &amp; Debian AMD64</title><link>http://www.monkey-business.biz/1197/frostwire-fur-ubuntu-debian-amd64/</link> <comments>http://www.monkey-business.biz/1197/frostwire-fur-ubuntu-debian-amd64/#comments</comments> <pubDate>Mon, 22 Nov 2010 12:20:51 +0000</pubDate> <dc:creator>Loaden</dc:creator> <category><![CDATA[Belästigung der Allgemeinheit - mein privater Weblog]]></category> <category><![CDATA[AMD64]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[Frostwire]]></category> <category><![CDATA[P2P]]></category> <category><![CDATA[Ubuntu]]></category><guid isPermaLink="false">http://www.monkey-business.biz/?p=1197</guid> <description><![CDATA[Dinge die jeder an den Linux Distributionen liebt. Man benötig ein Programm und wie soll es auch anders sein, es funktioniert ohne Gebastel nicht. Der Installationsversuch des Frostwire Paketes von frostwire.com bringt folgendes zu tage: dpkg: Fehler beim Bearbeiten von frostwire-4.21.1.i586.deb &#40;--install&#41;: Paket-Architektur &#40;i386&#41; passt nicht zum System &#40;amd64&#41; Was für ein Glück das ich [...]]]></description> <content:encoded><![CDATA[<p>Dinge die jeder an den Linux Distributionen liebt. Man benötig ein Programm und wie soll es auch anders sein, es funktioniert ohne Gebastel nicht. Der Installationsversuch des Frostwire Paketes von <a href="http://www.frostwire.com/?id=downloads" title="Download Frostwire">frostwire.com</a> bringt folgendes zu tage:</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">dpkg</span>: Fehler beim Bearbeiten von frostwire-4.21.1.i586.deb <span style="color: #7a0874; font-weight: bold;">&#40;</span>--install<span style="color: #7a0874; font-weight: bold;">&#41;</span>:
Paket-Architektur <span style="color: #7a0874; font-weight: bold;">&#40;</span>i386<span style="color: #7a0874; font-weight: bold;">&#41;</span> passt nicht zum System <span style="color: #7a0874; font-weight: bold;">&#40;</span>amd64<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div><p>Was für ein Glück das ich Java schon installiert hatte. <img src='http://www.monkey-business.biz/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br /> Das deb Paket auf der Webseite ist leider nicht für AMD64 &#8220;verpackt&#8221;. Die Prozessor Architektur spielt jedoch keine Rolle da Frostwire ein Java Programm ist. Die kurze Zeile</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">--force-architecture</span> <span style="color: #000000; font-weight: bold;">&lt;</span>PAKETNAME<span style="color: #000000; font-weight: bold;">&gt;</span>.i586.deb</pre></div></div><p>sollte das Problem lösen und den P2P Client installieren.</p> ]]></content:encoded> <wfw:commentRss>http://www.monkey-business.biz/1197/frostwire-fur-ubuntu-debian-amd64/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Debian Backups verschlüsseln &#8211; Artikel Update</title><link>http://www.monkey-business.biz/920/debian-backups-verschlusseln-artikel-update/</link> <comments>http://www.monkey-business.biz/920/debian-backups-verschlusseln-artikel-update/#comments</comments> <pubDate>Sun, 23 May 2010 14:07:06 +0000</pubDate> <dc:creator>Loaden</dc:creator> <category><![CDATA[Belästigung der Allgemeinheit - mein privater Weblog]]></category> <category><![CDATA[Backup]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[verschlüsselt]]></category><guid isPermaLink="false">http://www.monkey-business.biz/?p=920</guid> <description><![CDATA[Mein Artikel &#8220;Debian Backup mittels Paketlisten &#38; MySQL Dumps &#38; FTP Upload&#8221; wurde soeben aktuallisiert. Das Script passt nun die Prozess und I/O Priorität für den eigenen Prozess an um den Server nicht bei seinen regulären Arbeiten zu behindern und verschlüsselt das Backup auf Wunsch mit GnuPG. Zum Artikel gehts mit diesem Link: Verschlüsseltes Debian [...]]]></description> <content:encoded><![CDATA[<p>Mein Artikel <a title="Debian Backups verschlüsseln" href="/282/debian-backup-mittels-paketlisten-mysql-dumps-ftp-upload/">&#8220;Debian Backup mittels Paketlisten &amp; MySQL Dumps &amp; FTP Upload&#8221;</a> wurde soeben aktuallisiert. Das Script passt nun die Prozess und I/O Priorität für den eigenen Prozess an um den Server nicht bei seinen regulären Arbeiten zu behindern und verschlüsselt das Backup auf Wunsch mit GnuPG.</p><p>Zum Artikel gehts mit diesem Link: <a title="Debian Backups verschlüsseln" href="/282/debian-backup-mittels-paketlisten-mysql-dumps-ftp-upload/">Verschlüsseltes Debian Backup</a></p> ]]></content:encoded> <wfw:commentRss>http://www.monkey-business.biz/920/debian-backups-verschlusseln-artikel-update/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Hürden bei Fail2ban und Spamassasin unter Debian Lenny</title><link>http://www.monkey-business.biz/865/hurden-bei-fail2ban-und-spamassasin-unter-debian-lenny/</link> <comments>http://www.monkey-business.biz/865/hurden-bei-fail2ban-und-spamassasin-unter-debian-lenny/#comments</comments> <pubDate>Fri, 30 Apr 2010 18:34:01 +0000</pubDate> <dc:creator>Loaden</dc:creator> <category><![CDATA[Belästigung der Allgemeinheit - mein privater Weblog]]></category> <category><![CDATA[Administration]]></category> <category><![CDATA[Bugfix]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[Fail2ban]]></category> <category><![CDATA[Postfix]]></category> <category><![CDATA[Spamassassin]]></category><guid isPermaLink="false">http://www.monkey-business.biz/?p=865</guid> <description><![CDATA[Beim studieren der Server Logs meines Debian Lenny Servers fiehl mir auf das sehr viele fehlgeschlagene authentifizierungs Versuche am SMTP Daemon von Postfix statt gefunden hatten. Folgende Meldung wiederholte sich mehrfach: Apr 28 15:33:56 mail postfix/smtpd[8110]: warning: unknown[218.248.1.181]: SASL CRAM-MD5 authentication failed: PDM2NjYyMjQ0OTU5OTE5MTMuMTI3MjQ2MTYzNUBFTVAtUz4= Mich wunderte das die IP Adresse nicht nach 3 Versuchen von Fail2ban [...]]]></description> <content:encoded><![CDATA[<p>Beim studieren der Server Logs meines Debian Lenny Servers fiehl mir auf das sehr viele fehlgeschlagene authentifizierungs Versuche am SMTP Daemon von Postfix statt gefunden hatten. Folgende Meldung wiederholte sich mehrfach:</p><div class="wp_syntax"><div class="code"><pre class="log" style="font-family:monospace;">Apr 28 15:33:56 mail postfix/smtpd[8110]: warning: unknown[218.248.1.181]: SASL CRAM-MD5 authentication failed: PDM2NjYyMjQ0OTU5OTE5MTMuMTI3MjQ2MTYzNUBFTVAtUz4=</pre></div></div><p>Mich wunderte das die IP Adresse nicht nach 3 Versuchen von Fail2ban (Version 0.8.3-2sid1) gebannt wurde. Es hat sich herausgestellt das der Reguläre Ausdruck den Fail2ban für das erkennen Fehlgeschlagener authentifizierungs Versuche nicht mit der Log-Nachricht übereinstimmt. Ein Entfernen des $ am Ende des Regulären Ausdrucks (failregex) in der Datei /etc/fail2ban/filter.d/sasl.conf reichte aus um die Logs passend zu filtern.</p><p><strong>Warum das $ entfernen?</strong><br /> Das $ steht in einem Regulären Ausdruck für das Ende der zu suchenden Zeichenkette. Da aber nach &#8220;authentication failed&#8221; in dem Log Eintrag weitere Zeichen folgen passt der Reguläre Ausdruck nicht zum Logeintrag.</p><div class="wp_syntax"><div class="code"><pre class="log" style="font-family:monospace;">failregex = : warning: [-._\w]+\[&lt;HOST&gt;\]: SASL (?:LOGIN|PLAIN|(?:CRAM|DIGEST)-MD5) authentication failed</pre></div></div><p>Ist meine aktueller Eintrag um fehlgeschlagene authentifizierungs Versuche am Postfix SMTP Daemon zu erkennen.</p><p>Spamassassin füllte meine Logs zum selben Zeitpunkt mit:</p><div class="wp_syntax"><div class="code"><pre class="log" style="font-family:monospace;">Apr 28 00:31:27 mail spamd[21987]: spamd: creating default_prefs: /nonexistent/.spamassassin/user_prefs
Apr 28 00:31:27 mail spamd[21987]: config: cannot write to /nonexistent/.spamassassin/user_prefs: No such file or directory
Apr 28 00:31:27 mail spamd[21987]: spamd: failed to create readable default_prefs: /nonexistent/.spamassassin/user_prefs</pre></div></div><p>Eine weitere Lösung musste her&#8230; Da Spamassassin bei mir unter dem Benutzer nobody läuft und dieser zu diesem Zeitpunkt kein gültiges Heimatverzeichnis in der /etc/passwd Datei hinterlegt hatte blieben mir sinnvolle 2 Möglichkeiten. Zum einen das Eintragen eines gültigen Heimatverzeichnisses in die Datei /etc/passwd. (Platzhalter: &lt;VERZEICHNIS&gt;)</p><div class="wp_syntax"><div class="code"><pre class="log" style="font-family:monospace;">nobody:x:65534:65534:nobody:&lt;VERZEICHNIS&gt;:/bin/false</pre></div></div><p>Zum Anderen gab es die Möglichkeit Spamassassin durch eine Änderung in /etc/defaults/spamassassin mit einem virtuellen Verzeichnis zu starten. Hier mein Aktueller Eintrag für standard Startoptionen von Spamassassin:  (Platzhalter: &lt;VERZEICHNIS&gt;)</p><div class="wp_syntax"><div class="code"><pre class="log" style="font-family:monospace;">OPTIONS=&quot;--create-prefs --max-children 5 --helper-home-dir -u nobody -x --virtual-config-dir=&lt;VERZEICHNIS&gt;&quot;</pre></div></div><p>Ich entschied mich für die zweite Möglichkeit (Verzeichnis: /var/spool/spamassassin).</p> ]]></content:encoded> <wfw:commentRss>http://www.monkey-business.biz/865/hurden-bei-fail2ban-und-spamassasin-unter-debian-lenny/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Debian Backup mittels Paketlisten &amp; MySQL Dumps &amp; FTP Upload</title><link>http://www.monkey-business.biz/282/debian-backup-mittels-paketlisten-mysql-dumps-ftp-upload/</link> <comments>http://www.monkey-business.biz/282/debian-backup-mittels-paketlisten-mysql-dumps-ftp-upload/#comments</comments> <pubDate>Sun, 14 Mar 2010 13:39:29 +0000</pubDate> <dc:creator>Loaden</dc:creator> <category><![CDATA[Belästigung der Allgemeinheit - mein privater Weblog]]></category> <category><![CDATA[Administration]]></category> <category><![CDATA[Backup]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[dpkg]]></category> <category><![CDATA[FTP]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[Paketlisten]]></category> <category><![CDATA[Shell]]></category> <category><![CDATA[Ubuntu]]></category><guid isPermaLink="false">http://www.monkey-business.biz/?p=282</guid> <description><![CDATA[Auf der Suche nach einem Backup Shell Script für meinen Debian Server wurde ich in den weiten des Internets nicht fündig. Zumindest fand ich kein Script das genau das tat was ich wollte. Also machte ich mich selbst ans Werk. Vorweg: Das Script erstellt nicht einfach eine simple Kopie des Festplatteninhalts. Dies verbraucht meiner Meinung [...]]]></description> <content:encoded><![CDATA[<p>Auf der Suche nach einem Backup Shell Script für meinen Debian Server wurde ich in den weiten des Internets nicht fündig. Zumindest fand ich kein Script das genau das tat was ich wollte. Also machte ich mich selbst ans Werk. Vorweg: Das Script erstellt nicht einfach eine simple Kopie des Festplatteninhalts. Dies verbraucht meiner Meinung nach zu viel Speicherplatz. Sämtliche Debian Binarys müssen nämlich nicht gesichert werden. Denn diese sind von den Servern aus der sources.list abrufbar. Einzig und allein die Binarys unter /usr/local/ werden, neben den Konfigurationsdateien unter /etc/ und den Dateien unter /var/ /home/ und /root/, gesichtert. Natürlich können diese Verzeichnisse geändert werden. Es reicht die Variable TOBACKUP im Konfigurationsteil des Scriptes um die entsprechenden Verzeichnisse zu erweitern oder mit Hilfe der Variable TOEXCLUDE Unterverzeichnisse vom Backup auszuschließen. Die Kernel Version, Distribution, Architektur und der Installationszeitpunkt des Systems werden nochmals seperat in der Datei uname.txt gesichert.</p><p>Ebenso erstellt das Script SQL Dumps von allen MySQL Datenbanken des Servers und läd das gesamte Backup, verschlüsselt oder nur komprimiert, optional auch auf einen FTP Space übertragen. Wichtig ist das das Verzeichnis das in OUTDIR eingetragen ist exisitert. Sowohl bei lokalem speichern des Backups als auch beim remote Backup Vorgang auf den FTP Space. Eine Übertragung auf einen FTP Backup Space erfolgt nur, wenn FTP Zugangsdaten hinterlegt sind. Sollte etwas in die Option BACKUPPASS eingetragen sein verschlüsselt das Script die Daten mit GnuPG.</p><p>Die Kommentare im Script habe ich in englisch gehalten. Damit sollte eigentlich jeder zurecht kommen und ich muss das Script nicht mehrsprachig kommentiert online stellen. Auf alle Konfigurationsoptionen möchte ich hier im Text nicht weiter eingehen. Die Variablenbezeichnungen sowie die Kommentare sollten alles erklären.</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Author: Tobias Jäck</span>
<span style="color: #666666; font-style: italic;">## License: GPL version 3</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## &lt;Configuration&gt;</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Backup prefix</span>
<span style="color: #007800;">PREFIX</span>=<span style="color: #ff0000;">&quot;yourprefix_&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Dirs which should be backed</span>
<span style="color: #007800;">TOBACKUP</span>=<span style="color: #ff0000;">&quot;/root/ /home/ /etc/ /var/ /usr/local/&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Dirs which shouldn't be backed</span>
<span style="color: #007800;">TOEXCLUDE</span>=<span style="color: #ff0000;">&quot;/yourdirstoexclude/&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## MySQL login data</span>
<span style="color: #007800;">MYSQLUSER</span>=<span style="color: #ff0000;">&quot;yoursqluser&quot;</span>
<span style="color: #007800;">MYSQLPASS</span>=<span style="color: #ff0000;">&quot;yoursqlpass&quot;</span>
<span style="color: #007800;">MYSQLHOST</span>=<span style="color: #ff0000;">&quot;yoursqlhost&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Dir to save backup</span>
<span style="color: #007800;">OUTDIR</span>=<span style="color: #ff0000;">&quot;yourdirtosave&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## FTP login form the backup FTP server (optional)</span>
<span style="color: #007800;">FTPHOST</span>=<span style="color: #ff0000;">&quot;optionalyourftphost&quot;</span>
<span style="color: #007800;">FTPUSER</span>=<span style="color: #ff0000;">&quot;optionalyourftpuser&quot;</span>
<span style="color: #007800;">FTPPASS</span>=<span style="color: #ff0000;">&quot;optionalyourftppss&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Backup password (optional)</span>
<span style="color: #007800;">BACKUPPASS</span>=<span style="color: #ff0000;">&quot;optionalyourpassword&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Working dir</span>
<span style="color: #007800;">WORKINGDIR</span>=<span style="color: #ff0000;">&quot;/tmp/&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Logfile</span>
<span style="color: #007800;">LOGFILE</span>=<span style="color: #ff0000;">&quot;/var/log/<span style="color: #007800;">${PREFIX}</span>backup.log&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## &lt;/Configuration&gt;</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$OUTDIR</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">## Set prozess priority</span>
	renice <span style="color: #660033;">-19</span> <span style="color: #660033;">-p</span> <span style="color: #007800;">$$</span> <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$LOGFILE</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">## Set I/O priority</span>
	ionice <span style="color: #660033;">-c2</span> <span style="color: #660033;">-n1</span> <span style="color: #660033;">-p</span> <span style="color: #007800;">$$</span> <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$LOGFILE</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">## Date and time</span>
	<span style="color: #007800;">DATE</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> <span style="color: #ff0000;">&quot;+%Y-%m-%d-%H-%M-%S&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">## Create and enter working dir</span>
	<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #800000;">${WORKINGDIR}</span><span style="color: #800000;">${PREFIX}</span><span style="color: #800000;">${DATE}</span>
	<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #800000;">${WORKINGDIR}</span><span style="color: #800000;">${PREFIX}</span><span style="color: #800000;">${DATE}</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">## Save version</span>
	<span style="color: #c20cb9; font-weight: bold;">uname</span> <span style="color: #660033;">-a</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;uname.txt&quot;</span>
	<span style="color: #007800;">TOBACKUP</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${TOBACKUP}</span> uname.txt&quot;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">## Create a list with installed deb pakets</span>
	<span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">--get-selections</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;deb.list&quot;</span>
	<span style="color: #007800;">TOBACKUP</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${TOBACKUP}</span> deb.list&quot;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">## Create MySQL dump environment</span>
	<span style="color: #c20cb9; font-weight: bold;">mkdir</span> mysqldumps<span style="color: #000000; font-weight: bold;">/</span>
	<span style="color: #007800;">TOBACKUP</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${TOBACKUP}</span> mysqldumps/&quot;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">## Create MySQL dumps from all databases</span>
	<span style="color: #007800;">DBS</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$(mysql  -h $MYSQLHOST -u $MYSQLUSER -p$MYSQLPASS -Bse 'show databases' 2&gt;&gt; $LOGFILE)</span>&quot;</span>	
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">## Delete temporary files</span>
		<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-r</span> <span style="color: #800000;">${WORKINGDIR}</span><span style="color: #800000;">${PREFIX}</span><span style="color: #800000;">${DATE}</span>
		<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
	<span style="color: #000000; font-weight: bold;">for</span> DB <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$DBS</span>; <span style="color: #000000; font-weight: bold;">do</span>
		mysqldump <span style="color: #660033;">-h</span> <span style="color: #007800;">$MYSQLHOST</span> <span style="color: #660033;">-u</span> <span style="color: #007800;">$MYSQLUSER</span> -p<span style="color: #007800;">$MYSQLPASS</span> <span style="color: #007800;">$DB</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;mysqldumps/<span style="color: #007800;">${DB}</span>.sql&quot;</span>
	<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">## Exclude dirs</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$TOEXCLUDE</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
&nbsp;
		<span style="color: #007800;">TOEXCLUDE</span>=<span style="color: #ff0000;">&quot;--exclude <span style="color: #007800;">${TOEXCLUDE}</span>&quot;</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">## Compress and / or encrypt files</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$BACKUPPASS</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>	
&nbsp;
		<span style="color: #007800;">VAR_EXTENSION</span>=<span style="color: #ff0000;">&quot;.tar.bz2.gpg&quot;</span>
		<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-cf</span> - <span style="color: #007800;">$TOBACKUP</span> <span style="color: #007800;">$TOEXCLUDE</span> <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000; font-weight: bold;">|</span> gpg <span style="color: #660033;">--symmetric</span> <span style="color: #660033;">--bzip2-compress-level</span> <span style="color: #000000;">9</span> <span style="color: #660033;">--passphrase</span> <span style="color: #800000;">${BACKUPPASS}</span>  <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${PREFIX}</span><span style="color: #007800;">${DATE}</span><span style="color: #007800;">${VAR_EXTENSION}</span>&quot;</span>
	<span style="color: #000000; font-weight: bold;">else</span>
&nbsp;
		<span style="color: #007800;">VAR_EXTENSION</span>=<span style="color: #ff0000;">&quot;.tar.bz2&quot;</span>
		<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-cf</span> - <span style="color: #007800;">$TOBACKUP</span> <span style="color: #007800;">$TOEXCLUDE</span> <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">bzip2</span> <span style="color: #660033;">-c</span> <span style="color: #660033;">--best</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${PREFIX}</span><span style="color: #007800;">${DATE}</span><span style="color: #007800;">${VAR_EXTENSION}</span>&quot;</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$FTPHOST</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$FTPUSER</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$FTPPASS</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">## Save backup on FTP server</span>
		ncftpput <span style="color: #660033;">-u</span> <span style="color: #007800;">$FTPUSER</span> <span style="color: #660033;">-p</span> <span style="color: #007800;">$FTPPASS</span> <span style="color: #007800;">$FTPHOST</span> <span style="color: #007800;">$OUTDIR</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${PREFIX}</span><span style="color: #007800;">${DATE}</span><span style="color: #007800;">${VAR_EXTENSION}</span>&quot;</span> <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$LOGFILE</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">else</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">## Save backup lokal</span>
		<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${PREFIX}</span><span style="color: #007800;">${DATE}</span><span style="color: #007800;">${VAR_EXTENSION}</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$OUTDIR</span>&quot;</span> <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$LOGFILE</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">## Delete temporary files</span>
	<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-r</span> <span style="color: #800000;">${WORKINGDIR}</span><span style="color: #800000;">${PREFIX}</span><span style="color: #800000;">${DATE}</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>		
		<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
	<span style="color: #000000; font-weight: bold;">else</span>	
		<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">else</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Error: Output dir is empty&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$LOGFILE</span> 
	<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div><p>Der Name des komprimierten Backups setzt sich wie folgt zusammen: %Präfix%%Jahr%-%Monat%-%Tag%-%Stunde%-%Minute%-%Sekunde%.tar.bz2. Die Log Datei des Scripts findest du unter /var/log/%Präfix%backup.log. Enthalten sind dort Statistiken und Fehler zur FTP Übertragung sowie kritische Konfigurationsfehler.</p><p>Im Script werden Prozess und I/O Priorität angepasst um den Server nicht an seiner regulären Arbeit zu hindern. Beachte dabei das ein Ausführen von nice nur mit root Rechten möglich ist.</p><p>Mögliche Probleme mit Paketabhängigkeiten sollten sich nach dem erfolgreichen ausführen dieses Befehls erledigt haben:</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> ncftp <span style="color: #c20cb9; font-weight: bold;">bzip2</span> gnupg</pre></div></div><p>Sowohl date als auch tar, nice, ionice dpkg und mysql / mysqldump sind normalerweise auf dem Server vorhanden.</p><p>Bei Fragen oder Problemen scheue nicht die Kommentarfunktion zu verwenden.</p> ]]></content:encoded> <wfw:commentRss>http://www.monkey-business.biz/282/debian-backup-mittels-paketlisten-mysql-dumps-ftp-upload/feed/</wfw:commentRss> <slash:comments>14</slash:comments> </item> <item><title>Debian: mittels dpkg prüfen ob deb Paket installiert</title><link>http://www.monkey-business.biz/692/debian-mittels-dpkg-prufen-ob-deb-paket-installiert/</link> <comments>http://www.monkey-business.biz/692/debian-mittels-dpkg-prufen-ob-deb-paket-installiert/#comments</comments> <pubDate>Sat, 06 Mar 2010 17:25:56 +0000</pubDate> <dc:creator>Loaden</dc:creator> <category><![CDATA[Belästigung der Allgemeinheit - mein privater Weblog]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[dpkg]]></category> <category><![CDATA[Shell]]></category> <category><![CDATA[Ubuntu]]></category><guid isPermaLink="false">http://www.monkey-business.biz/?p=692</guid> <description><![CDATA[In diesem Artikel veröffentliche ich ein Script, das es schnell und einfach ermöglicht zu prüfen ob ein Paket installiert ist. Dieses Script kann auf allen Distributionen die den Debian Package Manager (kurz dpkg) als Programm zur Paketverwaltung verwenden eingesetzt werden. Auf jeden Fall ist es also auf Debian und Ubuntu funktional. Es wird mit Hilfe [...]]]></description> <content:encoded><![CDATA[<p>In diesem Artikel veröffentliche ich ein Script, das es schnell und einfach ermöglicht zu prüfen ob ein Paket installiert ist. Dieses Script kann auf allen Distributionen die den Debian Package Manager (kurz dpkg) als Programm zur Paketverwaltung verwenden eingesetzt werden. Auf jeden Fall ist es also auf Debian und Ubuntu funktional. Es wird mit Hilfe von dpkg und grep geprüft ob ein deb Paket den Suchstring im Namen hat.</p><p>Der Inhalt meines Scriptes dpkgcheck.sh:</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/sh</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Author: Tobias Jäck</span>
<span style="color: #666666; font-style: italic;">## License: GPL version 3</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">--get-selections</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #660033;">-n</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;$1&quot;</span>
	<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span>
<span style="color: #000000; font-weight: bold;">else</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;#<span style="color: #000099; font-weight: bold;">\n</span># dpkgcheck.sh - searchs installed deb pakages<span style="color: #000099; font-weight: bold;">\n</span># Usage: ./dpkgcheck.sh &lt;name&gt; <span style="color: #000099; font-weight: bold;">\n</span>#&quot;</span>
	<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div><p>Sollte das Script keine Ausgabe haben ist kein Paket installiert das den erforderlichen Suchstring im Paketname hat. Vergesst nicht dem Script vor dem Ausführen x zu geben (chmod +x &lt;name&gt;).</p> ]]></content:encoded> <wfw:commentRss>http://www.monkey-business.biz/692/debian-mittels-dpkg-prufen-ob-deb-paket-installiert/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 3/14 queries in 0.006 seconds using disk: basic

Served from: www.monkey-business.biz @ 2012-02-05 02:09:50 -->
