Thursday, July 12, 2012

Setting Apache di Ubuntu

1. HTTPD - Apache2 Web Server


1.1. Installation
The Apache2 web server is available in Ubuntu Linux. To install Apache2:

       • At a terminal prompt enter the following command:

                  sudo apt-get install apache2



1.2. Configuration
Apache2 is configured by placing directives in plain text configuration files. These directives are
separated between the following files and directories:
   • apache2.conf  : the main Apache2 configuration file. Contains settings that are global to Apache2.

   • conf.d : contains configuration files which apply globally to Apache2. Other packages that use
       Apache2 to serve content may add files, or symlinks, to this directory.

   • envvars : file where Apache2 environment variables are set.


   • httpd.conf : historically the main Apache2 configuration file, named after the httpd daemon.
      Now the file is typically empty, as most configuration options have been moved to the below
      referenced directories. The file can be used for user specific configuration options that globally
      effect Apache2.

   • mods-available : this directory contains configuration files to both load modules and configure
      them. Not all modules will have specific configuration files, however.

   • mods-enabled : holds symlinks to the files in /etc/apache2/mods-available. When a module
     configuration file is symlinked it will be enabled the next time apache2 is restarted.

   • ports.conf: houses the directives that determine which TCP ports Apache2 is listening on.

   • sites-available : this directory has configuration files for Apache2 Virtual Hosts. Virtual Hosts
      allow Apache2 to be configured for multiple sites that have separate configurations.

   • sites-enabled : like mods-enabled, sites-enabled contains symlinks to the /etc/apache2/sitesavailable               directory.
      Similarly when a configuration file in sites-available is symlinked, the site configured by it will be active      once Apache2 is restarted.



In addition, other configuration files may be added using the Include directive, and wildcards can be
used to include many configuration files. Any directive may be placed in any of these configuration
files. Changes to the main configuration files are only recognized by Apache2 when it is started or
restarted.


The server also reads a file containing mime document types; the filename is set by the TypesConfig
directive, typically via /etc/apache2/mods-available/mime.conf, which might also include
additions and overrides, and is /etc/mime.types by default.


1.2.1. Basic Settings
This section explains Apache2 server essential configuration parameters. Refer to the Apache2
Documentation for more details.


• Apache2 ships with a virtual-host-friendly default configuration. That is, it is configured with a
single default virtual host (using the VirtualHost directive) which can modified or used as-is if you
have a single site, or used as a template for additional virtual hosts if you have multiple sites. If left
alone, the default virtual host will serve as your default site, or the site users will see if the URL
they enter does not match the ServerName directive of any of your custom sites. To modify the
default virtual host, edit the file /etc/apache2/sites-available/default.
The directives set for a virtual host only apply to that particular virtual host. If a directive
is set server-wide and not defined within the virtual host settings, the default setting is
used. For example, you can define a Webmaster email address and not define individual
email addresses for each virtual host.
If you wish to configure a new virtual host or site, copy that file into the same directory with a
name you choose. For example:

sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/mynewsite



Edit the new file to configure the new site using some of the directives described below.
• The ServerAdmin directive specifies the email address to be advertised for the server's
administrator. The default value is webmaster@localhost. This should be changed to an email
address that is delivered to you (if you are the server's administrator). If your website has a
problem, Apache2 will display an error message containing this email address to report the problem
to. Find this directive in your site's configuration file in /etc/apache2/sites-available.

• The Listen directive specifies the port, and optionally the IP address, Apache2 should listen on.
If the IP address is not specified, Apache2 will listen on all IP addresses assigned to the machine
it runs on. The default value for the Listen directive is 80. Change this to 127.0.0.1:80 to cause
Apache2 to listen only on your loopback interface so that it will not be available to the Internet,
to (for example) 81 to change the port that it listens on, or leave it as is for normal operation. This
directive can be found and changed in its own file, /etc/apache2/ports.conf

• The ServerName directive is optional and specifies what FQDN your site should answer to. The
default virtual host has no ServerName directive specified, so it will respond to all requests that
do not match a ServerName directive in another virtual host. If you have just acquired the domain
name ubunturocks.com and wish to host it on your Ubuntu server, the value of the ServerName
directive in your virtual host configuration file should be ubunturocks.com. Add this directive to
the new virtual host file you created earlier (/etc/apache2/sites-available/mynewsite).
You may also want your site to respond to www.ubunturocks.com, since many users will assume
the www prefix is appropriate. Use the ServerAlias directive for this. You may also use wildcards
in the ServerAlias directive.
For example, the following configuration will cause your site to respond to any domain request
ending in .ubunturocks.com.
ServerAlias *.ubunturocks.com



• The DocumentRoot directive specifies where Apache2 should look for the files that make up the
site. The default value is /var/www, as specified in /etc/apache2/sites-available/default. If
desired, change this value in your site's virtual host file, and remember to create that directory if
necessary!
Enable the new VirtualHost using the a2ensite utility and restart Apache2:

sudo a2ensite mynewsite
sudo service apache2 restart


Be sure to replace mynewsite with a more descriptive name for the VirtualHost. One method
is to name the file after the ServerName directive of the VirtualHost.


Similarly, use the a2dissite utility to disable sites. This is can be useful when troubleshooting
configuration problems with multiple VirtualHosts:

sudo a2dissite mynewsite
sudo service apache2 restart

Tuesday, July 10, 2012

Membatasi Traffik Jaringan


Membatasi Traffik Jaringan Pada Cisco Switch

Kasus :  ada komputer yang terkena virus atau user nakal dengan download speed sehingga traffik  tinggi dan mengganggu user lain


perintah ini mulai pada cisco IOS versi 12.2(25). Contoh dengan Switch 2960 Series. Misalnya ada port switch dengan speed default 100Mbps, lalu kita ingin melimitasi menjadi 10Mb. Caranya adalah dengan menerapkan QOS pada switch tersebut :
Switch(config)# interface FastEthernet 0/1
Switch(config-if)# srr-queue bandwidth limit 10
Dengan perintah “srr-queue bandwidth limit 10″ maka kita akan melimitasi bandwith untuk outbound packetnya jadi tinggal 10% dari bandwith interfacenya. Jadi hanya 10Mb.
Jika ingin melimit bandwith hanya 1 Mb saja, Caranya adalah dengan mengganti terlebih dahulu speed pada interface tersebut menjadi 10Mb, kamudian baru dilimit dengan “srr-queue bandwidth limit 10″
Switch(config)# interface FastEthernet 0/1
Switch(config-if)# speed 10
Switch(config-if)# srr-queue bandwidth limit 10
Untuk lebih detail mengenai QOS pada switch 2950 silahkan lihat disini http://www.cisco.com/en/US/docs/switches/lan/catalyst2960/software/release/12.2_37_se/con

Sunday, June 24, 2012

daloRadius

daloRADIUS


Introduction


daloRADIUS is an advanced RADIUS web management application aimed at managing hotspots and general-purpose ISP deployments. It features user management, graphical reporting, accounting, a billing engine and integrates with GoogleMaps for geo-locating.
Note: This how-to has been tested with 8.04 and 10.04

Install Prerequisites


  • Apache 1/2
  • PHP 4/5
  • PHP GD
  • PHP DB Abstraction Layer (may require PHP Pear)
  • MySQL 4/5
This how-to is based on Ubuntu server 10.04

How-to Install


A list of all packages which you need installed to get this running in even less time so that you don't have to spend time on figuring out which packages are required and which are not. If you are doing a new OS install you can skip the next line 'sudo tasksel' as this fuction is built in to the install script
sudo tasksel

select
  • LAMP
  • SSH server
sudo apt-get update

sudo apt-get upgrade

sudo apt-get install mysql-server

sudo apt-get install php5-gd php-pear php-db

sudo apt-get install freeradius freeradius-mysql

sudo apt-get install phpmyadmin

Extract Archive


Choose which version you would like to install. Either "stable" or "bleeding edge" but not both.
Stable is code that has been tested and is considered to be stable
Bleeding edge code is code that is under active development with all the new bells and whistles but may be unstable.

Stable


  • daloRADIUS homepage is hosted on sourceforge at the address of http://sourceforge.net/projects/daloradius/ and you may get the latest release from there if you haven't already done so.
    wget http://sourceforge.net/projects/daloradius/files/
    daloradius/daloradius-0.9-8/daloradius-0.9-8.tar.gz/download
    extract the daloradius.tar.gz archive to /var/www
     tar -zxvf daloradius-0.9-8.tar.gz
     mv daloradius-0.9-8 daloradius
     sudo cp daloradius/ /var/www -R
or

Bleeding Edge


  • Download from svn
     sudo apt-get install subversion build-essential screen
     svn co https://daloradius.svn.sourceforge.net/svnroot/
    daloradius/trunk  daloradius
     sudo cp daloradius/ /var/www -R

Setting Permissions


You also need to change permissions so that the webserver user and group are owning daloRADIUS's directory. In Debian the user and group are www-data and so we need to do this:
sudo chown www-data:www-data /var/www/daloradius -R

sudo chmod 644 /var/www/daloradius/library/daloradius.conf.php

The chmod command is for having the daloradius.conf.php configuration file writable by the webserver for easy administration from the web interface.

Database Setup


Fresh install of daloRADIUS (and possibly FreeRADIUS)


If you *DONT HAVE* the radius database in MySQL you need to create it and then import both freeradius and daloradius tables using this schema: (for fresh installations)
cd /var/www/daloradius/contrib/db/

mysql -u root -p
Enter password:mysqladminsecret
mysql> CREATE DATABASE radius;
mysql> quit


FreeRADIUS 1.X


  • If you are working with FreeRADIUS 1.X (Ubuntu 8.04) then:
     mysql -u root -p radius < fr1-mysql-daloradius-and-freeradius.sql
    If
    • Also if using svn version run the following command to update
        mysql -u root -p radius < mysql-migrate-0.98-to-0.99.sql
or

FreeRADIUS 2.X


  • If you are working with FreeRADIUS 2.X (Ubuntu 10.04) then:
     mysql -u root -p radius < fr2-mysql-daloradius-and-freeradius.sql
    If
    • Also if using svn version run the following command to update
        mysql -u root -p radius < mysql-migrate-0.98-to-0.99.sql
or

Radius database already imported


  • If you already have the radius database imported (i.e: radcheck, radacct, etc...) then you only need daloradius's tables added:
     cd /var/www/daloradius/contrib/db
     mysql -u root -p radius < mysql-daloradius.sql
    If
    • Also if using svn version run the following command to update
        mysql -u root -p radius < mysql-migrate-0.98-to-0.99.sql

Database Connection Setup


Now, simply adjust the MySQL database information in daloRADIUS's config file.
cd /var/www/daloradius/library/

sudo nano -w daloradius.conf.php


FreeRADIUS 1.X


  • If you are working with FreeRADIUS 1.X (Ubuntu 8.04) then:
     $configValues['FREERADIUS_VERSION'] = '1';
     $configValues['CONFIG_DB_PASS'] = 'password';
or

FreeRADIUS 2.X


  • If you are working with FreeRADIUS 2.X (Ubuntu 10.04) then:
     $configValues['FREERADIUS_VERSION'] = '2';
     $configValues['CONFIG_DB_PASS'] = 'password';
     $configValues['CONFIG_DB_TBL_RADUSERGROUP'] = 'radusergroup';

Installation Complete


Surf to
http://your ip address/daloradius
Login to the management:
username: administrator
password: radius
Notice: don't forget to change the default password in the Configuration -> Operators page

Sunday, May 27, 2012

Konfigurasi Cisco


masuk switch/router dengan kabel konsul :
pilih no pada auto configurasi
selanjutnya : 
Setting Password
router>enable
router#configure terminal
router(config)#enable secret PASS-EN-ANDA
Setting Host Name
router>enable
router#configure terminal
router(config)#hostname nama-host
setting password console dengan username
router(config)# username USER password WORD
router(config)# line console 0
routerconfig)# login local (local hanya jika ada username)
setting password telnet dengan username
router(config)# username USER password WORD
router(config)# line vty 0 4
routerconfig)# login local
setting password ssh dengan username

# line vty 0 4
(config-line)# transport input ssh
(config-line)# login local
(config-line)# password 7
(config-line)# exit
setting encryption password
router(config)# service password encryptiton
setting banner
router(config)# banner motd # [enter]
pada akhir pesan diakhiri tanda #
atau
router(config)# banner exec # [enter]
pada akhir pesan diakhiri tanda #

Setting Vlan
router>en
router#configure terminal
router(config)#vlan nomor-vlan
router(config-vlan)#name nama-vlan
Setting IP Address pada Vlan
router>enable
router#configure terminal
router(config)#interface vlan ?????
router(config-if)#ip address address mask
router(config-if)#no shutdown

Setting snmp

router>en
router#configure terminal
router(config)#snmp-server community ???????
router(config)#snmp-server contact ??????
router(config)#snmp-server location ??????

Setting DNS-Name
router>en
router#configure terminal
router(config)#ip name-server ip-dns-anda

test switch/router dari komputer


Tuesday, January 25, 2011

BACKUP SERVER

BACKUP SERVER DENGAN G4U

Persiapan yang diperlukan
1. download software di http://www.feyrer.de/g4u/ dalam bentuk ISO
2. burning ke cd , berfungsi untuk booting awal
3. buat ftp server untuk bacup image
4. koneksi jaringan ke ftp server
5. buat account di ftp server default home adalah : "install" (tempat file) default user : "install"
6. pastikan direktori "install" bisa read dan write
7. selesai

Langkah-langkah backup :
1. booting komputer yg akan di backup dengan cd g4u yang telah dibuat
2. cek perangkat jaringan yang terdeteksi dng perintah : ifconfig -a
3. setting ip address dan gateway di perangkat yg terdeteksi misal bge0
ifconfig bge0 192.168.1.100 netmask 255.255.255.0 enter
4. setting default gateway
route add default 192.168.1.1 enter
3. cek harddisk yg akan di backup
disks
4. cek partisi : parts disk
5. backup haddisk misal seluruh harddisk yg terdeteksi sebagai sd0 ftp server : 192.168.1.10
uploaddisk 192.168.1.10 nama_backup_image.gz sd0 enter
6. tunggu sampai selesai

Wednesday, December 15, 2010

Setting DNS

Seting Dns di Ubuntu

Primary Master

forward zone file

>>>>edit :/etc/bind/named.conf.local:
zone "example.com" {
type master;
file "/etc/bind/db.example.com";
};
>>>>buat file /etc/bind/db.example.com dengan perintah :
sudo cp /etc/bind/db.local /etc/bind/db.example.com

>>>>buat zone baru dengan edit file /etc/bind/db.example.com
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA ns.example.com. root.example.com. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.example.com.
@ IN A 192.168.1.10
ns IN A 192.168.1.10

Reverse Zone

>>>>>Edit /etc/bind/named.conf.local dan tambahkan :

zone "1.168.192.in-addr.arpa" {
type master;
notify no;
file "/etc/bind/db.192";
};

>>>>>Buat file /etc/bind/db.192 dengan perintah :

sudo cp /etc/bind/db.127 /etc/bind/db.192


>>>>>>edit /etc/bind/db.192 dan rubah sesuai dengan file /etc/bind/db.example.com:
;
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA ns.example.com. root.example.com. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.
10 IN PTR ns.example.com.


restart BIND9:

sudo /etc/init.d/bind9 restart

Tuesday, December 14, 2010

SETING MODEM CDMA VENUS VT12 DI UBUNTU

langkah-langkah :

1. Reg Kartu Flexi untuk daftar ke layanan Internet
ketik: Reg (spasi) Mingguan / Reg (spasi) Harian / Reg (spasi) Bulanan
kirim ke nomor 2255
isi pulsa kartu flexi >= dengan harga paket yang dipilih
jika berhasil akan mendapat balasan berupa username dan password
username : xxxxxxxx@free
pass : telkom
2. masukkan modem ke mesin ubuntu
3. download wvdial
http://www.4shared.com/file/uJ5Ud-JC/wvdial.html
simpan di direktori misal /home/modem
ekstrak paket wvdial
4. jalankan perintah : $ sudo dpkg -i *.deb di folder tempat paket wvdial
5. edit wvdial.conf : $ sudo nano /etc/wvdial.conf
ganti seperti di bawah :
[Dialer Flexi]
Init1 = ATZ

Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem

Baud = 230400

New PPPD = yes

Modem = /dev/ttyUSB0

ISDN = 0

Phone = #777

Password = telkom

Username = username@free

FlowControl = CRTSCTS

Compuserve = 0

Idle Seconds = 300

6. dial modem dengan perintah $sudo wvdial flexi

7. selesai. internet dapat digunakan. untuk diskonect tekan ctrl C dari konsul