SlideShare ist ein Scribd-Unternehmen logo
1 von 18
Downloaden Sie, um offline zu lesen
Instalasi CentOS
       Bagi teman-teman yang senang ngutak-ngatik server, atau yang senang dengan OS yg
berbasiskan linux. Saya punya pengalaman tersendiri dalam menyiapkan sebuah server,
dalam waktu yang tidak sampai satu rokok jie sam su habis, server ini sudah kelar digunakan.

        Tentu saja supaya server ini berguna hingga bisa mengudara, anda harus punya
jaringan internet sekaligus dengan IP Public (Static) yang disediakan oleh ISP anda. Paling
tidak anda harus sudah menyediakan dua IP address. IP local dan IP Public.

        IP local untuk memudahkan anda masuk melalui jaringan local dan lebih cepat,
hampir tanpa kendala. Sedang kalau menggunakan IP Public pun sebetulnya juga tidak
masalah. Kelebihannya, kalau dengan IP Public anda bisa mengaksess server anda dari
manasaja dan di manasaja anda berada. Kekurangannya, IP Public itu bukan milik kita murni.
Jadi jika pada kondisi tertentu (katakanlah diblokir oleh ISP anda karena satu dan lain hal),
maka anda tidak bisa masuk lagi melalui IP ini.

Kita mulai saja:

      Pertama, anda harus menyediakan software CentOS Server ini dengan cara
download. TIdak terlalu besar sih ukurannya, sekitar 600 Mb, tepatnya 580Mb. Yah« 1 CD
saja:

Anda bisa memilih cara download dan jenis filenya; ada dua:

1. Jika anda menggunakan OS windows anda bisa langsung download ke alamat ini :

http://vault.centos.org/4.4/isos/i386/CentOS-4.4.ServerCD-i386.iso

2. Jika sudah selesai downloadnya, anda tinggal memburning pake nero atau ashampo atau
software burning lainnya kesukaan anda. Sediakan satu blank cd untuk diburning di media
ini.

3. Jika sudah selesai, maka anda telah memiliki satu master cd CentOS Server versi 4.

        Kedua, sediakan satu mesin computer yang akan dijadikan server oleh anda. Semakin
besar spesifikasinya semakin baik. Kalaupun pakai Pentium III pun sebetulnya sudah bisa
dengan kapasitas Hardisk 30 G dan RAM minimal 512 kb atau 1024 kb. Ini adalah ukuran
minimalis untuk server web yang tidak terlalu besar muatannya. Tapi jika anda mempunyai
spesifikasi server yang handal (seperti XEON dari HP mutakhir, misalnya) itu sangat
dianjurkan.
Jangan lupa untuk menyiapkan dua LAN Card. Kalau CPU anda menyediakan LAN
onboard. Berarti anda cukup menyediakan satu LAN Card saja. Kita asusmsikan masing-
masin LAN Card ini, dengan nama: eth0 untuk IP local. Misalkan 192.168.50.7. Sedangkan
LAN Card lainnya kita namakan: eth1 misalkan 222.156.134.170. Gambarnya sbb:

1. LAN Card OnBoard, dengan nama : eth0 IP: 192.168.50.7

2. LAN Card External, dengan nama : eth1 IP:222.156.134.170

        Kita mulai install. Pertama masukkan CD CentOS Server anda ke Driver. Kemudian
anda restart computer anda. Ketika tampilan pertama muncul. Ada dua pilihan untk memulai
menginstall ini: Pertama berbasiskan GUI, artinya anda menginstall dengan full tampilan
yang familiar, tinggal klik saja. Kedua berbasiskan text. Dari model kedua ini anda hampir
sepenuhnya menggunakan text, tapi masih juga dibantu dengan grafis-grafis ringan untuk
interaksi dengan anda.

        Saya sarankan, untuk install pertama, sebaiknya jangan menggunakan Firewall
bawaan dari CentOS. Lebh baik Firewall jangan diaktifkan. Firewall bisa kita sediakan
sendiri setelah installasi selesai. Dan akan kita bahas pada artikel sendiri.

Pada saat option muncul sebelum installasi. Ada beberapa hal prinsip yang harus anda
perhatikan:

        Ketika option untuk mengatur partisi, anda tinggal pilih remove all partition. Dan
biarkan linux untuk auto configurasi. Sebab dengan sendirinya linux akan secara otomatis
mengatur partisinya dengan baik. Perlu diketahui, partisi di linux dengan di windows sangat
berbeda. Anda tidak perlu pusing-pusing mikirkan ini. Tinggal ok dan next. Terkecuali ketika
ada option tentang firewall, untuk sementara klik pakai spasi di checklist DISABLE-nya (
option ini hampir sama, antara yg berbasis text dengan GUI). Anda tinggal perhatikan secara
seksama.
        Ketika ada option untuk costumasi server, pilih ini. Jangan lupa untuk mencheklist,
antara lain:

        DNS server, jika anda akan membuat server dns sekalian pada server ini. Karena
didalamnya disiapkan software Bind (named) untuk manajemen domain. Jika tidak. Maka
tidak perlu dichecklist. Untuk menyaipkan manajemen domain, akan dibuat artikel tersendiri.
        MYSQL Server, anda harus pilih ini jika anda hendak menggunakan MYSQL
sebagai basis data di server anda. Atau pilih juga POSTGRESQL jika anda termasuk pecinta
POSTGRE. Kalau saya masih setia pada MySQL. Jadi PostgreSql tidak saya checklist.
        Web Server, harus dipilih sebab didalamnya terdapat httpd dari apache yang akan
menggerakkan server anda untuk bisa menampilkan halaman web.>
        Anda pun bisa menchecklist Mail Server, jika anda hendak mengembangkan server
anda untuk mail server juga. ( Ini disarankan bagi yang servernya cukup handal dan belum
ada mesin server lain untuk dijadikan mail server). Untuk bab membuat mail server, akan ada
artikel tersendiri.
         Ketika masuk pada opsi manajemen IP. Jangan dichecklist DHCP-nya. Sebagaimana
yg kita tentukan sebelumnya, untuk Card yang inisialnya eth0 anda isi dengan no IP
192.168.50.7 netmask 255.255.255.240 atau disesuaikan dengan netmask dari ISP anda.
Demikian juga eth1 dengan no IP 222.156.134.170 netmask 255.255.255.240 atau
disesuaikan dengan netmask dari ISP anda. Kemudian isi nama server anda dengan nama
favorit anda sendiri. Defaultya localhost.localdomain anda bisa mengganti dengan
sidukun.domain.com atau apa saja kesukaan anda. Berikutnya, jangan lupa untuk mengisi
Gateway. Masukkan no Gateway, Primary Server, Secondary Server yang diberikan oleh ISP
anda. Misalnya:

Gateway: 222.245.250.200
Primary Server : 202.13.2.5
Secondary Server : 202.134.0.155

        Perhatikan baik-baik, apa-apa yang perlu untuk di server anda nanti. Atau langsung
saja pada langkah instalasi. Anda tidak perlu khawatir urusan dengan software yang tidak
terinstall. Hal ini akan bisa dilakukan ketika server telah selesai diinstall, dengan
menggunakan perintah YUM INSTALL.
        GO! Install. Anda tinggal minum kopi sambil mengisap ji sam su ( bagi yg suka
rokok) menunggu sampai selesai install. Linux akan dengan pintarnya mengolah file-filenya
di server anda.

Pada tahap ini, jika tidak ada aral melintang, berarti anda sukses installasi server anda.
Horeeee.....!
Jika masih penasaran, anda bisa kontak saya unt sharing.




Setup a DNS Server on CentOS 5
This is a pretty geeky thing to do but running your own DNS Server on your intranet does
make some sense from a performance and conveience perspective.

Background
The sole purpose of a DNS Server is to provide a look-up service for mapping hostnames e.g.
www.google.com to IP addresses 100.101.20.2. By far the most popular DNS Server software
out there is a package called bind.

There are essentially 2 reasons to running your own DNS Server.

   1. Improving the speed of hostname lookups
   2. Managing your own intranet hostnames & IP addresses in a central location
The first reason is what is commonly called a Caching Name Server. In essence by having
one machine provide all hostname look-ups in your intranet, you¶re cutting down on every
machine in your intranet having to independently look-up names. Additionally once a name is
looked up your DNS Server will cache the results for a set period of time so that subsequent
queries can come out of your DNS Server¶s cache and not have to go and do the look-up on
your ISPs DNS Server.

The second reason is actually the cooler one. Since you control the DNS Server you can
create your own local domain (called zones in bind lingo) and name all the systems within
your intranet. In so doing this it¶s much easier to connect to systems using names rather than
IP addresses. Plus it¶s fun to name all the systems!

Taking this a step further you can create generic hostnames such as imap, mail, smtp, ntp,
pop, etc. and manage these in one stop rather than having to manage them throughout your
intranet.

Getting started

First things first, install the necessary bind software.

1   yum install bind bind-utils bind -libs

Generating a rndc key

NOTE: All the config files we¶re going to work on are located in /var/named/chroot

Next you¶ll need to create/modify a rndc.conf and/or rndc.key file. This file contains a key
which is required in order to manage the bind service once it¶s up and running. With this key
you can theoretically manage bind either on the host where it¶s running or you can manage it
on any system that is allowed to do so and knows this key!

1 # command to generate a new 512 byte key
2 rndc-confgen -b 512

This command will return the following output which you¶ll want to either redirect to a file or
copy and paste into a file. The file should be rndc.conf but I like to use this name instead,
/var/named/chroot/etc/rndc.key. It just makes more sense to me.

1
    # Start of rndc.conf
2
    key "rndckey" {
3
            algorithm hmac -md5;
4
            secret
5
    "nHFS3WOpdap75IvsYSXVNYWusnAQPT6z5XC8V5YPWXnZ8RN8tdfSFuClZ8nNouWyGhvHB8mE
6
    TJgwsrvhiYhIhA==" ;
7
    };
8
9
    options {
1
            default-key "rndckey" ;
0
            default-server 127.0.0.1;
1
            default-port 953;
1
    };
1
    # End of rndc.conf
2
The rndc-confgen command also returns some additional output below. This goes into the
file /var/named/chroot/etc/named.conf. Make sure to remove the comments at the
beginning of each line to turn them on.

     # Use with the following in named.conf, adjusting the allow list as
1
     needed:
2
     key "rndckey" {
3
           algorithm hmac -md5;
4
           secret
5
     "nHFS3WOpdap75IvsYSXVNYWusnAQPT6z5XC8V5YPWXnZ8RN8tdfSFuClZ8nNouWyGhvHB8mE
6
     TJgwsrvhiYhIhA==" ;
7
     };
8
     #
9
     controls {
1
           inet 127.0.0.1 port 953
0
           allow { 127.0.0.1; } keys { "rndckey" ; };
1
     };
1
     # End of named.conf

named.conf file

Now let¶s flesh out that named.conf file a little bit more.

1    acl lan {
2            192.168.1.0 /24;
3            127.0.0.1;
4    };
5
6    controls {
7            inet 127.0.0.1 port 953
8            allow { lan; } keys { "rndckey"; };
9    };
10
11   logging {
12           category default { default_syslog; };
13           category lame -servers { null; };
14   };
15
16   options {
17           pid-file "/var/run/named/named.pid" ;
18           directory "/var/named" ;
19           dump-file "named_dump.db" ;
20           forward only;
21           forwarders {
22           # the following IP addresses are my ISPs DNS Servers. These will
23   be used for looking up
24           # hostnames that I don't locally manage, i .e. the REST OF THE
25   INTERNET!
26           24.92.226.40;      # my ISPs DNS Server #1
27           24.92.226.41;      # my ISPs DNS Server #2
28           };
29           /*
30             * If there is a firewall between you and nameservers you want
31             * to talk to, you might need to uncomment the query -source
32             * directive below. Previous versions of BIND always asked
33             * questions using port 53, but BIND 8.1 uses an unprivileged
34             * port by default.
35             */
36             query-source address * port 53;
37             allow-query { lan; };
38             allow-recursion { lan; };
39             allow-transfer { lan; };
40   };
41
42   zone "bubba.net" {
43           type master;
44           file "data/db.bubba.net" ;
45   };
46   zone "0.0.127.in -addr.arpa" {
47           type master;
48           file "data/db.127.0.0" ;
49   };
50   zone "1.168.192.in -addr.arpa" {
51           type master;
52           file "data/db.192.168.1" ;
53   };
54   zone "." {
55           type hint;
             file "root.hints" ;
     };


Here is a quick rundown of what¶s going on here. The acl lan creates an access control list
that includes 192.168.1.0/24 and 127.0.0.1 so that only hosts within these IP address ranges
can remotely manage and use this bind instance. 192.168.1.0/24 means IP addresses in the
range 192.168.1.1 ± 192.168.1.255.

The zones, ³bubba.net´, ³0.0.127.in-addr.arpa´, ³1.168.192.in-addr.arpa´, and ³.´ are all
essentially files containing either hostname ĺ IP address mappings or IP address ĺ
hostname mappings that this bind server will be responsible for.

Bulding zone files

The first zone: ³bubba.net´ includes all the hostnames and the IP addresses they point to. So
these would be my systems:

     y    scully.bubba.net
     y    mulder.bubba.net
     y    doggett.bubba.net

The second and third zones: ³0.0.127.in-addr.arpa´ and ³1.168.192.in-addr.arpa´ are
special zones that provide ³reverse´ name look-ups. These are when you look up a IP address
and want to know what name(s) are associated with it. For example:

     y    192.168.1.100
     y    192.168.1.101

The fourth zone: ³.´ is a special zone that makes this bind server act as a caching name
server, for any hostnames and IP addresses that fall outside of the first 3 zones. These
hostname and IP address look-ups will be forwarded to my ISPs DNS Server, and the results
cached here for subsequent quereies.

Here is what the zone ³bubba.net´ looks like.
$TTL 604800
1
     ;
2
     ; Zone file for bubba.net
3
     ;
4
     ; Mandatory minimum for a working domain
5
     ;
6
     @   IN SOA ns.bubba.net. hostmaster.bubba.net. (
7
           2000072802 ; serial
8
           28800 ; refresh
9
           7200 ; retry
10
           3600000 ; expire
11
           86400 ; default_ttl
12
           )
13
     @   IN NS       ns.bubba.net.
14
     @   IN MX 10 mail.bubba.net.
15
     @   IN MX 20 mail.bubba.net.
16
     ;
17
     ; Provide familiar names to services but
18
     ; acutally all are coming from XXXXX
19
     ; These need to be bound to the address directly, no CNAME 's.
20
     ; -----------------------------------------------------------
21
     bubba.net.              IN A 192.168.1.1
22
     ;
23
     hostmaster.bubba.net.   IN A 192.168.1.101
24
     ns.bubba.net.           IN A 192.168.1.101
25
     ...
26
     ...
27
     ; Subnet 192.168.1 machines
28
     ; -------------------------
29
     mulder.bubba.net.       IN A          192.168.1.1
30
     mulder.bubba.net.       IN HINFO      "AMD Athlon(tm) Dual Core
31
     Processor 4850e 2.2GHz" "LINUX"
32
     mulder.bubba.net.       IN MX         10 mail.bubba.net.
33
     mulder.bubba.net.       IN TXT        ""
34
     scully.bubba.net.       IN A          192.168.1.2
35
     scully.bubba.net.       IN HINFO      "Celeron 450" "Windows 2000 "
36
     scully.bubba.net.       IN MX         10 mail.bubba.net.
37
     scully.bubba.net.       IN TXT        ""
38
     ...
39
     ...


The first 16 lines are pretty standard. These setup a TTL or Time To Live which means how
long any of this data should be cache. Line 14 denotes which machine is the SOA, Start of
Authority, ns.bubba.net is the master of this domain is what it¶s saying 8-). Lines 15 & 16
state which machine is the mail exchange for this domain. I only have one mail exchange so I
just list it twice.

The most important section in this file starts with the declaration of hostnames. Each
hostname gets 4 lines. A ³IN A´ line which tells you the IP address for this hostname. The
³IN HINFO³ which is just a description of the host itself. The ³IN MX´ states who the mail
exchange is for this host. And finally the ³IN TXT³ line which I¶m not going to get into
today but it is important later on when you¶re setting up you mail server.

Here is what the zone ³db.192.168.1Ǝ looks like.

1     $TTL 604800
2     @   IN SOA ns.bubba.net. hostmaster.bubba.net.           (
3            2000072801 ; serial
4            28800 ; refresh
5            7200 ; retry
6            604800 ; expire
7            86400 ; default -ttl
8            )
9    @     IN NS ns.bubba.net.
10   ;
11   101     IN    PTR mulder.bubba.net.
12   102     IN    PTR scully.bubba.net.
13   103     IN    PTR doggett.bubba.net.
14   ...
15   ...

The first 9 lines are essentially stating how long any Caching DNS Name Server should
cache this data before getting a fresh copy. The SOA ns.bubba.net is saying which machine
is the authority for this domain. The hostmaster.bubba.net is actually an email address that is
responsible for this domain, hostmaster@bubba.net.

Finally the zone ³db.127.0.0Ǝ which really serves no purpose other than as a backup in case
a host didn¶t configure itself correctly with the loopback address. Here is what my zone file
looks like:

1    $TTL 604800
2    @                  IN        SOA     ns.bubba.net.         hostmaster.bubba.net.          (
3                                 2000031801 ; serial
4                                 28800 ; refresh
5                                 7200 ; retry
6                                 604800 ; expire
7                                 86400 ; default_ttl
8                                 )
9    @                  IN        NS      ns.bubba.net.
10   ;
11   1                  IN        PTR       localhost.bubba.net.


The zone ³.´ uses a file called root.hints. Here is an example of what this file looks like.

1    ; <<>> DiG 9.3.4 -P1 <<>> @e.root-servers.net . ns
2    ; (1 server found )
3    ;; global options: printcmd
4    ;; Got answer:
5    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21247
6    ;; flags: qr aa rd; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 14
7
8    ;; QUESTION SECTION:
9    ;.                                    IN        NS
10
11   ;; ANSWER SECTION:
12   .                           518400    IN        NS         D.ROOT -SERVERS.NET.
13   .                           518400    IN        NS         C.ROOT -SERVERS.NET.
14   .                           518400    IN        NS         G.ROOT -SERVERS.NET.
15   .                           518400    IN         NS         L.ROOT -SERVERS.NET.
16   .                           518400    IN        NS         F.ROOT -SERVERS.NET.
17   .                           518400    IN        NS         I.ROOT -SERVERS.NET.
18   .                           518400    IN        NS         B.ROOT -SERVERS.NET.
19   .                            518400    IN        NS         J.ROOT -SERVERS.NET.
20   .                           518400    IN        NS         M.ROOT -SERVERS.NET.
21   .                              518400 IN        NS        K.ROOT    -SERVERS.NET.
22   .                              518400 IN        NS        H.ROOT    -SERVERS.NET.
23   .                               518400 IN        NS        A.ROOT   -SERVERS.NET.
24   .                              518400 IN        NS        E.ROOT    -SERVERS.NET.
25
26   ;; ADDITIONAL SECTION:
27   A.ROOT-SERVERS.NET.            3600000   IN     A         198.41.0.4
28   A.ROOT-SERVERS.NET.            3600000   IN      AAAA      2001:503:ba3e::2:30
29   B.ROOT-SERVERS.NET.            3600000   IN     A         192.228.79.201
30   C.ROOT-SERVERS.NET.            3600000   IN     A         192.33.4.12
31   D.ROOT-SERVERS.NET.            3600000   IN     A         128.8.10.90
32   E.ROOT-SERVERS.NET.            3600000   IN     A          192.203.230.10
33   F.ROOT-SERVERS.NET.            3600000   IN     A         192.5.5.241
34   F.ROOT-SERVERS.NET.            3600000   IN     AAAA      2001:500:2f::f
35   G.ROOT-SERVERS.NET.            3600000   IN     A         192.112.36.4
36   H.ROOT-SERVERS.NET.            3600000   IN     A         128.6 3.2.53
37   H.ROOT-SERVERS.NET.            3600000   IN     AAAA      2001:500:1::803f:235
38   I.ROOT-SERVERS.NET.            3600000   IN     A         192.36.148.17
39   J.ROOT-SERVERS.NET.            3600000   IN     A         192.58.128.30
40   J.ROOT-SERVERS.NET.            3600000   IN     AAAA      2001:503 :c27::2:30
41
42   ;;   Query time: 109 msec
43   ;;   SERVER: 192.203.230.10 #53(192.203.230.10)
44   ;;   WHEN: Fri Feb 20 03:49:01 2009
45   ;;   MSG SIZE rcvd: 500

Starting bind up

Once you have all this in place you can start up bind with this command.

1        /etc/init.d/named start




Configuring a host to use your DNS server
One final step is to configure your host to use your newly setup DNS Server as it¶s name
server. You can accomplish this by changing 2 files. /etc/resolv.conf and /etc/nsswitch.conf.

The /etc/resolv.conf should look like this:

1        search bubba.net
2        nameserver 192.168.1.101


The /etc/nsswitch.conf should have an entry like this in it:

1        ...
2        ...
3        hosts:         files dns
4        ...
5        ...

Taking it out for a test drive
You can see if it¶s working by poking the name server using host, dig, or nslookup. Here are
a couple of example quereies.
1    # host example
2    % host -l bubba.net
3    bubba.net name server ns.bubba.net.
4    bubba.net has address 192.168.1.1
5    ...
6    ...
7
8    # dig example
9    % dig ns.bubba.net
10
11   ; <<>> DiG 9.3.4 -P1 <<>> ns.bubba.net
12   ;; global options: printcmd
13   ;; Got answer:
14   ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 54856
15   ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
16
17   ;; QUESTION SECTION:
18   ;ns.bubba.net.                            IN   A
19
20   ;; ANSWER SECTION:
21   ns.bubba.net.                604800       IN   A    192.168.1.101
22
23   ;; AUTHORITY SECTION:
24   bubba.net.                       604800   IN   NS   ns.bubba.net.
25
26   ;;   Query time: 1 msec
27   ;;   SERVER: 192.168.1.101 #53(192.168.1.101)
28   ;;   WHEN: Sat Feb 28 20:54:46 2009
29   ;;   MSG SIZE rcvd: 60
30
31   # nslookup example
32   % nslookup ns.bubba.net
33   Server:         192.168.1.101
34   Address:        192.168.1.101 #53
35
36   Name:   ns.bubba.net
37   Address: 192.168.1.101




Enable user directory (public_html)
edit /etc/httpd/conf/httpd.conf

remove this line
UserDir disable

and uncomment this line
UserDir public_html

(or can just change the first line)

Then restart the server
/usr/sbin/apachectl restart
If SELinux is enabled (I did), you must also need to run these

/usr/sbin/setsebool -P httpd_enable_homedirs true
chcon -R -t httpd_sys_content_t /home/user-abc/public_html

(do not forget to change the path on the second line)




Cara Install CPanel di CentOS
Submitted by admin on Mon, 04/26/2010 - 01:12

   y   Tips & Tricks
   y   cpanel

Cara install CPanel di CentOS sangat mudah, karena CentOS adalah salah satu OS yang
direkomendasikan oleh CPanel. Caranya sbb:

   1. cd /home ² Opens the directory /home .
   2. wget -N http:/
      /layer1.cpanel.net/latest ² Fetches the latest installation file from the cPanel
      servers.
   3. sh latest ² Opens and runs the installation files.
   4.
      /usr/local/cpanel/cpkeyclt ² Activates your license after installation.

Maka otomatis CPanel akan terinstall di CentOS!




Konfigurasi Virtual Host di CentOS
Apa itu Virtual Host?

Virtual host berguna untuk pengaturan website atau URL dalam satu mesin atau satu IP,
contoh kita punya dua domain yaitu domainsatu.com dan domaindua.com tetapi kita hanya
punya satu mesin dengan IP 192.200.200.1 kemudian kita ingin semua domain tadi
mempunyai website yg berbeda-beda. Dengan konfigurasi pada virtual host kita dapat
menyelesaikan masalah ini.

1. check package apache

[root@rhesanu ~]# rpm -qa http*
httpd-2.0.52-41.ent.centos4
httpd-suexec-2.0.52-41.ent.centos4
httpd-manual-2.0.52-41.ent.centos4
httpd-devel-2.0.52-41.ent.centos4

2. Buat direktori untuk pengaturan domain
[root@localhost html]# mkdir -p /var/www/html/domainsatu.com/public_html/
[root@localhost html]# mkdir -p /var/www/html/domaindua.com/public_html/
pastikan direktori tersebut berada di document root.

3. Edit file /etc/httpd/conf/httpd.conf

[root@localhost html]# /etc/httpd/conf/httpd.conf
edit baris ini
NameVirtualHost 192.200.200.1:80

kemudian tambahkan baris ini
<VirtualHost 192.200.200.1:80>
ServerAdmin webmaster@domainsatu.com
DocumentRoot /var/www/html/domainsatu.com/public_html
ServerName domainsatu.com
ErrorLog /var/log/httpd/domainsatu.com-error_log
CustomLog /var/log/httpd/domainsatu.com-access_log common
</VirtualHost>

<VirtualHost 192.200.200.1:80>
ServerAdmin webmaster@domaindua.com
DocumentRoot /var/www/html/domaindua.com/public_html
ServerName domaindua.com
ErrorLog /var/log/httpd/domaindua.com-error_log
CustomLog /var/log/httpd/domaindua.com-access_log common
</VirtualHost>




4. Untuk melihat hasilnya kita dapat menambahkan file php pada domainsatu dan
domaindua
[root@localhost ~]# nano /var/www/html/domainsatu.com/public_html/index.php
<?php
echo ³this is domainsatu.com´;
?>

[root@localhost ~]# nano /var/www/html/domaindua.com/public_html/index.php
<?php
echo ³this is domaindua.com´;
?>

5. Kemudian restart apache
[root@localhost ~]# service httpd restart
Stopping httpd:                         [ OK ]
Starting httpd:                        [ OK ]

setelah itu coba browsing domainsatu.com dan domaindua.com, seperti gambar di bawah ini




tetapi pada saat kita menambahkan url dengan www.domainsatu.com dan
www.domaindua.com ada masalah, www.domaindua.com berisi domainsatu.com.
lihat gambar dibawah ini:
Perhatikan pada alamat url dan isi url ada kesalahan pada www.domain satu.com berisi this is
domainsatu.com pada domain ini benar tetapi perhatikan pada www.domaindua.com kenapa
berisi isi dari domainsatu.com???

6. untuk masalah diatas tambahkan server alias pada file /etc/httpd/conf/httpd.conf.
[root@localhost ~]# /etc/httpd/conf/httpd.conf
tambahkan baris di bawah ini
ServerAlias www.domaindua.com

lihat gambar dibawah ini:




setelah itu lihat hasilnya:
How to i tall cPanel/ HM on CentOS
Hell     l

        e will be st ti wit t e basi s, how to i stall cPanel/ HM on Cent         I will be
using Cent    5.5 64-bit as my base OS; this will be the same for RedHat and for 32-bit also.

First we need to start with a fresh install of CentOS, you don¶t need to install anything li e
Apache, MySQL, etc as the cPanel installer will take care of it all for us.

When reading this tutorial, I am going to assuming you know the basics of a shell (aka using
SSH as some would say, if your running Windows I recommend PuTTy).

Ok, the first step is to make sure you are logged into your shell, the screen should look
something similar to below.




Once we are both there, the next command will be to make the µcpinstall¶ folder in your
/home directory, you can do that by running the code below.

# mkdir /home/cpinstall

This will make the necessary folder on the file system for us to start with, next we will want
to move, or as some will know it as µcd¶ into that folder. You can do that by running the
below command.

# cd /home/cpinstall
Now that we are there, we will need to download the appropriate file to start the cPanel
install. This file is always updated, so by running the below command you¶ll always get the
newest version of cPanel installed on your server/ PS.

# wget http://layer1.cpanel.net/latest

If everything goes well with that, your shell window will look something like this.




Now that we are upto this point, we can start the install process. Depending on how fast the
system is, and how fast your network connection is, this can take anywhere from 30 minutes
to 4 hours. Usually for me, I can say it takes about 2 hours. You can invoke the installer by
running the command below.

# sh latest

After running that code, you should see a cPanel logo come on the screen and the install will
start. There will be no need for any user intervention unless there is a problem. Once the
screen looks like below you are safe to walk away.




Once the install is complete your SSH screen will look something like this:
In my case, it was telling me I need to restart my server. Once restarted, you can access the
WHM by going to http://IPHERE:2086.

Once this is done, you¶ll get a screen like this:




Your default login username is µroot¶, and your password is your root password

Weitere ähnliche Inhalte

Was ist angesagt?

Free ipa installation and cluster configuration, freeipa client connection
Free ipa installation and cluster configuration, freeipa client connectionFree ipa installation and cluster configuration, freeipa client connection
Free ipa installation and cluster configuration, freeipa client connectionRustam Sariyev
 
How to Block Malicious Address by Using Feed Service?
How to Block Malicious Address by Using Feed Service?How to Block Malicious Address by Using Feed Service?
How to Block Malicious Address by Using Feed Service?İbrahim UÇAR
 
Linux apache installation
Linux apache installationLinux apache installation
Linux apache installationDima Gomaa
 
Membangun web server,_e-mail_server_dan_ftp_server
Membangun web server,_e-mail_server_dan_ftp_serverMembangun web server,_e-mail_server_dan_ftp_server
Membangun web server,_e-mail_server_dan_ftp_serverIwan Kurniarasa
 
How To Deploy A Cloud Based Webserver in 5 minutes - LAMP
How To Deploy A Cloud Based Webserver in 5 minutes - LAMPHow To Deploy A Cloud Based Webserver in 5 minutes - LAMP
How To Deploy A Cloud Based Webserver in 5 minutes - LAMPMatt Dunlap
 
Install and configure linux
Install and configure linuxInstall and configure linux
Install and configure linuxVicent Selfa
 
[MathWorks] Versioning Infrastructure
[MathWorks] Versioning Infrastructure[MathWorks] Versioning Infrastructure
[MathWorks] Versioning InfrastructurePerforce
 
Configuration Firewalld On CentOS 8
Configuration Firewalld On CentOS 8Configuration Firewalld On CentOS 8
Configuration Firewalld On CentOS 8Kaan Aslandağ
 
How to Build Package in Linux Based Systems.
How to Build Package in Linux Based Systems.How to Build Package in Linux Based Systems.
How to Build Package in Linux Based Systems.İbrahim UÇAR
 
WE18_Performance_Up.ppt
WE18_Performance_Up.pptWE18_Performance_Up.ppt
WE18_Performance_Up.pptwebhostingguy
 
Cent os 5.1 - configuring samba 3.0 to use the ads security mode
Cent os 5.1  - configuring samba 3.0 to use the ads security modeCent os 5.1  - configuring samba 3.0 to use the ads security mode
Cent os 5.1 - configuring samba 3.0 to use the ads security modeB Sasi Kumar
 
Implementing DNS in Samba PDC
Implementing DNS in Samba PDCImplementing DNS in Samba PDC
Implementing DNS in Samba PDCJalpa Soni
 
Tested install-isp config3-ubuntu-16-04
Tested install-isp config3-ubuntu-16-04Tested install-isp config3-ubuntu-16-04
Tested install-isp config3-ubuntu-16-04SANTIAGO HERNÁNDEZ
 
Linux Webserver Installation Command and GUI.ppt
Linux Webserver Installation Command and GUI.pptLinux Webserver Installation Command and GUI.ppt
Linux Webserver Installation Command and GUI.pptwebhostingguy
 
Using aphace-as-proxy-server
Using aphace-as-proxy-serverUsing aphace-as-proxy-server
Using aphace-as-proxy-serverHARRY CHAN PUTRA
 
Apache installation and configurations
Apache installation and configurationsApache installation and configurations
Apache installation and configurationsNikhil Jain
 

Was ist angesagt? (20)

Linux
LinuxLinux
Linux
 
Free ipa installation and cluster configuration, freeipa client connection
Free ipa installation and cluster configuration, freeipa client connectionFree ipa installation and cluster configuration, freeipa client connection
Free ipa installation and cluster configuration, freeipa client connection
 
How to Block Malicious Address by Using Feed Service?
How to Block Malicious Address by Using Feed Service?How to Block Malicious Address by Using Feed Service?
How to Block Malicious Address by Using Feed Service?
 
Linux apache installation
Linux apache installationLinux apache installation
Linux apache installation
 
Step by-step installation of a secure linux web dns- and mail server
Step by-step installation of a secure linux web  dns- and mail serverStep by-step installation of a secure linux web  dns- and mail server
Step by-step installation of a secure linux web dns- and mail server
 
Membangun web server,_e-mail_server_dan_ftp_server
Membangun web server,_e-mail_server_dan_ftp_serverMembangun web server,_e-mail_server_dan_ftp_server
Membangun web server,_e-mail_server_dan_ftp_server
 
How To Deploy A Cloud Based Webserver in 5 minutes - LAMP
How To Deploy A Cloud Based Webserver in 5 minutes - LAMPHow To Deploy A Cloud Based Webserver in 5 minutes - LAMP
How To Deploy A Cloud Based Webserver in 5 minutes - LAMP
 
Install and configure linux
Install and configure linuxInstall and configure linux
Install and configure linux
 
[MathWorks] Versioning Infrastructure
[MathWorks] Versioning Infrastructure[MathWorks] Versioning Infrastructure
[MathWorks] Versioning Infrastructure
 
Configuration Firewalld On CentOS 8
Configuration Firewalld On CentOS 8Configuration Firewalld On CentOS 8
Configuration Firewalld On CentOS 8
 
How to Build Package in Linux Based Systems.
How to Build Package in Linux Based Systems.How to Build Package in Linux Based Systems.
How to Build Package in Linux Based Systems.
 
WE18_Performance_Up.ppt
WE18_Performance_Up.pptWE18_Performance_Up.ppt
WE18_Performance_Up.ppt
 
Cent os 5.1 - configuring samba 3.0 to use the ads security mode
Cent os 5.1  - configuring samba 3.0 to use the ads security modeCent os 5.1  - configuring samba 3.0 to use the ads security mode
Cent os 5.1 - configuring samba 3.0 to use the ads security mode
 
are available here
are available hereare available here
are available here
 
Implementing DNS in Samba PDC
Implementing DNS in Samba PDCImplementing DNS in Samba PDC
Implementing DNS in Samba PDC
 
Tested install-isp config3-ubuntu-16-04
Tested install-isp config3-ubuntu-16-04Tested install-isp config3-ubuntu-16-04
Tested install-isp config3-ubuntu-16-04
 
Linux Webserver Installation Command and GUI.ppt
Linux Webserver Installation Command and GUI.pptLinux Webserver Installation Command and GUI.ppt
Linux Webserver Installation Command and GUI.ppt
 
Using aphace-as-proxy-server
Using aphace-as-proxy-serverUsing aphace-as-proxy-server
Using aphace-as-proxy-server
 
Apache installation and configurations
Apache installation and configurationsApache installation and configurations
Apache installation and configurations
 
Apache1.ppt
Apache1.pptApache1.ppt
Apache1.ppt
 

Ähnlich wie Tutorial CentOS 5 untuk Webhosting

Dru lavigne servers-tutorial
Dru lavigne servers-tutorialDru lavigne servers-tutorial
Dru lavigne servers-tutorialDru Lavigne
 
Drupal Continuous Integration with Jenkins - The Basics
Drupal Continuous Integration with Jenkins - The BasicsDrupal Continuous Integration with Jenkins - The Basics
Drupal Continuous Integration with Jenkins - The BasicsJohn Smith
 
Step by step_linux_guide
Step by step_linux_guideStep by step_linux_guide
Step by step_linux_guidevinod31dec
 
Configuring Your First Hadoop Cluster On EC2
Configuring Your First Hadoop Cluster On EC2Configuring Your First Hadoop Cluster On EC2
Configuring Your First Hadoop Cluster On EC2benjaminwootton
 
Linux conf-admin
Linux conf-adminLinux conf-admin
Linux conf-adminbadamisri
 
Linux conf-admin
Linux conf-adminLinux conf-admin
Linux conf-adminbadamisri
 
TrinityCore server install guide
TrinityCore server install guideTrinityCore server install guide
TrinityCore server install guideSeungmin Shin
 
Project-make a public website server using raspberry pi
Project-make a public website server using raspberry piProject-make a public website server using raspberry pi
Project-make a public website server using raspberry piFahim Hossain
 
Large Scale Deployment of Linux
Large Scale Deployment of LinuxLarge Scale Deployment of Linux
Large Scale Deployment of LinuxKshitij Agarwal
 
Squid proxy-configuration-guide
Squid proxy-configuration-guideSquid proxy-configuration-guide
Squid proxy-configuration-guidejasembo
 

Ähnlich wie Tutorial CentOS 5 untuk Webhosting (20)

Dru lavigne servers-tutorial
Dru lavigne servers-tutorialDru lavigne servers-tutorial
Dru lavigne servers-tutorial
 
Drupal Continuous Integration with Jenkins - The Basics
Drupal Continuous Integration with Jenkins - The BasicsDrupal Continuous Integration with Jenkins - The Basics
Drupal Continuous Integration with Jenkins - The Basics
 
Step by step_linux_guide
Step by step_linux_guideStep by step_linux_guide
Step by step_linux_guide
 
Dhcp
DhcpDhcp
Dhcp
 
Openvpn
OpenvpnOpenvpn
Openvpn
 
Howto Pxeboot
Howto PxebootHowto Pxeboot
Howto Pxeboot
 
Configuring Your First Hadoop Cluster On EC2
Configuring Your First Hadoop Cluster On EC2Configuring Your First Hadoop Cluster On EC2
Configuring Your First Hadoop Cluster On EC2
 
Sun raysetup
Sun raysetupSun raysetup
Sun raysetup
 
Its3 Drupal
Its3 DrupalIts3 Drupal
Its3 Drupal
 
Linux conf-admin
Linux conf-adminLinux conf-admin
Linux conf-admin
 
Linux conf-admin
Linux conf-adminLinux conf-admin
Linux conf-admin
 
Linux Conf Admin
Linux Conf AdminLinux Conf Admin
Linux Conf Admin
 
DNS,SMTP and POP3
DNS,SMTP and POP3DNS,SMTP and POP3
DNS,SMTP and POP3
 
main
mainmain
main
 
TrinityCore server install guide
TrinityCore server install guideTrinityCore server install guide
TrinityCore server install guide
 
Its3 Drupal
Its3 DrupalIts3 Drupal
Its3 Drupal
 
Project-make a public website server using raspberry pi
Project-make a public website server using raspberry piProject-make a public website server using raspberry pi
Project-make a public website server using raspberry pi
 
Large Scale Deployment of Linux
Large Scale Deployment of LinuxLarge Scale Deployment of Linux
Large Scale Deployment of Linux
 
Squid proxy-configuration-guide
Squid proxy-configuration-guideSquid proxy-configuration-guide
Squid proxy-configuration-guide
 
Samba
SambaSamba
Samba
 

Mehr von Beni Krisbiantoro

Pembahasan Soal UKK TKJ 2017 - Paket 3
Pembahasan Soal UKK TKJ 2017 - Paket 3Pembahasan Soal UKK TKJ 2017 - Paket 3
Pembahasan Soal UKK TKJ 2017 - Paket 3Beni Krisbiantoro
 
Pembahasan Soal UKK TKJj 2017 - Paket 2
Pembahasan Soal UKK TKJj 2017 - Paket 2Pembahasan Soal UKK TKJj 2017 - Paket 2
Pembahasan Soal UKK TKJj 2017 - Paket 2Beni Krisbiantoro
 
Membangun Aplikasi SMS dengan Gammu dan PHP Framework CodeIgniter
Membangun Aplikasi SMS dengan Gammu dan PHP Framework CodeIgniterMembangun Aplikasi SMS dengan Gammu dan PHP Framework CodeIgniter
Membangun Aplikasi SMS dengan Gammu dan PHP Framework CodeIgniterBeni Krisbiantoro
 
Business Intelligence - Overview
Business Intelligence - Overview Business Intelligence - Overview
Business Intelligence - Overview Beni Krisbiantoro
 
Javascript Guide - Belajar Pemrograman JavaScript
Javascript Guide - Belajar Pemrograman JavaScriptJavascript Guide - Belajar Pemrograman JavaScript
Javascript Guide - Belajar Pemrograman JavaScriptBeni Krisbiantoro
 
Tutorial Installasi Ubuntu 11.04 untuk Webhost dengan Webmin dan Virtualmin
Tutorial Installasi Ubuntu 11.04 untuk Webhost dengan Webmin dan VirtualminTutorial Installasi Ubuntu 11.04 untuk Webhost dengan Webmin dan Virtualmin
Tutorial Installasi Ubuntu 11.04 untuk Webhost dengan Webmin dan VirtualminBeni Krisbiantoro
 
Database design, implementation, and management -chapter04
Database design, implementation, and management -chapter04Database design, implementation, and management -chapter04
Database design, implementation, and management -chapter04Beni Krisbiantoro
 
Database design, implementation, and management -chapter02
Database design, implementation, and management -chapter02Database design, implementation, and management -chapter02
Database design, implementation, and management -chapter02Beni Krisbiantoro
 
Belajar PHP Framework CodeIgniter 2.x
Belajar PHP Framework CodeIgniter 2.xBelajar PHP Framework CodeIgniter 2.x
Belajar PHP Framework CodeIgniter 2.xBeni Krisbiantoro
 

Mehr von Beni Krisbiantoro (13)

Pembahasan Soal UKK TKJ 2017 - Paket 3
Pembahasan Soal UKK TKJ 2017 - Paket 3Pembahasan Soal UKK TKJ 2017 - Paket 3
Pembahasan Soal UKK TKJ 2017 - Paket 3
 
Pembahasan Soal UKK TKJj 2017 - Paket 2
Pembahasan Soal UKK TKJj 2017 - Paket 2Pembahasan Soal UKK TKJj 2017 - Paket 2
Pembahasan Soal UKK TKJj 2017 - Paket 2
 
Tutorial Mikrotik Bagian 1
Tutorial Mikrotik Bagian 1Tutorial Mikrotik Bagian 1
Tutorial Mikrotik Bagian 1
 
Tutorial Mikrotik Bagian 2
Tutorial Mikrotik Bagian 2Tutorial Mikrotik Bagian 2
Tutorial Mikrotik Bagian 2
 
Membangun Aplikasi SMS dengan Gammu dan PHP Framework CodeIgniter
Membangun Aplikasi SMS dengan Gammu dan PHP Framework CodeIgniterMembangun Aplikasi SMS dengan Gammu dan PHP Framework CodeIgniter
Membangun Aplikasi SMS dengan Gammu dan PHP Framework CodeIgniter
 
Business Intelligence - Overview
Business Intelligence - Overview Business Intelligence - Overview
Business Intelligence - Overview
 
Javascript Guide - Belajar Pemrograman JavaScript
Javascript Guide - Belajar Pemrograman JavaScriptJavascript Guide - Belajar Pemrograman JavaScript
Javascript Guide - Belajar Pemrograman JavaScript
 
Tutorial Installasi Ubuntu 11.04 untuk Webhost dengan Webmin dan Virtualmin
Tutorial Installasi Ubuntu 11.04 untuk Webhost dengan Webmin dan VirtualminTutorial Installasi Ubuntu 11.04 untuk Webhost dengan Webmin dan Virtualmin
Tutorial Installasi Ubuntu 11.04 untuk Webhost dengan Webmin dan Virtualmin
 
Database design, implementation, and management -chapter04
Database design, implementation, and management -chapter04Database design, implementation, and management -chapter04
Database design, implementation, and management -chapter04
 
ARP Spoofing
ARP SpoofingARP Spoofing
ARP Spoofing
 
Database design, implementation, and management -chapter02
Database design, implementation, and management -chapter02Database design, implementation, and management -chapter02
Database design, implementation, and management -chapter02
 
Belajar PHP Framework CodeIgniter 2.x
Belajar PHP Framework CodeIgniter 2.xBelajar PHP Framework CodeIgniter 2.x
Belajar PHP Framework CodeIgniter 2.x
 
VNC User Guide
VNC User GuideVNC User Guide
VNC User Guide
 

Kürzlich hochgeladen

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 

Kürzlich hochgeladen (20)

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 

Tutorial CentOS 5 untuk Webhosting

  • 1. Instalasi CentOS Bagi teman-teman yang senang ngutak-ngatik server, atau yang senang dengan OS yg berbasiskan linux. Saya punya pengalaman tersendiri dalam menyiapkan sebuah server, dalam waktu yang tidak sampai satu rokok jie sam su habis, server ini sudah kelar digunakan. Tentu saja supaya server ini berguna hingga bisa mengudara, anda harus punya jaringan internet sekaligus dengan IP Public (Static) yang disediakan oleh ISP anda. Paling tidak anda harus sudah menyediakan dua IP address. IP local dan IP Public. IP local untuk memudahkan anda masuk melalui jaringan local dan lebih cepat, hampir tanpa kendala. Sedang kalau menggunakan IP Public pun sebetulnya juga tidak masalah. Kelebihannya, kalau dengan IP Public anda bisa mengaksess server anda dari manasaja dan di manasaja anda berada. Kekurangannya, IP Public itu bukan milik kita murni. Jadi jika pada kondisi tertentu (katakanlah diblokir oleh ISP anda karena satu dan lain hal), maka anda tidak bisa masuk lagi melalui IP ini. Kita mulai saja: Pertama, anda harus menyediakan software CentOS Server ini dengan cara download. TIdak terlalu besar sih ukurannya, sekitar 600 Mb, tepatnya 580Mb. Yah« 1 CD saja: Anda bisa memilih cara download dan jenis filenya; ada dua: 1. Jika anda menggunakan OS windows anda bisa langsung download ke alamat ini : http://vault.centos.org/4.4/isos/i386/CentOS-4.4.ServerCD-i386.iso 2. Jika sudah selesai downloadnya, anda tinggal memburning pake nero atau ashampo atau software burning lainnya kesukaan anda. Sediakan satu blank cd untuk diburning di media ini. 3. Jika sudah selesai, maka anda telah memiliki satu master cd CentOS Server versi 4. Kedua, sediakan satu mesin computer yang akan dijadikan server oleh anda. Semakin besar spesifikasinya semakin baik. Kalaupun pakai Pentium III pun sebetulnya sudah bisa dengan kapasitas Hardisk 30 G dan RAM minimal 512 kb atau 1024 kb. Ini adalah ukuran minimalis untuk server web yang tidak terlalu besar muatannya. Tapi jika anda mempunyai spesifikasi server yang handal (seperti XEON dari HP mutakhir, misalnya) itu sangat dianjurkan.
  • 2. Jangan lupa untuk menyiapkan dua LAN Card. Kalau CPU anda menyediakan LAN onboard. Berarti anda cukup menyediakan satu LAN Card saja. Kita asusmsikan masing- masin LAN Card ini, dengan nama: eth0 untuk IP local. Misalkan 192.168.50.7. Sedangkan LAN Card lainnya kita namakan: eth1 misalkan 222.156.134.170. Gambarnya sbb: 1. LAN Card OnBoard, dengan nama : eth0 IP: 192.168.50.7 2. LAN Card External, dengan nama : eth1 IP:222.156.134.170 Kita mulai install. Pertama masukkan CD CentOS Server anda ke Driver. Kemudian anda restart computer anda. Ketika tampilan pertama muncul. Ada dua pilihan untk memulai menginstall ini: Pertama berbasiskan GUI, artinya anda menginstall dengan full tampilan yang familiar, tinggal klik saja. Kedua berbasiskan text. Dari model kedua ini anda hampir sepenuhnya menggunakan text, tapi masih juga dibantu dengan grafis-grafis ringan untuk interaksi dengan anda. Saya sarankan, untuk install pertama, sebaiknya jangan menggunakan Firewall bawaan dari CentOS. Lebh baik Firewall jangan diaktifkan. Firewall bisa kita sediakan sendiri setelah installasi selesai. Dan akan kita bahas pada artikel sendiri. Pada saat option muncul sebelum installasi. Ada beberapa hal prinsip yang harus anda perhatikan: Ketika option untuk mengatur partisi, anda tinggal pilih remove all partition. Dan biarkan linux untuk auto configurasi. Sebab dengan sendirinya linux akan secara otomatis mengatur partisinya dengan baik. Perlu diketahui, partisi di linux dengan di windows sangat berbeda. Anda tidak perlu pusing-pusing mikirkan ini. Tinggal ok dan next. Terkecuali ketika ada option tentang firewall, untuk sementara klik pakai spasi di checklist DISABLE-nya ( option ini hampir sama, antara yg berbasis text dengan GUI). Anda tinggal perhatikan secara seksama. Ketika ada option untuk costumasi server, pilih ini. Jangan lupa untuk mencheklist, antara lain: DNS server, jika anda akan membuat server dns sekalian pada server ini. Karena didalamnya disiapkan software Bind (named) untuk manajemen domain. Jika tidak. Maka tidak perlu dichecklist. Untuk menyaipkan manajemen domain, akan dibuat artikel tersendiri. MYSQL Server, anda harus pilih ini jika anda hendak menggunakan MYSQL sebagai basis data di server anda. Atau pilih juga POSTGRESQL jika anda termasuk pecinta POSTGRE. Kalau saya masih setia pada MySQL. Jadi PostgreSql tidak saya checklist. Web Server, harus dipilih sebab didalamnya terdapat httpd dari apache yang akan menggerakkan server anda untuk bisa menampilkan halaman web.> Anda pun bisa menchecklist Mail Server, jika anda hendak mengembangkan server anda untuk mail server juga. ( Ini disarankan bagi yang servernya cukup handal dan belum
  • 3. ada mesin server lain untuk dijadikan mail server). Untuk bab membuat mail server, akan ada artikel tersendiri. Ketika masuk pada opsi manajemen IP. Jangan dichecklist DHCP-nya. Sebagaimana yg kita tentukan sebelumnya, untuk Card yang inisialnya eth0 anda isi dengan no IP 192.168.50.7 netmask 255.255.255.240 atau disesuaikan dengan netmask dari ISP anda. Demikian juga eth1 dengan no IP 222.156.134.170 netmask 255.255.255.240 atau disesuaikan dengan netmask dari ISP anda. Kemudian isi nama server anda dengan nama favorit anda sendiri. Defaultya localhost.localdomain anda bisa mengganti dengan sidukun.domain.com atau apa saja kesukaan anda. Berikutnya, jangan lupa untuk mengisi Gateway. Masukkan no Gateway, Primary Server, Secondary Server yang diberikan oleh ISP anda. Misalnya: Gateway: 222.245.250.200 Primary Server : 202.13.2.5 Secondary Server : 202.134.0.155 Perhatikan baik-baik, apa-apa yang perlu untuk di server anda nanti. Atau langsung saja pada langkah instalasi. Anda tidak perlu khawatir urusan dengan software yang tidak terinstall. Hal ini akan bisa dilakukan ketika server telah selesai diinstall, dengan menggunakan perintah YUM INSTALL. GO! Install. Anda tinggal minum kopi sambil mengisap ji sam su ( bagi yg suka rokok) menunggu sampai selesai install. Linux akan dengan pintarnya mengolah file-filenya di server anda. Pada tahap ini, jika tidak ada aral melintang, berarti anda sukses installasi server anda. Horeeee.....! Jika masih penasaran, anda bisa kontak saya unt sharing. Setup a DNS Server on CentOS 5 This is a pretty geeky thing to do but running your own DNS Server on your intranet does make some sense from a performance and conveience perspective. Background The sole purpose of a DNS Server is to provide a look-up service for mapping hostnames e.g. www.google.com to IP addresses 100.101.20.2. By far the most popular DNS Server software out there is a package called bind. There are essentially 2 reasons to running your own DNS Server. 1. Improving the speed of hostname lookups 2. Managing your own intranet hostnames & IP addresses in a central location
  • 4. The first reason is what is commonly called a Caching Name Server. In essence by having one machine provide all hostname look-ups in your intranet, you¶re cutting down on every machine in your intranet having to independently look-up names. Additionally once a name is looked up your DNS Server will cache the results for a set period of time so that subsequent queries can come out of your DNS Server¶s cache and not have to go and do the look-up on your ISPs DNS Server. The second reason is actually the cooler one. Since you control the DNS Server you can create your own local domain (called zones in bind lingo) and name all the systems within your intranet. In so doing this it¶s much easier to connect to systems using names rather than IP addresses. Plus it¶s fun to name all the systems! Taking this a step further you can create generic hostnames such as imap, mail, smtp, ntp, pop, etc. and manage these in one stop rather than having to manage them throughout your intranet. Getting started First things first, install the necessary bind software. 1 yum install bind bind-utils bind -libs Generating a rndc key NOTE: All the config files we¶re going to work on are located in /var/named/chroot Next you¶ll need to create/modify a rndc.conf and/or rndc.key file. This file contains a key which is required in order to manage the bind service once it¶s up and running. With this key you can theoretically manage bind either on the host where it¶s running or you can manage it on any system that is allowed to do so and knows this key! 1 # command to generate a new 512 byte key 2 rndc-confgen -b 512 This command will return the following output which you¶ll want to either redirect to a file or copy and paste into a file. The file should be rndc.conf but I like to use this name instead, /var/named/chroot/etc/rndc.key. It just makes more sense to me. 1 # Start of rndc.conf 2 key "rndckey" { 3 algorithm hmac -md5; 4 secret 5 "nHFS3WOpdap75IvsYSXVNYWusnAQPT6z5XC8V5YPWXnZ8RN8tdfSFuClZ8nNouWyGhvHB8mE 6 TJgwsrvhiYhIhA==" ; 7 }; 8 9 options { 1 default-key "rndckey" ; 0 default-server 127.0.0.1; 1 default-port 953; 1 }; 1 # End of rndc.conf 2
  • 5. The rndc-confgen command also returns some additional output below. This goes into the file /var/named/chroot/etc/named.conf. Make sure to remove the comments at the beginning of each line to turn them on. # Use with the following in named.conf, adjusting the allow list as 1 needed: 2 key "rndckey" { 3 algorithm hmac -md5; 4 secret 5 "nHFS3WOpdap75IvsYSXVNYWusnAQPT6z5XC8V5YPWXnZ8RN8tdfSFuClZ8nNouWyGhvHB8mE 6 TJgwsrvhiYhIhA==" ; 7 }; 8 # 9 controls { 1 inet 127.0.0.1 port 953 0 allow { 127.0.0.1; } keys { "rndckey" ; }; 1 }; 1 # End of named.conf named.conf file Now let¶s flesh out that named.conf file a little bit more. 1 acl lan { 2 192.168.1.0 /24; 3 127.0.0.1; 4 }; 5 6 controls { 7 inet 127.0.0.1 port 953 8 allow { lan; } keys { "rndckey"; }; 9 }; 10 11 logging { 12 category default { default_syslog; }; 13 category lame -servers { null; }; 14 }; 15 16 options { 17 pid-file "/var/run/named/named.pid" ; 18 directory "/var/named" ; 19 dump-file "named_dump.db" ; 20 forward only; 21 forwarders { 22 # the following IP addresses are my ISPs DNS Servers. These will 23 be used for looking up 24 # hostnames that I don't locally manage, i .e. the REST OF THE 25 INTERNET! 26 24.92.226.40; # my ISPs DNS Server #1 27 24.92.226.41; # my ISPs DNS Server #2 28 }; 29 /* 30 * If there is a firewall between you and nameservers you want 31 * to talk to, you might need to uncomment the query -source 32 * directive below. Previous versions of BIND always asked 33 * questions using port 53, but BIND 8.1 uses an unprivileged 34 * port by default. 35 */
  • 6. 36 query-source address * port 53; 37 allow-query { lan; }; 38 allow-recursion { lan; }; 39 allow-transfer { lan; }; 40 }; 41 42 zone "bubba.net" { 43 type master; 44 file "data/db.bubba.net" ; 45 }; 46 zone "0.0.127.in -addr.arpa" { 47 type master; 48 file "data/db.127.0.0" ; 49 }; 50 zone "1.168.192.in -addr.arpa" { 51 type master; 52 file "data/db.192.168.1" ; 53 }; 54 zone "." { 55 type hint; file "root.hints" ; }; Here is a quick rundown of what¶s going on here. The acl lan creates an access control list that includes 192.168.1.0/24 and 127.0.0.1 so that only hosts within these IP address ranges can remotely manage and use this bind instance. 192.168.1.0/24 means IP addresses in the range 192.168.1.1 ± 192.168.1.255. The zones, ³bubba.net´, ³0.0.127.in-addr.arpa´, ³1.168.192.in-addr.arpa´, and ³.´ are all essentially files containing either hostname ĺ IP address mappings or IP address ĺ hostname mappings that this bind server will be responsible for. Bulding zone files The first zone: ³bubba.net´ includes all the hostnames and the IP addresses they point to. So these would be my systems: y scully.bubba.net y mulder.bubba.net y doggett.bubba.net The second and third zones: ³0.0.127.in-addr.arpa´ and ³1.168.192.in-addr.arpa´ are special zones that provide ³reverse´ name look-ups. These are when you look up a IP address and want to know what name(s) are associated with it. For example: y 192.168.1.100 y 192.168.1.101 The fourth zone: ³.´ is a special zone that makes this bind server act as a caching name server, for any hostnames and IP addresses that fall outside of the first 3 zones. These hostname and IP address look-ups will be forwarded to my ISPs DNS Server, and the results cached here for subsequent quereies. Here is what the zone ³bubba.net´ looks like.
  • 7. $TTL 604800 1 ; 2 ; Zone file for bubba.net 3 ; 4 ; Mandatory minimum for a working domain 5 ; 6 @ IN SOA ns.bubba.net. hostmaster.bubba.net. ( 7 2000072802 ; serial 8 28800 ; refresh 9 7200 ; retry 10 3600000 ; expire 11 86400 ; default_ttl 12 ) 13 @ IN NS ns.bubba.net. 14 @ IN MX 10 mail.bubba.net. 15 @ IN MX 20 mail.bubba.net. 16 ; 17 ; Provide familiar names to services but 18 ; acutally all are coming from XXXXX 19 ; These need to be bound to the address directly, no CNAME 's. 20 ; ----------------------------------------------------------- 21 bubba.net. IN A 192.168.1.1 22 ; 23 hostmaster.bubba.net. IN A 192.168.1.101 24 ns.bubba.net. IN A 192.168.1.101 25 ... 26 ... 27 ; Subnet 192.168.1 machines 28 ; ------------------------- 29 mulder.bubba.net. IN A 192.168.1.1 30 mulder.bubba.net. IN HINFO "AMD Athlon(tm) Dual Core 31 Processor 4850e 2.2GHz" "LINUX" 32 mulder.bubba.net. IN MX 10 mail.bubba.net. 33 mulder.bubba.net. IN TXT "" 34 scully.bubba.net. IN A 192.168.1.2 35 scully.bubba.net. IN HINFO "Celeron 450" "Windows 2000 " 36 scully.bubba.net. IN MX 10 mail.bubba.net. 37 scully.bubba.net. IN TXT "" 38 ... 39 ... The first 16 lines are pretty standard. These setup a TTL or Time To Live which means how long any of this data should be cache. Line 14 denotes which machine is the SOA, Start of Authority, ns.bubba.net is the master of this domain is what it¶s saying 8-). Lines 15 & 16 state which machine is the mail exchange for this domain. I only have one mail exchange so I just list it twice. The most important section in this file starts with the declaration of hostnames. Each hostname gets 4 lines. A ³IN A´ line which tells you the IP address for this hostname. The ³IN HINFO³ which is just a description of the host itself. The ³IN MX´ states who the mail exchange is for this host. And finally the ³IN TXT³ line which I¶m not going to get into today but it is important later on when you¶re setting up you mail server. Here is what the zone ³db.192.168.1Ǝ looks like. 1 $TTL 604800 2 @ IN SOA ns.bubba.net. hostmaster.bubba.net. (
  • 8. 3 2000072801 ; serial 4 28800 ; refresh 5 7200 ; retry 6 604800 ; expire 7 86400 ; default -ttl 8 ) 9 @ IN NS ns.bubba.net. 10 ; 11 101 IN PTR mulder.bubba.net. 12 102 IN PTR scully.bubba.net. 13 103 IN PTR doggett.bubba.net. 14 ... 15 ... The first 9 lines are essentially stating how long any Caching DNS Name Server should cache this data before getting a fresh copy. The SOA ns.bubba.net is saying which machine is the authority for this domain. The hostmaster.bubba.net is actually an email address that is responsible for this domain, hostmaster@bubba.net. Finally the zone ³db.127.0.0Ǝ which really serves no purpose other than as a backup in case a host didn¶t configure itself correctly with the loopback address. Here is what my zone file looks like: 1 $TTL 604800 2 @ IN SOA ns.bubba.net. hostmaster.bubba.net. ( 3 2000031801 ; serial 4 28800 ; refresh 5 7200 ; retry 6 604800 ; expire 7 86400 ; default_ttl 8 ) 9 @ IN NS ns.bubba.net. 10 ; 11 1 IN PTR localhost.bubba.net. The zone ³.´ uses a file called root.hints. Here is an example of what this file looks like. 1 ; <<>> DiG 9.3.4 -P1 <<>> @e.root-servers.net . ns 2 ; (1 server found ) 3 ;; global options: printcmd 4 ;; Got answer: 5 ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21247 6 ;; flags: qr aa rd; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 14 7 8 ;; QUESTION SECTION: 9 ;. IN NS 10 11 ;; ANSWER SECTION: 12 . 518400 IN NS D.ROOT -SERVERS.NET. 13 . 518400 IN NS C.ROOT -SERVERS.NET. 14 . 518400 IN NS G.ROOT -SERVERS.NET. 15 . 518400 IN NS L.ROOT -SERVERS.NET. 16 . 518400 IN NS F.ROOT -SERVERS.NET. 17 . 518400 IN NS I.ROOT -SERVERS.NET. 18 . 518400 IN NS B.ROOT -SERVERS.NET. 19 . 518400 IN NS J.ROOT -SERVERS.NET. 20 . 518400 IN NS M.ROOT -SERVERS.NET.
  • 9. 21 . 518400 IN NS K.ROOT -SERVERS.NET. 22 . 518400 IN NS H.ROOT -SERVERS.NET. 23 . 518400 IN NS A.ROOT -SERVERS.NET. 24 . 518400 IN NS E.ROOT -SERVERS.NET. 25 26 ;; ADDITIONAL SECTION: 27 A.ROOT-SERVERS.NET. 3600000 IN A 198.41.0.4 28 A.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:503:ba3e::2:30 29 B.ROOT-SERVERS.NET. 3600000 IN A 192.228.79.201 30 C.ROOT-SERVERS.NET. 3600000 IN A 192.33.4.12 31 D.ROOT-SERVERS.NET. 3600000 IN A 128.8.10.90 32 E.ROOT-SERVERS.NET. 3600000 IN A 192.203.230.10 33 F.ROOT-SERVERS.NET. 3600000 IN A 192.5.5.241 34 F.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:500:2f::f 35 G.ROOT-SERVERS.NET. 3600000 IN A 192.112.36.4 36 H.ROOT-SERVERS.NET. 3600000 IN A 128.6 3.2.53 37 H.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:500:1::803f:235 38 I.ROOT-SERVERS.NET. 3600000 IN A 192.36.148.17 39 J.ROOT-SERVERS.NET. 3600000 IN A 192.58.128.30 40 J.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:503 :c27::2:30 41 42 ;; Query time: 109 msec 43 ;; SERVER: 192.203.230.10 #53(192.203.230.10) 44 ;; WHEN: Fri Feb 20 03:49:01 2009 45 ;; MSG SIZE rcvd: 500 Starting bind up Once you have all this in place you can start up bind with this command. 1 /etc/init.d/named start Configuring a host to use your DNS server One final step is to configure your host to use your newly setup DNS Server as it¶s name server. You can accomplish this by changing 2 files. /etc/resolv.conf and /etc/nsswitch.conf. The /etc/resolv.conf should look like this: 1 search bubba.net 2 nameserver 192.168.1.101 The /etc/nsswitch.conf should have an entry like this in it: 1 ... 2 ... 3 hosts: files dns 4 ... 5 ... Taking it out for a test drive You can see if it¶s working by poking the name server using host, dig, or nslookup. Here are a couple of example quereies.
  • 10. 1 # host example 2 % host -l bubba.net 3 bubba.net name server ns.bubba.net. 4 bubba.net has address 192.168.1.1 5 ... 6 ... 7 8 # dig example 9 % dig ns.bubba.net 10 11 ; <<>> DiG 9.3.4 -P1 <<>> ns.bubba.net 12 ;; global options: printcmd 13 ;; Got answer: 14 ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 54856 15 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0 16 17 ;; QUESTION SECTION: 18 ;ns.bubba.net. IN A 19 20 ;; ANSWER SECTION: 21 ns.bubba.net. 604800 IN A 192.168.1.101 22 23 ;; AUTHORITY SECTION: 24 bubba.net. 604800 IN NS ns.bubba.net. 25 26 ;; Query time: 1 msec 27 ;; SERVER: 192.168.1.101 #53(192.168.1.101) 28 ;; WHEN: Sat Feb 28 20:54:46 2009 29 ;; MSG SIZE rcvd: 60 30 31 # nslookup example 32 % nslookup ns.bubba.net 33 Server: 192.168.1.101 34 Address: 192.168.1.101 #53 35 36 Name: ns.bubba.net 37 Address: 192.168.1.101 Enable user directory (public_html) edit /etc/httpd/conf/httpd.conf remove this line UserDir disable and uncomment this line UserDir public_html (or can just change the first line) Then restart the server /usr/sbin/apachectl restart
  • 11. If SELinux is enabled (I did), you must also need to run these /usr/sbin/setsebool -P httpd_enable_homedirs true chcon -R -t httpd_sys_content_t /home/user-abc/public_html (do not forget to change the path on the second line) Cara Install CPanel di CentOS Submitted by admin on Mon, 04/26/2010 - 01:12 y Tips & Tricks y cpanel Cara install CPanel di CentOS sangat mudah, karena CentOS adalah salah satu OS yang direkomendasikan oleh CPanel. Caranya sbb: 1. cd /home ² Opens the directory /home . 2. wget -N http:/ /layer1.cpanel.net/latest ² Fetches the latest installation file from the cPanel servers. 3. sh latest ² Opens and runs the installation files. 4. /usr/local/cpanel/cpkeyclt ² Activates your license after installation. Maka otomatis CPanel akan terinstall di CentOS! Konfigurasi Virtual Host di CentOS Apa itu Virtual Host? Virtual host berguna untuk pengaturan website atau URL dalam satu mesin atau satu IP, contoh kita punya dua domain yaitu domainsatu.com dan domaindua.com tetapi kita hanya punya satu mesin dengan IP 192.200.200.1 kemudian kita ingin semua domain tadi mempunyai website yg berbeda-beda. Dengan konfigurasi pada virtual host kita dapat menyelesaikan masalah ini. 1. check package apache [root@rhesanu ~]# rpm -qa http* httpd-2.0.52-41.ent.centos4 httpd-suexec-2.0.52-41.ent.centos4
  • 12. httpd-manual-2.0.52-41.ent.centos4 httpd-devel-2.0.52-41.ent.centos4 2. Buat direktori untuk pengaturan domain [root@localhost html]# mkdir -p /var/www/html/domainsatu.com/public_html/ [root@localhost html]# mkdir -p /var/www/html/domaindua.com/public_html/ pastikan direktori tersebut berada di document root. 3. Edit file /etc/httpd/conf/httpd.conf [root@localhost html]# /etc/httpd/conf/httpd.conf edit baris ini NameVirtualHost 192.200.200.1:80 kemudian tambahkan baris ini <VirtualHost 192.200.200.1:80> ServerAdmin webmaster@domainsatu.com DocumentRoot /var/www/html/domainsatu.com/public_html ServerName domainsatu.com ErrorLog /var/log/httpd/domainsatu.com-error_log CustomLog /var/log/httpd/domainsatu.com-access_log common </VirtualHost> <VirtualHost 192.200.200.1:80> ServerAdmin webmaster@domaindua.com DocumentRoot /var/www/html/domaindua.com/public_html ServerName domaindua.com ErrorLog /var/log/httpd/domaindua.com-error_log CustomLog /var/log/httpd/domaindua.com-access_log common </VirtualHost> 4. Untuk melihat hasilnya kita dapat menambahkan file php pada domainsatu dan domaindua [root@localhost ~]# nano /var/www/html/domainsatu.com/public_html/index.php <?php echo ³this is domainsatu.com´; ?> [root@localhost ~]# nano /var/www/html/domaindua.com/public_html/index.php <?php echo ³this is domaindua.com´; ?> 5. Kemudian restart apache [root@localhost ~]# service httpd restart
  • 13. Stopping httpd: [ OK ] Starting httpd: [ OK ] setelah itu coba browsing domainsatu.com dan domaindua.com, seperti gambar di bawah ini tetapi pada saat kita menambahkan url dengan www.domainsatu.com dan www.domaindua.com ada masalah, www.domaindua.com berisi domainsatu.com. lihat gambar dibawah ini:
  • 14. Perhatikan pada alamat url dan isi url ada kesalahan pada www.domain satu.com berisi this is domainsatu.com pada domain ini benar tetapi perhatikan pada www.domaindua.com kenapa berisi isi dari domainsatu.com??? 6. untuk masalah diatas tambahkan server alias pada file /etc/httpd/conf/httpd.conf. [root@localhost ~]# /etc/httpd/conf/httpd.conf tambahkan baris di bawah ini ServerAlias www.domaindua.com lihat gambar dibawah ini: setelah itu lihat hasilnya:
  • 15. How to i tall cPanel/ HM on CentOS Hell l e will be st ti wit t e basi s, how to i stall cPanel/ HM on Cent I will be using Cent 5.5 64-bit as my base OS; this will be the same for RedHat and for 32-bit also. First we need to start with a fresh install of CentOS, you don¶t need to install anything li e Apache, MySQL, etc as the cPanel installer will take care of it all for us. When reading this tutorial, I am going to assuming you know the basics of a shell (aka using SSH as some would say, if your running Windows I recommend PuTTy). Ok, the first step is to make sure you are logged into your shell, the screen should look something similar to below. Once we are both there, the next command will be to make the µcpinstall¶ folder in your /home directory, you can do that by running the code below. # mkdir /home/cpinstall This will make the necessary folder on the file system for us to start with, next we will want to move, or as some will know it as µcd¶ into that folder. You can do that by running the below command. # cd /home/cpinstall
  • 16. Now that we are there, we will need to download the appropriate file to start the cPanel install. This file is always updated, so by running the below command you¶ll always get the newest version of cPanel installed on your server/ PS. # wget http://layer1.cpanel.net/latest If everything goes well with that, your shell window will look something like this. Now that we are upto this point, we can start the install process. Depending on how fast the system is, and how fast your network connection is, this can take anywhere from 30 minutes to 4 hours. Usually for me, I can say it takes about 2 hours. You can invoke the installer by running the command below. # sh latest After running that code, you should see a cPanel logo come on the screen and the install will start. There will be no need for any user intervention unless there is a problem. Once the
  • 17. screen looks like below you are safe to walk away. Once the install is complete your SSH screen will look something like this:
  • 18. In my case, it was telling me I need to restart my server. Once restarted, you can access the WHM by going to http://IPHERE:2086. Once this is done, you¶ll get a screen like this: Your default login username is µroot¶, and your password is your root password