Skip to main content

KISS: Complete Ubuntu Server Configuration


The Simplest way to install and configure our Ubuntu Server Edition. With this step-by-step manual instalation, we can configure Network, Internet, APT instalation source, XAMPP for Linux, Apache Web server, ProFtpd Ftp Server, PHP, MySql Database Server, Samba file sharing, Squid proxy server.


A. Network And Internet Configuration

1. Intall Ubuntu Server Edition, I prefer using 8.04 LTS, a stable build with long time support, even better than the newer ones, in my opinion. Login as root or use this command to become root for user in sudoers list.
# sudo su

2. Now, Change the hostname
# pico /etc/hosts
127.0.0.1 localhost //Don't change this

192.168.1.12 hercules //Change with your ip address and hostname

::1 ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

ff02::3 ip6-allhosts


3. Make configuration for network interfaces
# pico /etc/network/interfaces
# This file describes the network interfaces available on your system

# and how to activate them. For more information, see interfaces(5).

# The loopback network interface

auto lo

iface lo inet loopback

# The primary network interface

auto eth0

iface eth0 inet static

address 192.168.1.12

netmask 255.255.255.0

network 192.168.1.0

broadcast 192.168.1.255

gateway 192.168.1.1 //This is our modem ip address


4. Set our dns. This is come from isp dns server. For example this is IP Address of Telkom Speedy DNS Server.
# pico /etc/resolve.conf
nameserver 202.134.1.10


5. That's it. Now our server connected to internet. Try to ping google to test internet configuration.
# ping google.com


6. Install console web browser :)
# apt-get install lynx
# apt-get install links
# links google.com



B. APT Instalation Source

7. Change apt source based on your nearest location. For example, if you're in Surabaya, use buaya mirror, a linux source that maintenance by KLAS, Komunitas Linux Arek Surabaya. If you want to use indonesian mirror, see the full list in http://wiki.ubuntu-id.org/SourcesListLokal, or create your own source in http://arsip.ubuntu-id.org/a/sources.list/. With the nearest location, we can install new application or updates newest patch faster, instead of using ubuntu server original location or using full 6 DVDs.

This is an example apt source,
# pico /etc/apt/source.list
deb http://buaya.klas.or.id/ubuntu/ hardy main restricted universe multiverse
deb http://buaya.klas.or.id/ubuntu/ hardy-updates main restricted universe multiverse
deb http://buaya.klas.or.id/ubuntu/ hardy-security main restricted universe multiverse

8. Try to test our new configuration to update linux packages.
# apt-get update
# apt-get upgrade



C. XAMPP For Linux intalation

9. We will install web, mysql, and ftp server. But for easier maintenance, we will not using default server from ubuntu instalation, but using xampp for linux instead. So, remove the other service to make sure there's no conflict configuration.
# apt-get autoremove apache2
# apt-get autoremove mysql
# apt-get autoremove proftpd

10. Now Download and install XAMPP for Linux from http://www.apachefriends.org/en/xampp-linux.html
# wget http://downloads.sourceforge.net/project/xampp/XAMPP%20Linux/1.7.2/xampp-linux-1.7.2.tar.gz?use_mirror=biznetnetworks
# tar xvfz xampp-linux-1.7.2.tar.gz -C /opt

11. Try to start xampp for the first time
# /opt/lampp/lampp start


12. To make it service that start at linux startup, add this at first line of /etc/init.d/rc.local
# pico /etc/init.d/rc.local
/opt/lampp/lampp start

13. Apache configuration file is in /opt/lampp/etc/httpd.conf. There's nothing to change.

14. MySql configuration file is in /opt/lampp/etc/my.cnf. There's nothing to change either.

15. PHP configuration file is in /opt/lampp/etc/php.ini. Change the error reporting setting here to be like this:
# pico /opt/lampp/etc/php.ini
error_reporting = E_ALL & ~E_DEPRECATED & ~E_NOTICE

16. Now, try to start with new configuration
/opt/lampp/lampp restart

17. From the computer client, try to access this server, ftp://hercules, with default username is nobody and lampp as password.





D. SAMBA for Network Sharing



18. Install Samba
# apt-get install samba

19. Change Samba configuration
# pico /etc/samba/smb.conf

#======================= Global Settings =======================
[global]
workgroup = OLIMPIC
server string = %h server (Samba, Ubuntu)
dns proxy = no
#### Networking ####
; interfaces = 127.0.0.0/8 eth0

; bind interfaces only = true

#### Debugging/Accounting ####
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d


####### Authentication #######
encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = yes
; guest account = nobody

; invalid users = root

guest account = root

unix password sync = yes
passwd program = /usr/bin/passwd %u

passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

pam password change = yes
map to guest = bad user
########## Domains ###########
########## Printing ##########
############ Misc ############
socket options = TCP_NODELAY
usershare allow guests = yes
#======================= Share Definitions =======================
[browse]

comment = Server

writable = yes

path = /opt

guest ok = yes

browseable = yes

create mask = 0777

directory mask = 0777

[data]

comment = Data

writable = yes

path = /home/actaeon/data

guest ok = yes

browseable = yes

create mask = 0777

directory mask = 0777

[htdocs]

comment = Server Apache

writable = yes

path = /opt/lampp/htdocs

guest ok = yes

browseable = yes

create mask = 0777

directory mask = 0777

[mysql]

comment = Server Mysql

writable = yes

path = /opt/lampp/var/mysql

guest ok = yes

browseable = yes

create mask = 0777

directory mask = 0777

[printers]

comment = All Printers

browseable = no

path = /var/spool/samba

printable = yes

guest ok = no

read only = yes

create mask = 0700

# Windows clients look for this share name as a source of downloadable

# printer drivers

[print$]

comment = Printer Drivers

path = /var/lib/samba/printers

browseable = yes

read only = yes

guest ok = no




E. Squid fo Proxy Server


20. For installing squid, we need two ethernet card. One for internet connection (eth0) and the other (eth1) to connect with the client. Make configuration for network interfaces
# pico /etc/network/interfaces
# This file describes the network interfaces available on your system

# and how to activate them. For more information, see interfaces(5).

# The loopback network interface

auto lo

iface lo inet loopback

# The primary network interface

auto eth0

iface eth0 inet static

address 192.168.1.12

netmask 255.255.255.0

network 192.168.1.0

broadcast 192.168.1.255

gateway 192.168.1.1


auto eth1

iface eth1 inet static

address 192.168.0.12

netmask 255.255.255.0

network 192.168.0.0

broadcast 192.168.0.255

gateway 192.168.1.12 //the 1st eth, as internet source


21. Install squid for proxy server
# apt-get install squid

22. Change squid configuration
# pico /etc/squid/squid.conf
http_port 8888 transparent

cache_mem 32 MB

cache_dir ufs /var/spool/squid 1600 4 256

negative_ttl 2 minutes

maximum_object_size 1024 KB

minimum_object_size 4 KB

visible_hostname hercules_actaeon

cache_swap_low 80

cache_swap_high 100


acl all src 0.0.0.0/0.0.0.0

acl local src 192.168.1.0/24

acl neightbour src 192.168.0.0/24

http_access allow local

http_access allow neightbour

delay_pools 2
delay_class 1 1

delay_parameters 1 64000/64000

delay_access 1 allow local

delay_access 1 deny all

delay_class 2 1

delay_parameters 2 8000/8000

delay_access 2 allow neightbour

delay_access 2 deny all

http_access deny all

23. Try to start squid server
# /etc/init.d/squid restart

24. Change computer client browser setting, for example in internet options, coonnection, LAN Setting, Use proxy server with 192.168.0.12 port 8888


25. Finish. Restart Your server to activate all new configuration.
# init 6


Keep-It-Simple-Stupid

Comments

Popular posts from this blog

Pembuatan PDF di PHP dengan FPDF dan HTML2FPDF

Untuk membuat pdf dengan menggunakan php, kita bisa menggunakan fpdf yang berbasis class. Sedangkan html2fpdf digunakan untuk mengubah html menjadi pdf. Dengan hanya menggunakan fpdf, kita harus menentukan semua hal yang mengatur tampilannya berbasis code sesuai dengan aturan dan fungsi yang disediakan class tersebut. Dengan menggunakan html2fpdf, kita cuma perlu membuat sebuah file html dan tampilannya langsung diubah menjadi sebuah file pdf, tentu dengan beberapa keterbatasan dan perubahan tampilan. Saat ini, fpdf terbaru pada versi 1.6 sedangkan html2fpdf versi 3. Instalasi: + Ekstrak file fpdf dan html2fpdf. Sebenarnya html2fpdf merupakan inheritance dari class fpdf, tapi class di fpdf yang disdertakan di paket html2fpdf telah dimodifikasi dari aslinya sesuai dengan kebutuhan konversi tersebut. Class original dari fpdf akan kita pakai untuk pembuatan pdf secara manual, bukan dari html. + Ganti nama file fpdf.php misalkan menjadi fpdf16.php. Karena untuk bebrapa versi instalasi php

Java-MySql: Aplikasi Database dengan Data Gambar (Updated)

Untuk update metode simpan gambar lihat di appGambar 2.0 Bagaimana caranya menyimpan data yang membutuhkan penyimpanan data gambar? Misalkan data pegawai yang membutuhkan penyimpanan gambar dari setiap pegawai. Alternatifnya ada dua, dengan kelebihan dan kekurangan masing-masing. Cara yang pertama adalah dengan membuat field dengan tipe data binary, kemudian menyimpan gambar yang dibutuhkan dalam field di database tersebut. Cara ini membutuhkan manajemen program yang lebih rumit, tapi data gambar akan terjamin, karena tersimpan didalam database yang terintegrasi dengan data lainnya. Kekurangan lainnya adalah ukuran database yang akan membesar dan lambat. Bayangkan saja, sebuah field membutuhkan gambar dengan format jpeg, 200kB. Apabila ada 200 juta record, maka ukuran field yang diperuntukan khusus untuk gambar dengan perhitungan kasar adalah 0.2 MB x 200M = 40 x 10^12 = 40 TB. Belum ditambah dengan ukuran data dari field lainnya, kalau misalkan untuk menyimpan data penduduk Indonesia.

Java: Pengiriman Parameter antar Frame

Sebenarnya konsep ini berlaku bukan hanya pada frame, tapi bisa dilakukan antar object dari class yang sifatnya umum, karena Java yang sifatnya sudah full OOP. Tapi, karena lebih sering diterapkan dalam pemrograman GUI desktop, khususnya dengan Netbeans, maka dicontohkan dengan class javax.swing.JFrame. Setiap bentuk code java harus dibentuk dalam bentuk class, biar sebagaimanapun sederhananya. Tidak seperti pemrograman lainnya yang menggunakan konsep OOP sebagai tambahan dan pengembangan dari yang sudah ada sebelumnya. Itulah sebabnya kita mengenal class di C++, Pascal, PHP, tapi masih diperbolehkan untuk tetap menggunakan konsep primitif. Sedangkan pada kasus java dan .NET, OOP merupakan inti utamanya yang harus selalu diikuti dan diterapkan. Awalnya akan sangat membingungkan, tapi sangat mudah untuk langkah pengembangan selanjutnya. Sudah lihat JavaDoc? itu adalah dokumen pemrograman yang paling aneh didunia, pada pandangan pertama. Coba bandingkan dengan MSDN-nya .NET, PHP Manual,