<?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>{ Berbagi, Menulis, Dan Mengajar } Ilmu... &#187; File Config</title>
	<atom:link href="http://dimas.ubhara.id/category/file-config/feed/" rel="self" type="application/rss+xml" />
	<link>http://dimas.ubhara.id</link>
	<description>sampaikanlah ilmu walau satu ayat</description>
	<lastBuildDate>Thu, 23 Apr 2026 07:19:12 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1.1</generator>
	<item>
		<title>Protected: Dokumen API Rest 2020 Bank Jatim</title>
		<link>http://dimas.ubhara.id/2020/08/dokumen-api-rest-2020-bank-jatim/</link>
		<comments>http://dimas.ubhara.id/2020/08/dokumen-api-rest-2020-bank-jatim/#comments</comments>
		<pubDate>Mon, 10 Aug 2020 01:57:36 +0000</pubDate>
		<dc:creator><![CDATA[dms]]></dc:creator>
				<category><![CDATA[File Config]]></category>

		<guid isPermaLink="false">http://dimas.ubhara.id/?p=9733</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
				<content:encoded><![CDATA[<form action="http://dimas.ubhara.id/wp-login.php?action=postpass" class="post-password-form" method="post">
<p>This content is password protected. To view it please enter your password below:</p>
<p><label for="pwbox-9733">Password: <input name="post_password" id="pwbox-9733" type="password" size="20" /></label> <input type="submit" name="Submit" value="Submit" /></p>
</form>
]]></content:encoded>
			<wfw:commentRss>http://dimas.ubhara.id/2020/08/dokumen-api-rest-2020-bank-jatim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cara Install HTTPS / SSL di Nginx</title>
		<link>http://dimas.ubhara.id/2020/03/cara-install-https-ssl-di-nginx/</link>
		<comments>http://dimas.ubhara.id/2020/03/cara-install-https-ssl-di-nginx/#comments</comments>
		<pubDate>Sun, 15 Mar 2020 15:08:52 +0000</pubDate>
		<dc:creator><![CDATA[dms]]></dc:creator>
				<category><![CDATA[File Config]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://dimas.ubhara.id/?p=8916</guid>
		<description><![CDATA[InstallHTTPSdiNginx
]]></description>
				<content:encoded><![CDATA[<p><a href="http://dimas.ubhara.id/wp-content/uploads/2020/03/InstallHTTPSdiNginx.rar">InstallHTTPSdiNginx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dimas.ubhara.id/2020/03/cara-install-https-ssl-di-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuration Nginx</title>
		<link>http://dimas.ubhara.id/2011/12/configuration-nginx/</link>
		<comments>http://dimas.ubhara.id/2011/12/configuration-nginx/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 06:57:32 +0000</pubDate>
		<dc:creator><![CDATA[dms]]></dc:creator>
				<category><![CDATA[File Config]]></category>

		<guid isPermaLink="false">http://dimas.ubhara.id/?p=1568</guid>
		<description><![CDATA[Config_nginx
]]></description>
				<content:encoded><![CDATA[<p><a href="http://dimas.ubhara.id/wp-content/uploads/2011/12/Config_nginx.txt">Config_nginx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dimas.ubhara.id/2011/12/configuration-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Penting Tagihan Telkom  Speedy</title>
		<link>http://dimas.ubhara.id/2011/11/ini-penting-tagihan-telkom-speedy-dan-telephon/</link>
		<comments>http://dimas.ubhara.id/2011/11/ini-penting-tagihan-telkom-speedy-dan-telephon/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 21:19:53 +0000</pubDate>
		<dc:creator><![CDATA[dms]]></dc:creator>
				<category><![CDATA[File Config]]></category>

		<guid isPermaLink="false">http://dimas.ubhara.id/?p=1514</guid>
		<description><![CDATA[telkom_jul_2011
telkom_agu_2011
telkom_sep_2011
]]></description>
				<content:encoded><![CDATA[<p><a href="http://dimas.ubhara.id/wp-content/uploads/2011/11/telkom_jul_20111.pdf">telkom_jul_2011</a></p>
<p><a href="http://dimas.ubhara.id/wp-content/uploads/2011/11/telkom_agu_20111.pdf">telkom_agu_2011</a></p>
<p><a href="http://dimas.ubhara.id/wp-content/uploads/2011/11/telkom_sep_20112.pdf">telkom_sep_2011</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dimas.ubhara.id/2011/11/ini-penting-tagihan-telkom-speedy-dan-telephon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>at mail dan modifikasinya</title>
		<link>http://dimas.ubhara.id/2011/03/at-mail-dan-modifikasinya/</link>
		<comments>http://dimas.ubhara.id/2011/03/at-mail-dan-modifikasinya/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 17:02:18 +0000</pubDate>
		<dc:creator><![CDATA[dms]]></dc:creator>
				<category><![CDATA[File Config]]></category>

		<guid isPermaLink="false">http://dimas.ubhara.id/?p=1213</guid>
		<description><![CDATA[Step 1 &#8211; Create A Database
First we need to create a database for Atmail.

 Open up ISPConfig and go to Sites.
 Select Database from the sub-navigation menu on the left.
 Click on Add new Database
 Create a Database name, Database user and a Database password

&#160;
Step 2 &#8211; Backup Squirrelmail
Just in case it all goes wrong &#8211; we need to backup Squirrelmail.
cd /usr/share
mv squirrelmail squirrelmail.bak
mkdir squirrelmail
&#160;
Step 3 -Download, Unpack And Remove Unnecessary Files
I was unable to get the latest version of Atmail open to work with my  setup. For the purpose of this tutorial; we will be using v1.01 &#8211; Please  feel free to let me know if you find a way to get the latest version  working.
cd squirrelmail
wget http://downloads.sourceforge.net/atmailopen/atmailopen-1.01.tgz
tar xvfz atmailopen-1.01.tgz
cd atmailopen
mv * ../
cd ../
rm â€“r atmailopen
rm atmailopen-1.01.tgz
&#160;
Step 4 &#8211; Make Atmail Open Writeable For Apache
chown â€“R [Apache-user] /usr/share/squirrelmail
Please note: On Debian systems, replace [Apache-user] with www-data. ...]]></description>
				<content:encoded><![CDATA[<h3>Step 1 &#8211; Create A Database</h3>
<p>First we need to create a database for Atmail.</p>
<ul>
<li> Open up ISPConfig and go to <strong>Sites</strong>.</li>
<li> Select <strong>Database</strong> from the sub-navigation menu on the left.</li>
<li> Click on <strong>Add new Database</strong></li>
<li> Create a <strong>Database name</strong>, <strong>Database user</strong> and a <strong>Database password</strong></li>
</ul>
<p>&nbsp;</p>
<h3>Step 2 &#8211; Backup Squirrelmail</h3>
<p>Just in case it all goes wrong &#8211; we need to backup Squirrelmail.</p>
<p>cd /usr/share<br />
mv squirrelmail squirrelmail.bak<br />
mkdir squirrelmail</p>
<p>&nbsp;</p>
<h3>Step 3 -Download, Unpack And Remove Unnecessary Files</h3>
<p>I was unable to get the latest version of Atmail open to work with my  setup. For the purpose of this tutorial; we will be using v1.01 &#8211; Please  feel free to let me know if you find a way to get the latest version  working.</p>
<p>cd squirrelmail<br />
wget http://downloads.sourceforge.net/atmailopen/atmailopen-1.01.tgz<br />
tar xvfz atmailopen-1.01.tgz<br />
cd atmailopen<br />
mv * ../<br />
cd ../<br />
rm â€“r atmailopen<br />
rm atmailopen-1.01.tgz</p>
<p>&nbsp;</p>
<h3>Step 4 &#8211; Make Atmail Open Writeable For Apache</h3>
<p>chown â€“R [Apache-user] /usr/share/squirrelmail</p>
<p>Please note: On Debian systems, replace [Apache-user] with www-data. The Apache user on other Linux distributions might be different.</p>
<p>&nbsp;</p>
<h3>Step 5 &#8211; Install Atmail Open To Your Server</h3>
<p>In your preferred browser, go to http://yourdomain.tld/webmail. You&#8217;ll be required to read the on-screen instructions and read the licence agreement. Providing you accept you can continue!</p>
<p>&nbsp;</p>
<h3>Step 6 &#8211; Connect To The Database</h3>
<p>In Step 1 we created a database in ISPConfig and we&#8217;re now need to enter the details into the AtMail Open&#8230;</p>
<p><img title="Connect to the database" src="http://static.howtoforge.com/images/changing_from_squirrelmail_to_atmail_open_with_ispconfig_3/pic2.gif" alt="Connect to the database" width="375" height="279" /></p>
<p>&nbsp;</p>
<h3>Step 7 &#8211; Define The SMTP Host</h3>
<p>Enter the SMTP Host (in this example we assume it is localhost).  Whether or not you require Authentication (e.g. if you need to use a  mail relayer to send e-mail) and an Administrator E-mail Address.</p>
<p><img title="SMTP Host" src="http://static.howtoforge.com/images/changing_from_squirrelmail_to_atmail_open_with_ispconfig_3/pic3.gif" alt="SMTP Host" width="362" height="144" /></p>
<p>&nbsp;</p>
<h3>Step 8 &#8211; Import Data From SquirrelMail (Or Another Webmail System)</h3>
<p>At this step, you have the possibility to import data from other popular  webmail systems. Should you decide to do this, please select  Squirremail and enter the database connetion settings and click  &#8216;Continue&#8217;</p>
<p><img title="Import data" src="http://static.howtoforge.com/images/changing_from_squirrelmail_to_atmail_open_with_ispconfig_3/pic4.gif" alt="Import data" width="202" height="112" /></p>
<p>&nbsp;</p>
<h3>Step 9 &#8211; All done! Log In To Atmail Open</h3>
<p>You can now log in to your new Atmail Open Webmail system! It&#8217;s all good  to go from here but if you like, follow Step 10 to customise your login  screen.</p>
<p><img title="Login to Atmail" src="http://static.howtoforge.com/images/changing_from_squirrelmail_to_atmail_open_with_ispconfig_3/pic5.gif" alt="Login to Atmail" width="456" height="326" /></p>
<p>&nbsp;</p>
<h3>Step 10 &#8211; Customise The Login Screen</h3>
<p>In this step we will cover how to remove the <strong>Mailserver</strong>, <strong>Language</strong> and <strong>Protocol</strong> fields from the login screen and define default settings so we don&#8217;t need to input them manually everytime we login.</p>
<p>vi /usr/share/squirrelmail/html/login-light.html</p>
<p>Find the lines below and edit accordingly&#8230;</p>
<p><strong>Login Header / Title text</strong></p>
<pre>&lt; td &gt;Webmail Access&lt; /td &gt;</pre>
<p><strong>Instructions to login / Custom Message</strong></p>
<pre>&lt; td &gt;&lt; div id="AuthStatus" style="padding-left: 4px;" &gt;Please provide your username and password.&lt; /div &gt;&lt; /td &gt;</pre>
<p><strong>Hide &#8216;Mailserver; field from login page and set default to &#8216;localhost&#8217;</strong></p>
<p>Find&#8230;</p>
<pre>&lt; tr id="mailserver" &gt;</pre>
<p>And change to&#8230;</p>
<pre>&lt; tr id="mailserver" <strong>style="display:none;"</strong> &gt;</pre>
<p>Find&#8230;</p>
<pre>&lt; td align="left" &gt;&lt; input name="MailServer" type="text" id="MailServer"&gt;&lt; /td &gt;</pre>
<p>And change to&#8230;</p>
<pre>&lt; td align="left" &gt;&lt; input name="MailServer" type="text" id="MailServer" <strong>value="localhost"</strong> &gt;&lt; /td &gt;</pre>
<p><strong> Hide protocol from login page </strong></p>
<p>Find&#8230;</p>
<pre>&lt; tr id="protocol" &gt;</pre>
<p>And change to&#8230;</p>
<pre>&lt; tr id="protocol" <strong>style="display:none;"</strong> &gt;</pre>
<p><strong>Hide Language from login page</strong></p>
<p>Find&#8230;</p>
<pre>&lt; tr &gt;
     &lt; td &gt; &lt; /td &gt;
     &lt; td colspan="2" align="right" &gt;Language:&lt; /td &gt;</pre>
<p>And change the &lt; tr &gt; tag to&#8230;</p>
<pre>&lt; tr <strong>style="display:none;"</strong> &gt;</pre>
<p>Please let me know if you have any suggestions to improve this tutorial&#8230; Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://dimas.ubhara.id/2011/03/at-mail-dan-modifikasinya/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protected: Akses Ke Traffic View DNET</title>
		<link>http://dimas.ubhara.id/2008/07/akses-ke-traffic-view-dnet/</link>
		<comments>http://dimas.ubhara.id/2008/07/akses-ke-traffic-view-dnet/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 04:30:53 +0000</pubDate>
		<dc:creator><![CDATA[dms]]></dc:creator>
				<category><![CDATA[File Config]]></category>

		<guid isPermaLink="false">http://blog.ptpn-xi.com/?p=230</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
				<content:encoded><![CDATA[<form action="http://dimas.ubhara.id/wp-login.php?action=postpass" class="post-password-form" method="post">
<p>This content is password protected. To view it please enter your password below:</p>
<p><label for="pwbox-230">Password: <input name="post_password" id="pwbox-230" type="password" size="20" /></label> <input type="submit" name="Submit" value="Submit" /></p>
</form>
]]></content:encoded>
			<wfw:commentRss>http://dimas.ubhara.id/2008/07/akses-ke-traffic-view-dnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Manajemen Bandwidth Di Squid Menggunakan Delay Pools</title>
		<link>http://dimas.ubhara.id/2008/03/manajemen-bandwidth-di-squid-menggunakan-delay-pools/</link>
		<comments>http://dimas.ubhara.id/2008/03/manajemen-bandwidth-di-squid-menggunakan-delay-pools/#comments</comments>
		<pubDate>Fri, 14 Mar 2008 03:58:57 +0000</pubDate>
		<dc:creator><![CDATA[dms]]></dc:creator>
				<category><![CDATA[File Config]]></category>

		<guid isPermaLink="false">http://blog.ptpn-xi.com/?p=131</guid>
		<description><![CDATA[Dokumen ini menjelaskan bagaimana cara mengkonfigurasikan proxy server anda untuk membatasi bandwidth download atau incoming traffic.
Berikut langkah-langkah pengkonfigurasian manajemen bandwidth di squid:
1. Pertama-tama periksa apakah squid telah berjalan di server dan telah dikonfiguraisi sebagai mesin proxy server.
2. Sebelum memulai memanajemen bandwidth di squid, kita jelaskan dulu komponen-komponen manajement bandwidth di squid :
delay_pools
Opsi ini untuk menspesifikasi berapa jumlah pool yang digunakan untuk membatasi jumlah bandwidth dari ACL. Opsi ini akan dirangkaikan bersama opsi delay_class dan delay_parameters yang akan dibahas di bawah ini.
delay_class
Opsi ini menspesifikasikan kelompok dari masing-masing pool yang telah didefinisikan pada opsi delay-pools. Ada tiga class yang didukung Squid, antara lain:
â€¢ class 1: Semua akses dibatasi dengan single bucket, artinya hanya bisa mendefinisikan overall bandwidth untuk suatu ACL saja, tidak bisa mendefinisikan bandwidth dengan lebih mendetail
â€¢ class 2: Semua akses dibatasi dengan single agregate dengan dua parameter bandwidth. Parameter pertama mendefinisikan berapa bandwidth maksimal yang didapatkan ACL, parameter kedua mendefinisikan ...]]></description>
				<content:encoded><![CDATA[<p>Dokumen ini menjelaskan bagaimana cara mengkonfigurasikan proxy server anda untuk membatasi bandwidth download atau incoming traffic.<br />
Berikut langkah-langkah pengkonfigurasian manajemen bandwidth di squid:<br />
1. Pertama-tama periksa apakah squid telah berjalan di server dan telah dikonfiguraisi sebagai mesin proxy server.<br />
2. Sebelum memulai memanajemen bandwidth di squid, kita jelaskan dulu komponen-komponen manajement bandwidth di squid :</p>
<p>delay_pools<br />
Opsi ini untuk menspesifikasi berapa jumlah pool yang digunakan untuk membatasi jumlah bandwidth dari ACL. Opsi ini akan dirangkaikan bersama opsi delay_class dan delay_parameters yang akan dibahas di bawah ini.</p>
<p>delay_class<br />
Opsi ini menspesifikasikan kelompok dari masing-masing pool yang telah didefinisikan pada opsi delay-pools. Ada tiga class yang didukung Squid, antara lain:<br />
â€¢ class 1: Semua akses dibatasi dengan single bucket, artinya hanya bisa mendefinisikan overall bandwidth untuk suatu ACL saja, tidak bisa mendefinisikan bandwidth dengan lebih mendetail<br />
â€¢ class 2: Semua akses dibatasi dengan single agregate dengan dua parameter bandwidth. Parameter pertama mendefinisikan berapa bandwidth maksimal yang didapatkan ACL, parameter kedua mendefinisikan berapa bandwidth overall untuk ACL yang spesifik yang ada pada network tersebut.<br />
â€¢ class 3: Kelompok yang definisi bandwidth-nya paling mendetail. Parameter pertama mendefinisikan berapa bandwidth maksimal yang didapatkan ACL, parameter kedua mendefinisikan berapa bandwidth normal yang didapatkan ACL secara umum, dan parameter yang ketiga adalah mendefinisikan bandwidth yang didapatkan ACL jika mengakses ACL-ACL tertentu yang spesifik, misalnya file mp3.</p>
<p>delay_parameters<br />
Opsi ini menspesifikasikan rumus bandwidth yang akan didapatkan oleh ACL yang akan memasuki delay_pool. Misalnya ada entry berikut ini pada delay_parameters:<br />
delay_parameters 1 -1/-1 2100/4000<br />
Angka 1 berarti rumus ini berlaku untuk pool 1. Angka -1/-1 berarti bandwidth maksimal yang diberikan Squid adalah tidak terbatas untuk pool ini.</p>
<p>Angka 2100/4000 berarti bandwidth yang didapatkan oleh ACL setelah masuk ke pool ini. Angka ini berada dalam kelipatan 8 b, sehingga untuk mendapatkan nilai bandwidth yang sebenarnya harus dikalikan delapan. Angka 2100 adalah bandwidth yang didapatkan ACL pada masa-masa normal. Jika dikalikan 8, maka bandwidth normal yang akan didapatkan ACL sekitar 18 Kbps. Angka 4000 adalah bandwidth maksimal yang didapatkan ACL pada masa-masa jalur sedang kosong. Jika dikalikan 8, maka bandwidth yang didapatkan sekitar 32 Kbps.</p>
<p>delay_access<br />
Opsi ini mendefinisikan siapa-siapa ACL yang akan dimasukkan ke pool tertentu untuk mendapatkan â€œperlambatanâ€ bandwidth. Bentuk umumnya adalah seperti ini:<br />
delay_access 1 allow labprog<br />
Opsi di atas berarti kita memasukkan ACL labprog ke dalam pool 1.</p>
<p>3. Jika sudah mengerti komponen-komponen delay pool, kita mulai konfigurasi delay pool .<br />
Di umpamakan kita mempunyai bandwidth dari ISP sebesar 512kb, dan kita membuat rule seperti berikut ini:<br />
&#8211; Batas kecepatan koneksi overall adalah 256 Kbps. per-network adalah 64 kbps. Sedangkan per-user/host dibatasi 2 Kbps jika digunakan untuk download file bertipe exe, mp3, vqf, tar.gz, gz, rpm, zip, rar, avi, mpeg, mpe, mpg, qt, ram, rm, iso, raw, dan wav. Jika tidak, maka koneksi perhost HANYA mengikuti aturan per-Network saja.</p>
<p>Penyelesaian:</p>
<p>Edit file /etc/squid/squid.conf<br />
#vi /etc/squid/squid.confLalu tambahkan contoh konfigurasi ini:<br />
# Sebelum kita melakukan pembatasan, kita perlu mendefinisikan ACL network # # yang kita perlukan terlebih dahulu. ACL yang didefinisikan pada host bridge<br />
# seperti di bawah ini:acl lokal src 192.168.1.0/24# Kemudian kita membatasi maksimum download dengan tag di bawah ini:<br />
# Batas kecepatan koneksi overall adalah 256 Kbps. per-network adalah<br />
# 64 kbps. Sedangkan per-user/host dibatasi 2 Kbps jika digunakan untuk<br />
# download file bertipe exe, mp3, vqf, tar.gz, gz, rpm, zip, rar, avi,<br />
# mpeg, mpe, mpg, qt, ram, rm, iso, raw, dan wav. Jika tidak, maka<br />
# koneksi perhost HANYA mengikuti aturan per-Network saja.</p>
<p>acl filegede url_regex -i \.exe<br />
acl filegede url_regex -i \.mp3<br />
acl filegede url_regex -i \.vqf<br />
acl filegede url_regex -i \.gz<br />
acl filegede url_regex -i \.rpm<br />
acl filegede url_regex -i \.zip<br />
acl filegede url_regex -i \.rar<br />
acl filegede url_regex -i \.avi<br />
acl filegede url_regex -i \.mpeg<br />
acl filegede url_regex -i \.mpe<br />
acl filegede url_regex -i \.mpg<br />
acl filegede url_regex -i \.qt<br />
acl filegede url_regex -i \.ram<br />
acl filegede url_regex -i \.rm<br />
acl filegede url_regex -i \.iso<br />
acl filegede url_regex -i \.raw<br />
acl filegede url_regex -i \.wav</p>
<p># Kita buat dulu ACL untuk mendefinisikan file-file di atas dengan menggunakan # regularexpression. Kemudian kita mendefinisikan 2 delay pool untuk<br />
# menampung bandwidth.<br />
# Satu pool masuk dalam kategori class 2 untuk mendefinisikan aturan overall<br />
# 256 Kbps dan per-network 64 Kbps. Satu pool lainnya masuk kategori class 3<br />
# untuk mendefinisikan aturan tambahan jika user mendownload file-file yang<br />
#didefinisikan dalam ACL url_regex dengan bandwidth maksimal 2 Kbps.</p>
<p>delay_pools 2<br />
delay_class 1 3<br />
delay_parameters 1 32000/32000 8000/8000 250/250<br />
delay_access 1 allow lokal filegede<br />
delay_access 1 deny all<br />
delay_class 2 2<br />
delay_parameters 2 32000/32000 8000/8000<br />
delay_access 2 allow lokal<br />
delay_access 2 deny all</p>
<p>Jika sudah selesai, simpan hasil konfigurasi dan restart squid</p>
<p>#/etc/init.d/squid restart</p>
<p>Sumber : http://miji.wordpress.com/2007/02/06/57/#comment-21</p>
<p>Informasi Lengkap Dapat di lihat di : http://ezine.daemonnews.org/200209/squid.html</p>
]]></content:encoded>
			<wfw:commentRss>http://dimas.ubhara.id/2008/03/manajemen-bandwidth-di-squid-menggunakan-delay-pools/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Squid Inspiration</title>
		<link>http://dimas.ubhara.id/2008/03/squid-inspiration/</link>
		<comments>http://dimas.ubhara.id/2008/03/squid-inspiration/#comments</comments>
		<pubDate>Thu, 13 Mar 2008 10:44:37 +0000</pubDate>
		<dc:creator><![CDATA[dms]]></dc:creator>
				<category><![CDATA[File Config]]></category>
		<category><![CDATA[Free-BSD]]></category>

		<guid isPermaLink="false">http://blog.ptpn-xi.com/?p=129</guid>
		<description><![CDATA[Artikel ini sengaja saya kopikan langsung dari sumber aslinya dan tidak saya rubah sedikit pun, karena dari artikel ini saya terinspirasi dengan Linux dan  mengenal pertama kali dengan FreeBSD plus beberapa Feature Tunning yang dimiliki freeBSD. Terima Kasih buat yang telah menulis artikel ini. 

Andi Salimun &#60;asalimun@andix.info&#62;IntroductionThis article will explain how to configure Squid and tweak a FreeBSD box for web caching and conserving bandwidth. Usually, Squid will reduce the traffic 30% or more from normal usage (without squid), and enhance response time. 
This configuration and setting has been tested and the Squid FreeBSD boxes are running at several colleges in Sydney, Australia. Each Squid FreeBSD box serves about 100+ nodes. 
RequirementsSquid needs a lot of memory. More is better but 128 MB of memory is good to start with. Squid also needs fast disk storage. Use SCSI drives if you can, though IDE drives will do the job. ...]]></description>
				<content:encoded><![CDATA[<p>Artikel ini sengaja saya kopikan langsung dari sumber aslinya dan tidak saya rubah sedikit pun, karena dari artikel ini saya terinspirasi dengan Linux dan  mengenal pertama kali dengan FreeBSD plus beberapa Feature Tunning yang dimiliki freeBSD. Terima Kasih buat yang telah menulis artikel ini. </p>
<p><hr />
Andi Salimun &lt;<a href="mailto:asalimun@andix.info">asalimun@andix.info</a>&gt;<br />Introduction<br />This article will explain how to configure Squid and tweak a FreeBSD box for web caching and conserving bandwidth. Usually, Squid will reduce the traffic 30% or more from normal usage (without squid), and enhance response time. </p>
<p>This configuration and setting has been tested and the Squid FreeBSD boxes are running at several colleges in Sydney, Australia. Each Squid FreeBSD box serves about 100+ nodes. </p>
<p>Requirements<br />Squid needs a lot of memory. More is better but 128 MB of memory is good to start with. Squid also needs fast disk storage. Use SCSI drives if you can, though IDE drives will do the job. Also have a FreeBSD 4.5 box setup and running! You will need to recompile the kernel with additional options and components. </p>
<p>1. Installing Squid<br />You can install Squid using Ports but you can&rsquo;t play with configure options, so I&rsquo;ll cover the steps to install from a tarball. </p>
<p>You can download the Squid source from <a href="http://www.squid-cache.org/">http://www.squid-cache.org</a>. The lastest version is squid-2.4.STABLE6-src.tar.gz. Run the following commands as root. </p>
<p> # cd /path/to/tarball<br /> # tar zxvf squid-2.4.STABLE6-src.tar.gz<br /> # cd squid-2.4.STABLE6<br /> # ./configure &#8211;enable-delay-pools &#8211;enable-ipf-transparent &rsquo;<br />   &#8211;enable-storeio=diskd,ufs &#8211;enable-storeio=diskd,ufs &rsquo;<br />   &#8211;disable-ident-lookups &#8211;enable-snmp &#8211;enable-removal-policies<br /> # make all<br /> # make install</p>
<p>The explaination of configure script options are below: <br />&#8211;enable-delay-pools &#8211; Enable delay pools to limit bandwidth usage.</p>
<p>You need to enable the option in order to use Squid to limit bandwith usage. It will give fair bandwith usage for everybody. In my case, I don&rsquo;t want one person sucking all of the available bandwidth by downloading a big movie, causing others to suffer. </p>
<p>&#8211;enable-ipf-transparent &#8211; Enable Transparent Proxy support for systems using IP Filter network address redirection.</p>
<p>With this option, you don&rsquo;t have to configure the client&rsquo;s browser proxy setting. Also it is a good way to force the client to use the proxy everytime. </p>
<p>&#8211;enable-storeio=diskd,ufs &#8211; Enable diskd</p>
<p>Improve disk I/O performance. According to the Squid FAQ, if you enable diskd you can gain a 400% increase of perfomance. However, you would need to recompile the kernel because your operating system must support message queues and shared memory. </p>
<p>&#8211;enable-removal-policies &#8211; Build support for the list of removal policies.</p>
<p>By default, Squid uses LRU, but there are two better policies: GDSF and LFUDA. See the Squid config for a more detailed explanation. </p>
<p>&#8211;disable-ident-lookups &#8211; This allows you to remove code that performs Ident (RFC 931) lookups.</p>
<p>Not really important. By the way, if you do transparent proxy, ident lookups won&rsquo;t work. </p>
<p>&#8211;enable-snmp</p>
<p>Optional: enable this and you can monitor Squid with mrtg or rrdtool. How to do this is outside of this article&rsquo;s scope. Perhaps in my next one. </p>
<p>2. Edit Squid Configuration File /usr/local/squid/etc/squid.conf</p>
<p> # Need for transparent proxy<br /> # You need to &#8211;enable-ipf-transparent<br /> http_port 3128<br /> httpd_accel_host virtual<br /> httpd_accel_port 80<br /> httpd_accel_with_proxy  on<br /> httpd_accel_uses_host_header on</p>
<p> # Physical memory / 3<br /> cache_mem 128 MB<br /> # Max out Squid I/O perfomance, 15 GB cache and use Squid special diskd but you need to recompile the kernel<br /> # To use disk you need to &#8211;enable-storeio=diskd,ufs<br /> # Reasonable values for Q1 and Q2 are 72 and 64, respectively.<br /> # Q1 value must bigger Q2<br /> cache_dir diskd /usr/local/squid/cache 15360 16 256 Q1=72 Q2=64</p>
<p> # You can use normal ufs instead<br /> #cache_dir ufs /usr/local/squid/cache 15360 16 256</p>
<p> # I dont want to log anything<br /> # The reason is to save some expensive I/O operation.<br /> cache_access_log /dev/null<br /> cache_store_log none<br /> cache_log /dev/null</p>
<p> # Cache replacement policy<br /> # The  heap GDSF policy optimizes object-hit rate by keeping  smaller popular<br /> # objects in cache, so it has a better chance of getting a hit. It achieves  a<br /> # lower byte hit rate than LFUDA, though, since it evicts larger (possibly popular)<br /> # objects.<br /> # The  heap LFUDA  ( Least  Frequently Used  with Dynamic  Aging )  policy keeps<br /> # popular objects in cache  regardless of their size  and thus optimizes byte  hit<br /> # rate at the  expense of hit  rate since one  large, popular object  will prevent<br /> # many smaller, slightly less popular objects from being cached.<br /> # You need to &#8211;enable-removal-policies<br /> cache_replacement_policy GDSF</p>
<p> # Standard Access List<br /> # I have two subnets, one for student and another one for admin<br /> # Modify this according to your network<br /> acl all src 0.0.0.0/0.0.0.0<br /> acl manager proto cache_object<br /> acl localhost src 127.0.0.1/255.255.255.255<br /> acl outgoing src 192.168.10.2/255.255.255.255<br /> acl student src 192.168.0.0/255.255.255.0<br /> acl admin src 192.168.1.0/255.255.255.0<br /> acl SSL_ports port 443 563<br /> acl Safe_ports port 80          # http<br /> acl Safe_ports port 21          # ftp<br /> acl Safe_ports port 443 563     # https, snews<br /> acl Safe_ports port 70          # gopher<br /> acl Safe_ports port 210         # wais<br /> acl Safe_ports port 1025-65535  # unregistered ports<br /> acl Safe_ports port 280         # http-mgmt<br /> acl Safe_ports port 488         # gss-http<br /> acl Safe_ports port 591         # filemaker<br /> acl Safe_ports port 777         # multiling http<br /> acl CONNECT method CONNECT</p>
<p> http_access allow manager<br /> http_access allow localhost<br /> http_access allow outgoing<br /> http_access allow student<br /> http_access allow admin<br /> http_access deny !Safe_ports<br /> http_access deny CONNECT !SSL_ports<br /> http_access deny all</p>
<p> icp_access allow localhost<br /> icp_access allow student<br /> icp_access allow admin<br /> icp_access deny all</p>
<p> # Avoid caching cgi scripts<br /> acl QUERY urlpath_regex cgi-bin<br /> no_cache deny QUERY</p>
<p> acl magic_words1 url_regex -i 192.168<br /> acl magic_words2 url_regex -i ftp .exe .mp3 .vqf .tar.gz .gz .rpm .zip .rar .avi .mpeg .mpe .mpg .qt .ram .rm .iso .raw .wav .mov</p>
<p> # Delay Pool<br /> # For delay pool, you need to &#8211;enable-delay-pools<br /> delay_pools 2</p>
<p> # I have ADSL 2Mbits line<br /> # 2 mbits == 256 kbytes per second<br /> # 256 KB/s, 5 KB/s<br /> # It means 256 KB/s bandwith for the whole network, but 5 KB/s for each node, which is fair for everybody<br /> delay_class 1 2<br /> delay_parameters 1 256000/256000 5000/256000<br /> delay_access 1 allow magic_words2<br /> delay_access 1 allow student<br /> delay_access 1 allow admin</p>
<p> # -1/-1 means that there are no limits for local traffic.<br /> delay_class 2 2<br /> delay_parameters 2 -1/-1 -1/-1<br /> delay_access 2 allow magic_words1</p>
<p> # Cancel download if file is bigger than 1MB<br /> reply_body_max_size 1024 KB</p>
<p> # snmp stuff<br /> acl snmppublic snmp_community public<br /> snmp_access allow snmppublic localhost<br /> snmp_access deny all</p>
<p> # Change to your domain<br /> # visible_hostname yourdomain.domain.com<br /> # cache_mgr <a href="mailto:yourname@youremail.com">yourname@youremail.com</a></p>
<p>3. Create cache dir and create swap</p>
<p> # mkdir /usr/local/squid/cache<br /> # chown nobody:nogroup cache<br /> # /usr/local/squid/bin/squid -k parse<br /> # /usr/local/squid/bin/squid -z</p>
<p>4. Configure transparent proxy with ipfilter<br />4.1 Edit /etc/rc.conf</p>
<p> # add these lines to enable ipfilter<br /> ipfilter_enable=&quot;YES&quot;<br /> ipnat_enable=&quot;YES&quot;<br /> ipmon_enable=&quot;YES&quot;<br /> ipfs_enable=&quot;YES&quot;</p>
<p>4.2 Edit /etc/ipnat.rules</p>
<p> # add this line<br /> # I assume rl0 is your internal nic<br /> # Redirect everything else to squid on port 3128<br /> rdr rl0 0/0 port 80 -&gt; 127.0.0.1 port 3128 tcp</p>
<p>5. Reconfigure kernel for squid diskd support<br />Consult the Freebsd Handbook for recompiling the kernel and add the following lines. Your kernel must have: </p>
<p> options         SYSVMSG</p>
<p>You can set the parameters in the kernel as follows. This is just an example. Make sure the values are appropriate for your system: <br /> options         MSGMNB=8192     # max # of bytes in a queue<br /> options         MSGMNI=40       # number of message queue identifiers<br /> options         MSGSEG=512      # number of message segments per queue<br /> options         MSGSSZ=64       # size of a message segment<br /> options         MSGTQL=2048     # max messages in system</p>
<p>The following is the explanation of the kernel options from the Squid FAQ: </p>
<p>The messages between Squid and diskd are 32 bytes for 32-bit CPUs and 40 bytes for 64-bit CPUs. Thus, MSGSSZ should be 32 or greater. You may want to set it to a larger value, just to be safe. </p>
<p>We&rsquo;ll have two queues for each cache_dir, one in each direction. So, MSGMNI needs to be at least two times the number of cache_dir&rsquo;s. </p>
<p>I&rsquo;ve found that 75 messages per queue is about the limit of decent performance. If each diskd message consists of just one segment (depending on your value of MSGSSZ), then MSGSEG should be greater than 75. </p>
<p>MSGMNB and MSGTQL affect how many messages can be in the queues at one time. Diskd messages shouldn&rsquo;t be more than 40 bytes, but let&rsquo;s use 64 bytes to be safe. MSGMNB should be at least 64*75. I recommend rounding up to the nearest power of two, or 8192. </p>
<p>MSGTQL should be at least 75 times the number of cache_dir&rsquo;s that you&rsquo;ll have. </p>
<p>Also you can tweak the kernel by commenting out unnecessary lines in the kernel config to gain extra perfomance. Then recompile the kernel. </p>
<p>6. Create start-up script /usr/local/etc/rc.d/squid.sh</p>
<p> #!/bin/sh</p>
<p> echo -n &rsquo; Squid &rsquo;</p>
<p> case &quot;$1&quot; in<br /> start)<br /> /usr/local/squid/bin/squid -D<br /> ;;<br /> stop)<br /> /usr/local/squid/bin/squid -k shutdown<br /> ;;<br /> restart)<br /> /usr/local/squid/bin/squid -k reconfigure<br /> ;;<br /> *)<br /> echo &quot;Usage: `basename $0` {start|stop|restart}&quot;<br /> ;;<br /> esac</p>
<p>7. All Done!<br />References</p>
<p>FreeBSD &#8211; <a href="http://www.freebsd.org/">http://www.freebsd.org/</a> <br />Squid Web Proxy Cache &#8211; <a href="http://www.squid-cache.org/">http://www.squid-cache.org/</a> <br />Configuration Manual for Squid 2.4 Stable x &#8211; <a href="http://squid.visolve.com/">http://squid.visolve.com/</a> <br />Linux Documentation Project &#8211; Bandwidth Limiting HOWTO &#8211; <a href="http://www.linuxdoc.org/">http://www.linuxdoc.org</a> <br />Do-It-Yourself Caching: Squid 2.3 &#8211; <a href="http://www.bsdtoday.com/2000/February/Tutorials28.html">http://www.bsdtoday.com/2000/February/Tutorials28.html</a> <br />IP Filter Based Firewalls HOWTO &#8211; <a href="http://www.obfuscation.org/ipf/ipf-howto.html">http://www.obfuscation.org/ipf/ipf-howto.html</a> </p>
<p>Andi Salimun<br />18 Jul 2002 </p>
]]></content:encoded>
			<wfw:commentRss>http://dimas.ubhara.id/2008/03/squid-inspiration/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Update PHP4 to PHP5 on Debian Linux</title>
		<link>http://dimas.ubhara.id/2008/03/update-php4-to-php5-on-debian-linux/</link>
		<comments>http://dimas.ubhara.id/2008/03/update-php4-to-php5-on-debian-linux/#comments</comments>
		<pubDate>Wed, 12 Mar 2008 16:16:49 +0000</pubDate>
		<dc:creator><![CDATA[dms]]></dc:creator>
				<category><![CDATA[File Config]]></category>

		<guid isPermaLink="false">http://blog.ptpn-xi.com/?p=127</guid>
		<description><![CDATA[Most of the users in debian is having troble to find itout how to install PHP5 in Debian.I am going to give the instructions how to install in debian
If you want to install PHP5 from debian packages you need to enter the one of the source list in your /etc/apt/sources.list file
deb http://packages.dotdeb.org stable alldeb-src http://packages.dotdeb.org stable all
or
deb http://people.debian.org/~dexter php5 sargedeb-src http://people.debian.org/~dexter php5 sarge
Now you need to save your file and run the following command to take our new changes effect
#apt-get update
Install PHP5 in debian
#apt-get install PHP5
This will install PHP5 in debian
If you want to install any other supported packages you need to install using the following command
#apt-get install libapache2-mod-php5 libapache2-mod-perl2 php5 php5-cli php5-common php5-curl php5-dev php5-domxml php5-gd php5-imap php5-ldap php5-mcal php5-mhash php5-mysql php5-odbc php5-pear php5-xslt
that&#8217;s it you have installed PHP5 in your machine. If you want to check the PHP version you run the following command
#php -v 
]]></description>
				<content:encoded><![CDATA[<p><font hnlfd="0" isbmx="44" size="2">Most of the users in <a oncontextmenu="return false;" style="POSITION: static; TEXT-DECORATION: underline! important" href="http://www.debianhelp.co.uk/php5.htm#" class="kLink" id="KonaLink0" onmouseover="adlinkMouseOver(event,this,0);" onclick="adlinkMouseClick(event,this,0);" onmouseout="adlinkMouseOut(event,this,0);" target="_new"><font style="FONT-WEIGHT: 400; COLOR: #009900! important; FONT-FAMILY: Verdana; POSITION: static" color="#009900" size="2" ><span style="FONT-WEIGHT: 400; COLOR: #009900! important; FONT-FAMILY: Verdana; POSITION: relative" class="kLink">debian</span></font></a> is having troble to find itout how to install PHP5 in Debian.I am going to give the instructions how to install in debian</p>
<p>If you want to install PHP5 from debian packages you need to enter the one of the source list in your /etc/apt/sources.list file</p>
<p><font hnlfd="0" isbmx="2" color="#cc0066">deb http://packages.dotdeb.org stable all<br />deb-src http://packages.dotdeb.org stable all</font></p>
<p>or</p>
<p><font hnlfd="0" isbmx="2" color="#cc0066">deb http://people.debian.org/~dexter php5 sarge<br />deb-src http://people.debian.org/~dexter php5 sarge</font></p>
<p>Now you need to save your file and run the following command to take our new changes effect</p>
<p>#apt-get update</p>
<p><font color="#cc0066"><b hnlfd="0" isbmx="0" >Install PHP5 in debian</b></font></p>
<p>#apt-get install PHP5</p>
<p>This will install PHP5 in debian</p>
<p>If you want to install any other supported packages you need to install using the following command</p>
<p>#apt-get install libapache2-mod-php5 libapache2-mod-perl2 php5 php5-cli php5-common php5-curl php5-dev php5-domxml php5-gd php5-imap php5-ldap php5-mcal php5-mhash php5-mysql php5-odbc php5-pear php5-<a oncontextmenu="return false;" style="POSITION: static; TEXT-DECORATION: underline! important" href="http://www.debianhelp.co.uk/php5.htm#" class="kLink" id="KonaLink1" onmouseover="adlinkMouseOver(event,this,1);" onclick="adlinkMouseClick(event,this,1);" onmouseout="adlinkMouseOut(event,this,1);" target="_new"><font style="FONT-WEIGHT: 400; COLOR: #009900! important; FONT-FAMILY: Verdana; POSITION: static" color="#009900" size="2" ><span style="FONT-WEIGHT: 400; COLOR: #009900! important; BORDER-BOTTOM: #009900 1px solid; FONT-FAMILY: Verdana; POSITION: relative; BACKGROUND-COLOR: transparent" class="kLink">xslt</span></font></a></p>
<p>that&rsquo;s it you have installed PHP5 in your machine. If you want to check the <a oncontextmenu="return false;" style="POSITION: static; TEXT-DECORATION: underline! important" href="http://www.debianhelp.co.uk/php5.htm#" class="kLink" id="KonaLink2" onmouseover="adlinkMouseOver(event,this,2);" onclick="adlinkMouseClick(event,this,2);" onmouseout="adlinkMouseOut(event,this,2);" target="_new"><font style="FONT-WEIGHT: 400; COLOR: #009900! important; FONT-FAMILY: Verdana; POSITION: static" color="#009900" size="2" ><span style="FONT-WEIGHT: 400; COLOR: #009900! important; FONT-FAMILY: Verdana; POSITION: relative" class="kLink">PHP </span><span style="FONT-WEIGHT: 400; COLOR: #009900! important; FONT-FAMILY: Verdana; POSITION: relative" class="kLink">version</span></font></a> you run the following command</p>
<p>#php -v </font><wbr></p>
]]></content:encoded>
			<wfw:commentRss>http://dimas.ubhara.id/2008/03/update-php4-to-php5-on-debian-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Way To Backup Mysql</title>
		<link>http://dimas.ubhara.id/2008/03/the-way-to-backup-mysql/</link>
		<comments>http://dimas.ubhara.id/2008/03/the-way-to-backup-mysql/#comments</comments>
		<pubDate>Mon, 10 Mar 2008 15:30:23 +0000</pubDate>
		<dc:creator><![CDATA[dms]]></dc:creator>
				<category><![CDATA[File Config]]></category>

		<guid isPermaLink="false">http://blog.ptpn-xi.com/?p=123</guid>
		<description><![CDATA[Do you need to change your web host or switch your database server? This is probably the only time when you really think of backing up your MySQL data. If you&#8217;ve got a website with a database or your custom database running for your applications, it is imperative that you make regular backups of the database. In this article, I will outline two easy ways of backing up and restoring databases in MySQL.
The easiest way to backup your database would be to telnet to the your database server machine and use the mysqldump command to dump your whole database to a backup file. If you do not have telnet or shell access to your server, don&#8217;t worry about it; I shall outline a method of doing so using the PHPMyAdmin web interface, which you can setup on any web server which executes PHP scripts.
Playing with mysqldump
If you have either a ...]]></description>
				<content:encoded><![CDATA[<p>Do you need to change your web host or switch your database server? This is probably the only time when you really think of backing up your MySQL data. If you&rsquo;ve got a website with a database or your custom database running for your applications, it is imperative that you make regular backups of the database. In this article, I will outline two easy ways of backing up and restoring databases in MySQL.</p>
<p align="left">The easiest way to backup your database would be to telnet to the your database server machine and use the <font face="courier new, courier, mono">mysqldump</font> command to dump your whole database to a backup file. If you do not have telnet or shell access to your server, don&rsquo;t worry about it; I shall outline a method of doing so using the PHPMyAdmin web interface, which you can setup on any web server which executes PHP scripts.</p>
<p><strong>Playing with mysqldump</strong></p>
<p>If you have either a shell or telnet access to your database server, you can backup the database using <font face="courier new, courier, mono">mysqldump</font>. By default, the output of the command will dump the contents of the database in SQL statements to your console. This output can then be piped or redirected to any location you want. If you plan to backup your database, you can pipe the output to a sql file, which will contain the SQL statements to recreate and populate the database tables when you wish to restore your database. There are more adventurous ways to use the output of <font face="courier new, courier, mono">mysqldump</font>.</p>
<p><strong>A Simple Database Backup:</strong></p>
<p>You can use mysqldump to create a simple backup of your database using the following syntax.</p>
<blockquote>
<p><font face="courier new, courier, mono">mysqldump -u [username] -p [password] [databasename] &gt; [backupfile.sql]</font></p>
</blockquote>
<ul>
<ul>
<li><font face="courier new, courier, mono">[username]</font> &#8211; this is your database username</li>
<li><font face="courier new, courier, mono">[password]</font> &#8211; this is the password for your database</li>
<li><font face="courier new, courier, mono">[databasename]</font> &#8211; the name of your database</li>
<li><font face="courier new, courier, mono">[backupfile.sql]</font> &#8211; the file to which the backup should be written. </li>
</ul>
</ul>
<p>The resultant dump file will contain all the SQL statements needed to create the table and populate the table in a new database server. To backup your database &rsquo;Customers&rsquo; with the username &rsquo;sadmin&rsquo; and password &rsquo;pass21&rsquo; to a file custback.sql, you would issue the command:</p>
<blockquote>
<p><font face="courier new, courier, mono">mysqldump -u sadmin -p pass21 Customers &gt; custback.sql</font></p>
</blockquote>
<p>You can also ask <font face="courier new, courier, mono">mysqldump</font> to add a drop table command before every create command by using the option <font face="courier new, courier, mono">&#8211;add-drop-table</font>. This option is useful if you would like to create a backup file which can rewrite an existing database without having to delete the older database manually first.</p>
<blockquote>
<p><font face="courier new, courier, mono">mysqldump &#8211;add-drop-table -u sadmin -p pass21 Customers &gt; custback.sql</font></p>
</blockquote>
<p><strong>Backing up only specified tables</strong></p>
<p>If you&rsquo;d like restrict the backup to only certain tables of your database, you can also specify the tables you want to backup. Let&rsquo;s say that you want to backup only <em>customer_master</em> &amp; <em>customer_details</em> from the Customers database, you do that by issuing</p>
<blockquote>
<p><font face="courier new, courier, mono">mysqldump &#8211;add-drop-table -u sadmin -p pass21 Customers customer_master customer_details&gt; custback.sql</font></p>
</blockquote>
<p>So the syntax for the command to issue is:</p>
<blockquote>
<p><font face="courier new, courier, mono">mysqldump -u [username] -p [password] [databasename] [table1 table2 &#8230;.]</font></p>
</blockquote>
<ul>
<ul>
<li><font face="courier new, courier, mono">[tables]</font> &#8211; This is a list of tables to backup. Each table is separated by a space.</li>
</ul>
</ul>
<p><span class="contentpagetitle"><b>Backing Up and Restoring Your MySQL Database &#8211; What about Multiple Databases?</b></span> </p>
<p>If you are a database administrator who has to look after multiple databases, you&rsquo;ll need to back up more than one database at a time. Here&rsquo;s how you can backup multiple databases in one shot. </p>
<p>If you want to specify the databases to backup, you can use the <font face="courier new, courier, mono">&#8211;databases</font> parameter followed by the list of databases you would like to backup. Each database name has to be separated by at least one space when you type in the command. So if you have to backup 3 databases, let say Customers, Orders and Comments, you can issue the following command to back them up. Make sure the username you specify has permissions to access the databases you would like to backup.</p>
<blockquote>
<p><font face="courier new, courier, mono">mysqldump -u root -p pass21 &#8211;databases Customers Orders Comments &gt; multibackup.sql</font> </p>
</blockquote>
<p>This is okay if you have a small set of databases you want to backup. Now how about backing up all the databases in the server? That&rsquo;s an easy one, just use the <font face="courier new, courier, mono">&#8211;all-databases</font> parameter to backup all the databases in the server in one step.</p>
<blockquote>
<p><font face="courier new, courier, mono">mysqldump &#8211;all-databases&gt; alldatabases.sql</font> </p>
</blockquote>
<p><strong>Backing up only the Database Structure</strong></p>
<p>Most developers need to backup only the database structure to while they are developing their applications. You can backup only the database structure by telling mysqldump not to back up the data. You can do this by using the <font face="courier new, courier, mono">&#8211;no-data parameter</font> when you call mysqldump.</p>
<blockquote>
<p><font face="courier new, courier, mono">mysqldump &#8211;no-data &#8211;databases Customers Orders Comments &gt; structurebackup.sql</font> </p>
</blockquote>
<p><strong>Compressing your Backup file on the Fly</strong></p>
<p>Backups of databases take up a lot of space. You can compress the output of mysqldump to save valuable space while you&rsquo;re backing up your databases. Since mysqldump sends its output to the console, we can pipe the output through gzip or bzip2 and send the compressed dump to the backup file. Here&rsquo;s how you would do that with bzip2 and gzip respectively.</p>
<blockquote>
<p><font face="courier new, courier, mono">mysqldump &#8211;all-databases | bzip2 -c &gt;databasebackup.sql.bz2</font> </p>
<p><font face="courier new, courier, mono">mysqldump &#8211;all-databases | gzip &gt;databasebackup.sql.gz</font> </p>
</blockquote>
<p><strong>A Shell Script for Automating Backups?</strong></p>
<p>You can automate the backup process by making a small shell script which will create a daily backup file. How do you get cron to back up your database without overwriting the older backup? You can use a tiny shell script to add the date to your backup file. An example of a shell script you could use is shown below.</p>
<blockquote>
<p><font face="courier new, courier, mono">#!/bin/sh<br />date=`date -I`<br />mysqldump &#8211;all-databases | gzip &gt; /var/backup/backup-$date.sql.gz </font></p>
<p><font face="Courier New"></p>
<p>Now that you&rsquo;ve got backups of your database, let&rsquo;s learn how to restore your backup in case your database goes down. Here&rsquo;s how you can restore your backed up database using the mysql command.</p>
<p><strong>Restore using mysql</strong></p>
<p>If you have to re-build your database from scratch, you can easily restore the <font face="courier new, courier, mono">mysqldump</font> file by using the mysql command. This method is usually used to recreate or rebuild the database from scratch. </p>
<p>Here&rsquo;s how you would restore your <font face="courier new, courier, mono">custback.sql</font> file to the Customers database.</p>
<blockquote>
<p><font face="courier new, courier, mono">mysql -u sadmin -p pass21 Customers &lt; custback.sql</font> </p>
</blockquote>
<p>Easy isn&rsquo;t it ? Here&rsquo;s the general format you would follow:</p>
<blockquote>
<p><font face="courier new, courier, mono">mysql -u [username] -p [password] [database_to_restore] &lt; [backupfile]</font> </p>
</blockquote>
<p>Now how about those zipped files? You can restore your zipped backup files by first uncompressing its contents and then sending it to mysql.</p>
<blockquote>
<p><font face="courier new, courier, mono">gunzip &lt; custback.sql.sql.gz | mysql -u sadmin -p pass21 Customers</font> </p>
</blockquote>
<p>You can also combine two or more backup files to restore at the same time, using the cat command. Here&rsquo;s how you can do that.</p>
<blockquote>
<p><font face="courier new, courier, mono">cat backup1.sql backup.sql | mysql -u sadmin -p pass21</font> </p>
</blockquote>
<p><strong>Moving Data Directly Between Databases</strong></p>
<p>How would you like to replicate your present database to a new location? When you are shifting web hosts or database servers, you can directly copy data to the new database without having to create a database backup on your machine and restoring the same on the new server. mysql allows you to connect to a remote database server to run sql commands. Using this feature, we can pipe the output from mysqldump and ask mysql to connect to the remote database server to populate the new database. Let&rsquo;s say we want to recreate the Customers database on a new database server located at 202.32.12.32, we can run the following set of commands to replicate the present database at the new server.</p>
<blockquote>
<p><font face="courier new, courier, mono">mysqldump -u sadmin -p pass21 Customers | mysql &#8211;host=202.32.12.32 -C Customers</font> </p>
</blockquote>
<p><span class="contentpagetitle"><b>Backing Up and Restoring Your MySQL Database &#8211; PHPMyAdmin</b></span> </p>
<p>PHPMyAdmin is an easy to use web-interface to control MySQL databases. You can run this from any system which has a web server which runs PHP scripts. PHPMyAdmin also lets you administer multiple database servers using the same interface. If you don&rsquo;t have telnet or shell access to your database server, this is probably how you would be administering your databases. If you haven&rsquo;t used PHPMyAdmin, head over to <a href="http://www.phpmyadmin.net/" rel="nofollow" >http://www.phpmyadmin.net/</a> and download the latest version to experiment with. </p>
<p><strong>Configure PHPMyAdmin</strong></p>
<p>Before I go on to show you how you can back up and restore your databases using PHPMyAdmin, let me take a little while to show those who going to be first time users of PHPMyAdmin how to configure their installation. Once you&rsquo;ve downloaded the latest version of PHPMyAdmin, copy the files from the installation source to your web server. Before you run the program, you&rsquo;ll have to edit a few lines in <font face="courier new, courier, mono">config.inc.php</font> to get your installation to work properly. You can find this file in the root folder of the installation. </p>
<p>Head over to the line which reads: </p>
<blockquote>
<p><font face="courier new, courier, mono">$cfg[&rsquo;PmaAbsoluteUri&rsquo;] = &rsquo;&rsquo;; </font></p>
</blockquote>
<p>Change this to the web URL of the installation. Let&rsquo;s say you&rsquo;ve copied the files to the directory &rsquo;phpmyadmin&rsquo; under the URL &rsquo;http://dbserver.com&rsquo;, you should change the option to: </p>
<blockquote>
<p><font face="courier new, courier, mono">$cfg[&rsquo;PmaAbsoluteUri&rsquo;] = &rsquo;http://dbserver.com/phpmyadmin/&rsquo;;</font></p>
</blockquote>
<p>Here are some more options about your database server which you&rsquo;ll have to modify before you save the configuration file. Let&rsquo;s say you have to connect to your database server, which is residing at 202.32.12.2 and connects on port 432, with the username &rsquo;jester&rsquo; and password &rsquo;freddy32&rsquo;, the options you have to change will look like this:</p>
<blockquote>
<p><font face="courier new, courier, mono">$cfg[&rsquo;Servers&rsquo;][$i][&rsquo;host&rsquo;] = &rsquo;202.32.12.2&rsquo;; <br />$cfg[&rsquo;Servers&rsquo;][$i][&rsquo;port&rsquo;] = &rsquo;432&rsquo;; <br />$cfg[&rsquo;Servers&rsquo;][$i][&rsquo;connect_type&rsquo;] = &rsquo;tcp&rsquo;;<br />$cfg[&rsquo;Servers&rsquo;][$i][&rsquo;auth_type&rsquo;] = &rsquo;config&rsquo;; <br />$cfg[&rsquo;Servers&rsquo;][$i][&rsquo;user&rsquo;] = &rsquo;jester&rsquo;;<br />$cfg[&rsquo;Servers&rsquo;][$i][&rsquo;password&rsquo;] = &rsquo;freddy32&rsquo;; </font></p>
</blockquote>
<p>Once you&rsquo;ve got the correct setting for the database entered in these options, you can save your configuration file and head over to your PHPMyAdmin installation through your browser.</p>
<p><span class="contentpagetitle"><b>Backing Up and Restoring Your MySQL Database &#8211; Backing Up and Restoring Your Database with PHPMyAdmin</b></span> <br />(Page 5 of 5 )</p>
<p>You can backup your database using PHPMyAdmin in just a few mouse clicks. First head over to your database by clicking the database name in the list on the left of the screen. Once you get to your database details, you should get a menu header for your database which looks like so:</p>
<p align="center">
<table align="top">
<caption align="bottom"></caption>
<tbody>
<tr>
<td><img alt="Back up with PHPMyAdmin" src="http://203.201.172.66/~dms/picture/mysql_backup/header.jpg" height="42" hspace="0" width="400" align="top" border="0" /></td>
</tr>
</tbody>
</table>
<p>Click on <strong>Export</strong>. This will get you to a screen with the following options. </p>
<p align="center"><img alt="Backup with PHPMyAdmin" src="http://203.201.172.66/~dms/picture/mysql_backup/export_.jpg" height="316" hspace="0" width="368" align="top" border="0" /></p>
<p>From here it&rsquo;s just a matter of clicking the right options and the &rsquo;Go&rsquo; Button to get your database dump. To save the backup file on your computer, click on the <strong>Save as file</strong> option and the corresponding compression option to get the backup to download to your system.</p>
<p><strong>Restoring your Database via PHPMyAdmin</strong></p>
<p>Restoring your database is as easy as backing it up. If you would like to rewrite the backup over an existing database, click on the database name in the database list on the left, click all the check boxes next to the table names and select <strong>Drop</strong> in the <strong>With selected</strong>: drop down box.</p>
<p align="center"><img alt="Restore with PHPMyAdmin" src="http://203.201.172.66/~dms/picture/mysql_backup/withsel.jpg" height="111" hspace="0" width="400" align="top" border="0" /></p>
<p>This will drop all existing table in the database. Then head over to the top menu bar and click on <strong>SQL</strong>. This will bring up a window where you can either type in SQL commands, or upload your SQL file. The window should look like this:</p>
<p align="center"><img alt="Restore with PHPMyAdmin" src="http://203.201.172.66/~dms/picture/mysql_backup/import.jpg" height="213" hspace="0" width="400" align="top" border="0" /></p>
<p>Click on the <strong>Browse </strong>button, and select the sql backup file you wish to upload to the server. Once you&rsquo;ve selected the file, click on &rsquo;Go&rsquo;. This will upload the backup file to the server and execute the SQL commands in the backup and restore your database.</p>
<p>Now that you know how easy it is to backup and restore your database, spend a few minutes everyday to backup your important data. You can even automate the backup process by using a task scheduler like cron.</p>
<p></font></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://dimas.ubhara.id/2008/03/the-way-to-backup-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
