<?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>johker&#039;s blog &#187; phpPgAdmin</title>
	<atom:link href="http://johker.ibutho.de/tag/phppgadmin/feed/" rel="self" type="application/rss+xml" />
	<link>http://johker.ibutho.de</link>
	<description>stories about me, my life and my trips</description>
	<lastBuildDate>Sun, 18 Dec 2011 11:53:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Der neue Server: Teil 3 svn, mysql, postgres</title>
		<link>http://johker.ibutho.de/2009/03/20/der-neue-server-teil-3-svn-mysql-postgres/</link>
		<comments>http://johker.ibutho.de/2009/03/20/der-neue-server-teil-3-svn-mysql-postgres/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 15:29:35 +0000</pubDate>
		<dc:creator>johker</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[acid]]></category>
		<category><![CDATA[createuser]]></category>
		<category><![CDATA[dokumentation]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[konfiguration]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql_secure_installation]]></category>
		<category><![CDATA[o'reilly]]></category>
		<category><![CDATA[pg_hba.conf]]></category>
		<category><![CDATA[phpMyAdmin]]></category>
		<category><![CDATA[phpPgAdmin]]></category>
		<category><![CDATA[postgres]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[postgresql.conf]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[rootforum]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[services]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[svnadmin]]></category>
		<category><![CDATA[telnet]]></category>
		<category><![CDATA[xinetd]]></category>

		<guid isPermaLink="false">http://johker.ibutho.de/?p=141</guid>
		<description><![CDATA[Mit diesem Beitrag beginnt nun eine kleine Reihe, wie man verschiedene Serverdienste installiert und konfiguriert. Angefangen wird mit dem Versionskontrollsystem svn (auch unter dem Namen subversion bekannt) und zwei verschiedenen Datenbanksystemen: mysql und postgreSQL. subversion SVN wird über den Internet-Superserver &#8230; <a href="http://johker.ibutho.de/2009/03/20/der-neue-server-teil-3-svn-mysql-postgres/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Mit diesem Beitrag beginnt nun eine kleine Reihe, wie man verschiedene Serverdienste installiert und konfiguriert. Angefangen wird mit dem Versionskontrollsystem <em>svn</em> (auch unter dem Namen <em>subversion</em> bekannt) und zwei verschiedenen Datenbanksystemen: <em>mysql</em> und <em>postgreSQL</em>.</p>
<h1>subversion</h1>
<p>SVN wird über den Internet-Superserver <em>xinetd</em> betrieben und hört standardmäßig auf Port 3690. Die Repositories samt ihrer Konfigurationsdateien werden später unter &#8220;<em>/var/svn</em>&#8221; liegen und der Server wird unter dem Benutzer &#8220;<em>svn</em>&#8221; laufen.</p>
<p>Zunächst installieren wir xinetd und svn:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> xinetd subversion</pre></div></div>

<p>Danach erstellen wir den svn-Benutzer:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">adduser <span style="color: #660033;">--system</span> <span style="color: #660033;">--group</span> <span style="color: #660033;">--no-create-home</span> <span style="color: #c20cb9; font-weight: bold;">svn</span></pre></div></div>

<p>Jetzt registrieren wir Port 3690 für svn:</p>
<p><em>/etc/services</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Local services</span>
<span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #000000;">3690</span><span style="color: #000000; font-weight: bold;">/</span>tcp <span style="color: #666666; font-style: italic;"># subversion</span>
<span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #000000;">3690</span><span style="color: #000000; font-weight: bold;">/</span>udp <span style="color: #666666; font-style: italic;"># subversion</span></pre></div></div>

<p>&#8230; erstellen den Ordner &#8220;/var/svn&#8221;:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #c20cb9; font-weight: bold;">svn</span>: <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">755</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>&#8230; und konfigurieren xinetd, damit er auf Port 3690 Verbindungen für <em>svn</em> entgegennimmt und sie an den <em>svnserve</em>-Server weitergibt:</p>
<p><em>/etc/xinetd.d/svn</em></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># default: on</span>
<span style="color: #666666; font-style: italic;"># description: Subversion server process</span>
service <span style="color: #c20cb9; font-weight: bold;">svn</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
    disable             = no
    socket_type         = stream
    protocol            = tcp
    user                = <span style="color: #c20cb9; font-weight: bold;">svn</span>
    <span style="color: #7a0874; font-weight: bold;">wait</span>                = no
    port                = <span style="color: #000000;">3690</span>
    server              = <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><span style="color: #c20cb9; font-weight: bold;">svnserve</span>
    server_args         = <span style="color: #660033;">-i</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p>Nun kann man mit dem <em>telnet</em>-Befehl von einem anderen Rechner aus testen, ob <em>svn</em> auf Port 3690 lauscht:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">telnet SERVER_IP <span style="color: #000000;">3690</span></pre></div></div>

<p>Die Ausgabe sollte dann so aussehn:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Trying SERVER_IP...
Connected to SERVER_IP.
Escape character is <span style="color: #ff0000;">'^]'</span>.
<span style="color: #7a0874; font-weight: bold;">&#40;</span> success <span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">2</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span> edit-pipeline svndiff1 absent-entries commit-revprops depth log-revprops partial-replay <span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span> Connection closed by foreign host.</pre></div></div>

<p>Mittels des <em>svnadmin</em>-Tools kann man nun Repositories anlegen, verändern, löschen, &#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svnadmin</span> create <span style="color: #660033;">--fs-type</span> fsfs <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>testRepo</pre></div></div>

<p>Was man mit <em>svn</em> alles anstellen kann, wird hier sehr ausführlich beschrieben: <a href="http://svnbook.red-bean.com/" target="_blank">http://svnbook.red-bean.com/</a>. Dieses Buch ist wohl das Standardwerk, wenn es um <em>svn</em> geht und ein weiterer Stern am O&#8217;Reilly-Himmel und das Tollste ist: die Online-Version kostet nicht einmal was.</p>
<h1>mysql</h1>
<p>Man mag von <em>mysql</em> halten, was man will, doch es ist (leider) das Standard-Datenbanksystem für Web-Anwendungen (ein paar Gedanken zu <em>mysql</em> kann man <a href="http://forum.rootforum.de/viewtopic.php?f=104&#038;t=50167" target="_blank">hier</a> finden). Der Vorteil von <em>mysql</em> ist, dass es sehr einfach in der Installation und Handhabung ist, die Nachteile&#8230;. naja, findets selbst heraus.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> mysql-server</pre></div></div>

<p>Während der Installation wird man nach einem Passwort für den <em>mysql</em>-root Benutzer gefragt. Danach kann man ggf. noch die Konfiguration anpassen (liegt unter &#8220;<em>/etc/mysql/my.cnf</em>&#8220;). Ein gutes Beispiel für eine <em>mysql</em>-Konfiguration kann man hier finden: <a href="http://forum.rootforum.de/viewtopic.php?f=104&#038;t=36343" target="_blank">http://forum.rootforum.de/viewtopic.php?f=104&#038;t=36343</a>. Eine Anmerkung: wenn man die empfohlene Konfiguration auf <a href="http://forum.rootforum.de/" target="_blank">rootforum.de</a> benutzt und über phpMyAdmin auf die Datenbank zugreifen will, sollte man die Zeile &#8220;skip_show_database&#8221; auskommentieren, ansonsten sehen die Benutzer (root ausgenommen) ihre Datenbanken nicht.</p>
<p>Da wir nicht nur eine optimierte Installation, sondern auch eine sichere wollen, führen wir nun noch das &#8220;mysql_secure_installation&#8221;-Skript aus und beantworten alle Fragen, abgesehen von der über das <em>mysql</em>-root Passwort, mit der Standardantwort.</p>
<p>Quellen:</p>
<p><a href="http://forum.rootforum.de/viewtopic.php?f=104&#038;t=36343" target="_blank">http://forum.rootforum.de/viewtopic.php?f=104&#038;t=36343</a></p>
<h1>postgres</h1>
<p>Kommen wir zu einem richtigen Datenbanksystem: <em>postgres</em>. <em>postgres</em> ist ein freies, quelloffenes (open-source auf &#8220;Neudeutsch&#8221;) Datenbanksystem, welches komplett ANSI-SQL92 konform ist (das kann manch kommerzielles Datenbanksystem nicht einmal von sich behaupten), unterstützt unter anderem ACID-Transaktionen und Stored Procedures und weitere fortgeschrittene Datenbank-Konzepte. Es erfreut sich einer immer größer werdenden Beliebtheit und löst <em>mysql</em> in vielen Gebieten ab. Dennoch will ich hier nicht zu viel Werbung machen. Jeder sollte sich selbst Gedanken über das Datenbanksystem machen, das er einsetzt und warum er es einsetzt. Doch wenn man ein Projekt hochziehen will, bei dem man auf fortschrittliche Datenbank-Konzepte zurückgreift, bleiben im open-source Umfeld nicht viele Lösungen übrig.<br />
Die Installation gestaltet sich ähnlich einfach wie bei <em>mysql</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> postgresql-<span style="color: #000000;">8.3</span></pre></div></div>

<p>Die Konfiguration gestaltet sich etwas anders als die von <em>mysql</em>. Sie ist im wesentlichen mehr an Oracle angelehnt. Über die Datei &#8220;pg_hba.conf&#8221; kann man Zugriffsrechte vergeben. Wenn man einen Benutzer anlegt, wird standardmäßig auch eine Datenbank mit dem selben Namen erstellt, autoincrement-Werte werden etwas anders definiert als bei <em>mysql</em>, des Weiteren heißen einige Datentypen geringfügig anders, doch die postgres-Dokumentation hilft hier weiter: <a href="http://www.postgresql.org/docs/current/static/" target="_blank">http://www.postgresql.org/docs/current/static/</a>.<br />
Beispielhaft hier noch Code, wie man einen Benutzer anlegen kann:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">su</span> - postgres
createuser <span style="color: #660033;">-P</span></pre></div></div>

<p>Danach wird man nach dem Passwort und der Benutzerrolle gefragt und man kann mit folgendem Code auf die postgres-Konsole zugreifen:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">psql <span style="color: #660033;">-W</span> <span style="color: #000000; font-weight: bold;">&lt;</span>Tabellenname<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>In einem weiteren Teil gehe ich dann darauf ein, wie man phpMyAdmin und phpPgAdmin einrichtet.</p>
]]></content:encoded>
			<wfw:commentRss>http://johker.ibutho.de/2009/03/20/der-neue-server-teil-3-svn-mysql-postgres/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

