Jul 11

Mirror repository ubuntu sangat dibutuhkan sekali oleh bangsa kita, dan tidak disadari pula telah banyak yang membuat repository untuk keperluan jaringan lokal. Permasalahan yang muncul adalah kesetaraan isi repository milik kita dengan server repository yang lain. ketidaksesuain ini dapat menyebabkan kesalahan update paket2 yang bersangkutan lho!

Bagaimana caranya agar server repository kita dapat singkron dengan Server mirror lain? jawabanya.. kita dapat menggunakan debmirror, rsync atau apt-mirror. dalam kesempatan kali ini saya akan mengajak kita semua untuk membuat mirror ubuntu di server milik kita sendiri. ada pun kelengkapan yang harus dimiliki adalah:

0. Koneksi Internet

1. Bandwidth yang lumayan

2. Freespace di hardisk yang banyak (usahakan 60GB)

baiklah, berikut adalah step by stepnya:

0. buat direktory mirror, saya menggunakan direktory /home/mirror

$ sudo mkdir /home/mirror && cd /home/mirror

1. Install Debmirror

$ sudo apt-get install debmirror

2. Buat direktory mirror untuk ubuntu

$ sudo mkdir ubuntu

3. silakan kopi dan salin skript di lampiran untuk proses mirroring, dan namakan dengan mirror.ubuntu.sh dan simpan di /home/mirror/mirror.ubuntu.sh

4. ubah permisi untuk berkas tersebut

$ sudo chmod +x mirror.ubuntu.sh

5. silakan tunggu karena mirror anda sedang dibangun

6. Install webserver, anda dapat menggunakan apache2 atau lighttpd

$ sudo apt-get install apache2 # jika anda menggunakan apache

$ sudo apt-get install lighttpd # jika anda menggunakan lighttpd

7. Buat link untuk pengaksesan web agar supaya mirror kita dapat diakses dari luar

$ sudo ln -s /home/mirror/ubuntu /va/www/ubuntu

8. singkronkan selalu dengan server repository, dapat menggunakan anacron untuk melakukanya

$ sudo crontab -e

isikan dengan * 5,22,10,15 * * * cd /home/ftp && /home/mirror/mirror.ubuntu.sh

simpan dan repository akan di cek pada jam 5, 10, 15 dan 22

Selesai, mudah bukan?

Lanpiran:

#!/bin/bash
# created by Mahyuddin Susanto
# please give this file exsecution mode
# sudo chmod +x this_file.sh
# i asumsed you run this file at /home/mirror/
# type $ man debmirror for more information about debmirror 

MIR=/usr/bin/debmirror
if test -e  $MIR;
	then
	# this is most important :p
	echo "Debian/Ubuntu scanning packages for own repository"
	echo "Created by Mahyuddin Susanto aka udienz@ubuntu.com"
	echo "Use Your Own Risk"
else
	echo "Currently, package dependency is not installed on your system, please install first"
	echo "using apt-get install debmirror"
	exit 1
fi

# Server, lets declare your target server, you can add your nearest ubuntu mirror like jp.archive.ubuntu.com
SERVER=archive.ubuntu.com

# tellme where root server have ubuntu mirror, you can insert like: ubuntu, pub/ubuntu depends your server
# example: ubuntu mirror at foss-id like http://dl2.foss-id.web.id/ubuntu of course you can type ROOT=ubuntu
ROOT=ubuntu

# What's your method to use mirroring? you can use http, ftp, hftp, rsync method
METHOD=http

# let's discuss about release ubuntu, ubuntu have code name release like wathy, breezy, dapper, edgy, feisty, gutsy, hardy, intrepid
# in this case you can mirroring release ubuntu more than one release, or you can mirroring update package, security package, proposed package
# ex: $release-security so you can type hardy,hardy-updates,hardy-security,hardy-backports,hardy-proposed
RELEASE=hardy,hardy-updates,hardy-security,hardy-backports,hardy-proposed,intrepid,intrepid-updates,intrepid-security,intrepid-backports,intrepid-proposed

# section, hm... no more information here :D
# ubuntu section is main, restricted, universe, multiverse
# but you can add more section like debian-installer on the section
SECTION=main,restricted,universe,multiverse,main/debian-installer,restricted/debian-installer,universe/debian-installer,multiverse/debian-installer

# architecture... hm.. what architecture fo you want to mirroring? i386 (32bit), amd64 (64bit, include IA64), sparc or powerpc?
ARCHITECTURE=i386,amd64 #just it?

# okey next you must save mirror file to your directory, but you must declare on here. i save my mirror at /media/mirror/ubuntu
TARGET=ubuntu

if test -d $`pwd`/ubuntu;
	then EXISTS="yes"
else
	echo "it seems you don't have ubuntu directory, create first!"
	exit 1
fi

# hmm.... do you cannocted under proxy? if yes you must add --proxy=http://you-name:your_passwd@url:port
#TMPFILE=`mktemp -t mirror.surat`
#exec > "$TMPFILE"
#echo "From: \"DebMirror Ubuntu\" "
#echo "To: isikan yang akan menerima"
#echo "Cc: hadinux@gmail.com,udienz@ubuntu.com"
#echo "Subject: Minta perhatian penggunaan benwit"
#echo ""
#echo "Assalamualaikum"
#echo ""
#echo "Mohon perhatian, server sedang melakukan proses mirror repository ubuntu"
#echo "untuk itu mohon kesediaanya untuk memberi benwit pada server agar cepet selesai mirrornya"
#echo "atas perhatian dan kerjasamanya kami ucapkan terimakasih"
#echo ""
#echo `date`
#echo "wassalam"
#echo ""
#echo "Mirror dengan: $METHOD/$SERVER/$ROOT/$DISTRO $SECTION"
#echo "Untuk arsitektur $ARCHITECTURE"
#echo "Versi: $VERSION"
#echo ""
#echo "--++ DebMirror ++--"
#echo ""
#echo "---------------------------------------------------------"
#cat $CHANGES_FILE
#exec
#/usr/sbin/sendmail -t -i < $TMPFILE
#rm -f $TMPFILE

debmirror -m --passive \
		--host=$SERVER \
		--root=$ROOT \
		--method=$METHOD \
		--progress \
		--dist=$DISTRO \
		--section=$SECTION \
		--arch=$ARCHITECTURE \
		$TARGET \
		--nosource
		--getcontents

# if you want to mirroring both of binary package and source you can delete --nosource, i'm not this option because my disk is limiitted.
# and if you don't want to remove previous repositories you can add --nocleanup option
# if you get error messages about gpg files maybe you forget to add gpg ubuntu archive as trusted keys :D
# gpg --keyring /usr/share/keyrings/ubuntu-archive-keyring.gpg --export | gpg --no-default-keyring --keyring trustedkeys.gpg --import
# note: remember your free space and bandwidth :D 

Created By: Mahyuddin Susanto
email = udienz@ubuntu.com
blog = http://udienz.immteknik.org

Jun 01

Dalam rangka mengefisienkan bandwidth yang ada dan mengurangi kerepotan penggunaan DVD repository, maka kami (GrandnetStudio Groups) berinisiatif membikin sebuah server repository yang nantinya dapat digunakan bersama oleh warnet-warnet linux yang berada dalam jaringan GrandnetStudio. Tujuan dari pembuatan server repository lokal ini adalah untuk memudahkan proses update software dan penambahan paket-paket software yang belum ada.
Untuk pemilihan paket, sengaja digunakan debian dikarenakan kami selama ini masih menggunakan Sistem Operasi Linux berbasis Debian (termasuk ubuntu).
Sebagai awal project, kami memindahkan DVD repository Ubuntu 7.04 Feisty yang berjumlah 4 DVD kedalam hardisk yang nantinya digunakan sebagai server repository lokal. Proses pemindahan ini hanya berlangsung beberapa jam, tutorialnya dapat dilihat di sini
untuk selanjutnya kami berencana untuk menambahkan paket-paket asli dari debian serta berusaha untuk terus update paket-paket terbaru.
Saat ini repository sudah siap dan bisa diakses dalam jaringan GrandnetStudio Groups.

May 22

Akhirnya sempet juga posting, biar gak sepi ini ada beberapa setting server yang umum digunakan didunia server silahkan dicoba :

Main Menu

1. Setup Address
2. Update Sourcelist
3. FTP Server
4. WebServer
5. SSH

+++++++++++++++++
Setup IP Address
+++++++++++++++++

1. Mengecek Network Interface
# ifconfig -a
2. Mengeset IP Address
# vim /etc/network/interfaces
Edit seperti baris berikut
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 203.89.22.68
netmask 255.255.255.192
gateway 203.89.22.65
3. Restart Network
# /etc/init.d/networking restart
4. Mengecek Setting Interface
# ifconfig

++++++++++++++++++
Update Sourcelist
++++++++++++++++++

1. Backup Source
# cd /etc/apt
# cp sources.list sources.list.backup
2. Update sourcelist
# apt-get update
3. Upgrade sourcelist
# apt-get upgrade
# apt-get dist-upgrade

++++++++++++++++
Setup FTP Server
++++++++++++++++

1. Install VSFTPD
# apt-get install vsftpd
2. Konfigurasi VSFTPD
# vi /etc/vsftpd.conf
anonymous_enable=YES <–> enable anonymous
local_enable=YES <–> enable local user
write_enable=YES <–> enable read write
3. Setting Banner VSFTPD
# vi /etc/vsftpd.conf
ftpd_banner=Selamat datang difeisty release party
4. Jalankan VSFTPD
# /etc/init.d/vsftpd start
5. Tes VSFTPD
# ftp localhost
Connected to localhost.
220 Selamat datang difeisty release party
Name (localhost:akbar): anonymous
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>

+++++++++
Setup SSH
+++++++++

1. Install SSH
# apt-get install openssh-server
2. Menjalankan SSH
# ssh root@localhost
The authenticity of host ‘localhost (127.0.0.1)’ can’t be established.
RSA key fingerprint is 70:8c:e3:cc:ab:b4:0d:f4:6a:fd:29:6f:e6:33:02:04.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘localhost’ (RSA) to the list of known hosts.
root@localhost’s password:
Linux feisty 2.6.20-15-generic #2 SMP Sun Apr 15 07:36:31 UTC 2007 i686

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
root@feisty:~#

+++++++++++++++++
Setting WebServer
+++++++++++++++++

1. Install Apache
# apt-get install apache2 apache2-mpm-prefork apache2-utils
2. Install PHP
# apt-get install libapache2-mod-php5 php5-cli php5-common php5-cgi
3. Install MYSQL
# apt-get install mysql-server mysql-client
# apt-get install php5-mysql
4. Install Dependency
# apt-get install make gcc g++
# apt-get install cgilib libttf-dev libttf2 libpngwriter0-dev
libpng3-dev libfreetype6-dev libart-2.0-dev snmp

semoga bermanfaat…