Your SlideShare is downloading. ×
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Tutorial CentOS 5 untuk Webhosting

2,232

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,232
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
100
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Instalasi CentOS Bagi teman-teman yang senang ngutak-ngatik server, atau yang senang dengan OS ygberbasiskan 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 punyajaringan internet sekaligus dengan IP Public (Static) yang disediakan oleh ISP anda. Palingtidak 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 tidakmasalah. Kelebihannya, kalau dengan IP Public anda bisa mengaksess server anda darimanasaja 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 caradownload. TIdak terlalu besar sih ukurannya, sekitar 600 Mb, tepatnya 580Mb. Yah« 1 CDsaja: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.iso2. Jika sudah selesai downloadnya, anda tinggal memburning pake nero atau ashampo atausoftware burning lainnya kesukaan anda. Sediakan satu blank cd untuk diburning di mediaini.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. Semakinbesar spesifikasinya semakin baik. Kalaupun pakai Pentium III pun sebetulnya sudah bisadengan kapasitas Hardisk 30 G dan RAM minimal 512 kb atau 1024 kb. Ini adalah ukuranminimalis untuk server web yang tidak terlalu besar muatannya. Tapi jika anda mempunyaispesifikasi server yang handal (seperti XEON dari HP mutakhir, misalnya) itu sangatdianjurkan.
  • 2. Jangan lupa untuk menyiapkan dua LAN Card. Kalau CPU anda menyediakan LANonboard. 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. SedangkanLAN Card lainnya kita namakan: eth1 misalkan 222.156.134.170. Gambarnya sbb:1. LAN Card OnBoard, dengan nama : eth0 IP: 192.168.50.72. LAN Card External, dengan nama : eth1 IP:222.156.134.170 Kita mulai install. Pertama masukkan CD CentOS Server anda ke Driver. Kemudiananda restart computer anda. Ketika tampilan pertama muncul. Ada dua pilihan untk memulaimenginstall ini: Pertama berbasiskan GUI, artinya anda menginstall dengan full tampilanyang familiar, tinggal klik saja. Kedua berbasiskan text. Dari model kedua ini anda hampirsepenuhnya menggunakan text, tapi masih juga dibantu dengan grafis-grafis ringan untukinteraksi dengan anda. Saya sarankan, untuk install pertama, sebaiknya jangan menggunakan Firewallbawaan dari CentOS. Lebh baik Firewall jangan diaktifkan. Firewall bisa kita sediakansendiri setelah installasi selesai. Dan akan kita bahas pada artikel sendiri.Pada saat option muncul sebelum installasi. Ada beberapa hal prinsip yang harus andaperhatikan: Ketika option untuk mengatur partisi, anda tinggal pilih remove all partition. Danbiarkan linux untuk auto configurasi. Sebab dengan sendirinya linux akan secara otomatismengatur partisinya dengan baik. Perlu diketahui, partisi di linux dengan di windows sangatberbeda. Anda tidak perlu pusing-pusing mikirkan ini. Tinggal ok dan next. Terkecuali ketikaada 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 secaraseksama. 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. Karenadidalamnya disiapkan software Bind (named) untuk manajemen domain. Jika tidak. Makatidak perlu dichecklist. Untuk menyaipkan manajemen domain, akan dibuat artikel tersendiri. MYSQL Server, anda harus pilih ini jika anda hendak menggunakan MYSQLsebagai basis data di server anda. Atau pilih juga POSTGRESQL jika anda termasuk pecintaPOSTGRE. Kalau saya masih setia pada MySQL. Jadi PostgreSql tidak saya checklist. Web Server, harus dipilih sebab didalamnya terdapat httpd dari apache yang akanmenggerakkan server anda untuk bisa menampilkan halaman web.> Anda pun bisa menchecklist Mail Server, jika anda hendak mengembangkan serveranda 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 adaartikel tersendiri. Ketika masuk pada opsi manajemen IP. Jangan dichecklist DHCP-nya. Sebagaimanayg kita tentukan sebelumnya, untuk Card yang inisialnya eth0 anda isi dengan no IP192.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 ataudisesuaikan dengan netmask dari ISP anda. Kemudian isi nama server anda dengan namafavorit anda sendiri. Defaultya localhost.localdomain anda bisa mengganti dengansidukun.domain.com atau apa saja kesukaan anda. Berikutnya, jangan lupa untuk mengisiGateway. Masukkan no Gateway, Primary Server, Secondary Server yang diberikan oleh ISPanda. Misalnya:Gateway: 222.245.250.200Primary Server : 202.13.2.5Secondary Server : 202.134.0.155 Perhatikan baik-baik, apa-apa yang perlu untuk di server anda nanti. Atau langsungsaja pada langkah instalasi. Anda tidak perlu khawatir urusan dengan software yang tidakterinstall. Hal ini akan bisa dilakukan ketika server telah selesai diinstall, denganmenggunakan perintah YUM INSTALL. GO! Install. Anda tinggal minum kopi sambil mengisap ji sam su ( bagi yg sukarokok) menunggu sampai selesai install. Linux akan dengan pintarnya mengolah file-filenyadi 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 5This is a pretty geeky thing to do but running your own DNS Server on your intranet doesmake some sense from a performance and conveience perspective.BackgroundThe 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 softwareout 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 havingone machine provide all hostname look-ups in your intranet, you¶re cutting down on everymachine in your intranet having to independently look-up names. Additionally once a name islooked up your DNS Server will cache the results for a set period of time so that subsequentqueries can come out of your DNS Server¶s cache and not have to go and do the look-up onyour ISPs DNS Server.The second reason is actually the cooler one. Since you control the DNS Server you cancreate your own local domain (called zones in bind lingo) and name all the systems withinyour intranet. In so doing this it¶s much easier to connect to systems using names rather thanIP 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 yourintranet.Getting startedFirst things first, install the necessary bind software.1 yum install bind bind-utils bind -libsGenerating a rndc keyNOTE: All the config files we¶re going to work on are located in /var/named/chrootNext you¶ll need to create/modify a rndc.conf and/or rndc.key file. This file contains a keywhich is required in order to manage the bind service once it¶s up and running. With this keyyou can theoretically manage bind either on the host where it¶s running or you can manage iton any system that is allowed to do so and knows this key!1 # command to generate a new 512 byte key2 rndc-confgen -b 512This command will return the following output which you¶ll want to either redirect to a file orcopy 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.conf2 key "rndckey" {3 algorithm hmac -md5;4 secret5 "nHFS3WOpdap75IvsYSXVNYWusnAQPT6z5XC8V5YPWXnZ8RN8tdfSFuClZ8nNouWyGhvHB8mE6 TJgwsrvhiYhIhA==" ;7 };89 options {1 default-key "rndckey" ;0 default-server 127.0.0.1;1 default-port 953;1 };1 # End of rndc.conf2
  • 5. The rndc-confgen command also returns some additional output below. This goes into thefile /var/named/chroot/etc/named.conf. Make sure to remove the comments at thebeginning of each line to turn them on. # Use with the following in named.conf, adjusting the allow list as1 needed:2 key "rndckey" {3 algorithm hmac -md5;4 secret5 "nHFS3WOpdap75IvsYSXVNYWusnAQPT6z5XC8V5YPWXnZ8RN8tdfSFuClZ8nNouWyGhvHB8mE6 TJgwsrvhiYhIhA==" ;7 };8 #9 controls {1 inet 127.0.0.1 port 9530 allow { 127.0.0.1; } keys { "rndckey" ; };1 };1 # End of named.confnamed.conf fileNow 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 };56 controls {7 inet 127.0.0.1 port 9538 allow { lan; } keys { "rndckey"; };9 };1011 logging {12 category default { default_syslog; };13 category lame -servers { null; };14 };1516 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 will23 be used for looking up24 # hostnames that I dont locally manage, i .e. the REST OF THE25 INTERNET!26 24.92.226.40; # my ISPs DNS Server #127 24.92.226.41; # my ISPs DNS Server #228 };29 /*30 * If there is a firewall between you and nameservers you want31 * to talk to, you might need to uncomment the query -source32 * directive below. Previous versions of BIND always asked33 * questions using port 53, but BIND 8.1 uses an unprivileged34 * port by default.35 */
  • 6. 36 query-source address * port 53;37 allow-query { lan; };38 allow-recursion { lan; };39 allow-transfer { lan; };40 };4142 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 listthat includes 192.168.1.0/24 and 127.0.0.1 so that only hosts within these IP address rangescan remotely manage and use this bind instance. 192.168.1.0/24 means IP addresses in therange 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 allessentially files containing either hostname ĺ IP address mappings or IP address ĺhostname mappings that this bind server will be responsible for.Bulding zone filesThe first zone: ³bubba.net´ includes all the hostnames and the IP addresses they point to. Sothese would be my systems: y scully.bubba.net y mulder.bubba.net y doggett.bubba.netThe second and third zones: ³0.0.127.in-addr.arpa´ and ³1.168.192.in-addr.arpa´ arespecial zones that provide ³reverse´ name look-ups. These are when you look up a IP addressand want to know what name(s) are associated with it. For example: y 192.168.1.100 y 192.168.1.101The fourth zone: ³.´ is a special zone that makes this bind server act as a caching nameserver, for any hostnames and IP addresses that fall outside of the first 3 zones. Thesehostname and IP address look-ups will be forwarded to my ISPs DNS Server, and the resultscached here for subsequent quereies.Here is what the zone ³bubba.net´ looks like.
  • 7. $TTL 6048001 ;2 ; Zone file for bubba.net3 ;4 ; Mandatory minimum for a working domain5 ;6 @ IN SOA ns.bubba.net. hostmaster.bubba.net. (7 2000072802 ; serial8 28800 ; refresh9 7200 ; retry10 3600000 ; expire11 86400 ; default_ttl12 )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 but18 ; acutally all are coming from XXXXX19 ; These need to be bound to the address directly, no CNAME s.20 ; -----------------------------------------------------------21 bubba.net. IN A 192.168.1.122 ;23 hostmaster.bubba.net. IN A 192.168.1.10124 ns.bubba.net. IN A 192.168.1.10125 ...26 ...27 ; Subnet 192.168.1 machines28 ; -------------------------29 mulder.bubba.net. IN A 192.168.1.130 mulder.bubba.net. IN HINFO "AMD Athlon(tm) Dual Core31 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.235 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 howlong any of this data should be cache. Line 14 denotes which machine is the SOA, Start ofAuthority, ns.bubba.net is the master of this domain is what it¶s saying 8-). Lines 15 & 16state which machine is the mail exchange for this domain. I only have one mail exchange so Ijust list it twice.The most important section in this file starts with the declaration of hostnames. Eachhostname 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 mailexchange is for this host. And finally the ³IN TXT³ line which I¶m not going to get intotoday 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 6048002 @ IN SOA ns.bubba.net. hostmaster.bubba.net. (
  • 8. 3 2000072801 ; serial4 28800 ; refresh5 7200 ; retry6 604800 ; expire7 86400 ; default -ttl8 )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 shouldcache this data before getting a fresh copy. The SOA ns.bubba.net is saying which machineis the authority for this domain. The hostmaster.bubba.net is actually an email address that isresponsible for this domain, hostmaster@bubba.net.Finally the zone ³db.127.0.0Ǝ which really serves no purpose other than as a backup in casea host didn¶t configure itself correctly with the loopback address. Here is what my zone filelooks like:1 $TTL 6048002 @ IN SOA ns.bubba.net. hostmaster.bubba.net. (3 2000031801 ; serial4 28800 ; refresh5 7200 ; retry6 604800 ; expire7 86400 ; default_ttl8 )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 . ns2 ; (1 server found )3 ;; global options: printcmd4 ;; Got answer:5 ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 212476 ;; flags: qr aa rd; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 1478 ;; QUESTION SECTION:9 ;. IN NS1011 ;; 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.2526 ;; ADDITIONAL SECTION:27 A.ROOT-SERVERS.NET. 3600000 IN A 198.41.0.428 A.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:503:ba3e::2:3029 B.ROOT-SERVERS.NET. 3600000 IN A 192.228.79.20130 C.ROOT-SERVERS.NET. 3600000 IN A 192.33.4.1231 D.ROOT-SERVERS.NET. 3600000 IN A 128.8.10.9032 E.ROOT-SERVERS.NET. 3600000 IN A 192.203.230.1033 F.ROOT-SERVERS.NET. 3600000 IN A 192.5.5.24134 F.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:500:2f::f35 G.ROOT-SERVERS.NET. 3600000 IN A 192.112.36.436 H.ROOT-SERVERS.NET. 3600000 IN A 128.6 3.2.5337 H.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:500:1::803f:23538 I.ROOT-SERVERS.NET. 3600000 IN A 192.36.148.1739 J.ROOT-SERVERS.NET. 3600000 IN A 192.58.128.3040 J.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:503 :c27::2:304142 ;; Query time: 109 msec43 ;; SERVER: 192.203.230.10 #53(192.203.230.10)44 ;; WHEN: Fri Feb 20 03:49:01 200945 ;; MSG SIZE rcvd: 500Starting bind upOnce you have all this in place you can start up bind with this command.1 /etc/init.d/named startConfiguring a host to use your DNS serverOne final step is to configure your host to use your newly setup DNS Server as it¶s nameserver. 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.net2 nameserver 192.168.1.101The /etc/nsswitch.conf should have an entry like this in it:1 ...2 ...3 hosts: files dns4 ...5 ...Taking it out for a test driveYou can see if it¶s working by poking the name server using host, dig, or nslookup. Here area couple of example quereies.
  • 10. 1 # host example2 % host -l bubba.net3 bubba.net name server ns.bubba.net.4 bubba.net has address 192.168.1.15 ...6 ...78 # dig example9 % dig ns.bubba.net1011 ; <<>> DiG 9.3.4 -P1 <<>> ns.bubba.net12 ;; global options: printcmd13 ;; Got answer:14 ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5485615 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 01617 ;; QUESTION SECTION:18 ;ns.bubba.net. IN A1920 ;; ANSWER SECTION:21 ns.bubba.net. 604800 IN A 192.168.1.1012223 ;; AUTHORITY SECTION:24 bubba.net. 604800 IN NS ns.bubba.net.2526 ;; Query time: 1 msec27 ;; SERVER: 192.168.1.101 #53(192.168.1.101)28 ;; WHEN: Sat Feb 28 20:54:46 200929 ;; MSG SIZE rcvd: 603031 # nslookup example32 % nslookup ns.bubba.net33 Server: 192.168.1.10134 Address: 192.168.1.101 #533536 Name: ns.bubba.net37 Address: 192.168.1.101Enable user directory (public_html)edit /etc/httpd/conf/httpd.confremove this lineUserDir disableand uncomment this lineUserDir 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 truechcon -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 CentOSSubmitted by admin on Mon, 04/26/2010 - 01:12 y Tips & Tricks y cpanelCara install CPanel di CentOS sangat mudah, karena CentOS adalah salah satu OS yangdirekomendasikan 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 CentOSApa 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 hanyapunya satu mesin dengan IP 192.200.200.1 kemudian kita ingin semua domain tadimempunyai website yg berbeda-beda. Dengan konfigurasi pada virtual host kita dapatmenyelesaikan masalah ini.1. check package apache[root@rhesanu ~]# rpm -qa http*httpd-2.0.52-41.ent.centos4httpd-suexec-2.0.52-41.ent.centos4
  • 12. httpd-manual-2.0.52-41.ent.centos4httpd-devel-2.0.52-41.ent.centos42. 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.confedit baris iniNameVirtualHost 192.200.200.1:80kemudian tambahkan baris ini<VirtualHost 192.200.200.1:80>ServerAdmin webmaster@domainsatu.comDocumentRoot /var/www/html/domainsatu.com/public_htmlServerName domainsatu.comErrorLog /var/log/httpd/domainsatu.com-error_logCustomLog /var/log/httpd/domainsatu.com-access_log common</VirtualHost><VirtualHost 192.200.200.1:80>ServerAdmin webmaster@domaindua.comDocumentRoot /var/www/html/domaindua.com/public_htmlServerName domaindua.comErrorLog /var/log/httpd/domaindua.com-error_logCustomLog /var/log/httpd/domaindua.com-access_log common</VirtualHost>4. Untuk melihat hasilnya kita dapat menambahkan file php pada domainsatu dandomaindua[root@localhost ~]# nano /var/www/html/domainsatu.com/public_html/index.php<?phpecho ³this is domainsatu.com´;?>[root@localhost ~]# nano /var/www/html/domaindua.com/public_html/index.php<?phpecho ³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 initetapi pada saat kita menambahkan url dengan www.domainsatu.com danwww.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 isdomainsatu.com pada domain ini benar tetapi perhatikan pada www.domaindua.com kenapaberisi isi dari domainsatu.com???6. untuk masalah diatas tambahkan server alias pada file /etc/httpd/conf/httpd.conf.[root@localhost ~]# /etc/httpd/conf/httpd.conftambahkan baris di bawah iniServerAlias www.domaindua.comlihat gambar dibawah ini:setelah itu lihat hasilnya:
  • 15. How to i tall cPanel/ HM on CentOSHell l e will be st ti wit t e basi s, how to i stall cPanel/ HM on Cent I will beusing 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 eApache, 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 usingSSH 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 looksomething 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/cpinstallThis will make the necessary folder on the file system for us to start with, next we will wantto move, or as some will know it as µcd¶ into that folder. You can do that by running thebelow command.# cd /home/cpinstall
  • 16. Now that we are there, we will need to download the appropriate file to start the cPanelinstall. This file is always updated, so by running the below command you¶ll always get thenewest version of cPanel installed on your server/ PS.# wget http://layer1.cpanel.net/latestIf 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 thesystem is, and how fast your network connection is, this can take anywhere from 30 minutesto 4 hours. Usually for me, I can say it takes about 2 hours. You can invoke the installer byrunning the command below.# sh latestAfter running that code, you should see a cPanel logo come on the screen and the install willstart. 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 theWHM 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

×