SAMP (Solaris, Apache, MySQL, PHP)
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
2,368
On Slideshare
2,366
From Embeds
2
Number of Embeds
1

Actions

Shares
Downloads
24
Comments
0
Likes
0

Embeds 2

http://www.docshut.com 2

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. SAMP[Solaris 10, Apache 2, MySQL 5, PHP 5]Nyoman Bogi Aditya KarnaSisfo – IM Telkombogi@imtelkom.ac.idhttp://bogi.blog.imtelkom.ac.id Institut Manajemen Telkom http://www.imtelkom.ac.id
  • 2. SAMP @ Institut Manajemen Telkom (http://www.imtelkom.ac.id)AbstrakSaat ini banyak pengguna IT yang masih dibingungkan saat diharuskan memilih antara sistemoperasi yang paling tepat yang akan digunakan untuk suatu server. Hal ini mengingat padabanyaknya pilihan yang tersedia, dimulai dari Linux yang terkenal atas open source dan dukunganaplikasinya, Solaris yang terkenal atas platform hardware Sun, FreeBSD yang terkenal di kalanganopen source underground atas kestabilannya, dan Windows yang terkenal atas dukungan aplikasidan user friendly-nya. Sebagian besar pengguna IT memang sudah jauh lebih mengenal Linux danterbiasa dengannya, yang menyebabkan mereka tidak pernah sempat untuk mencoba-cobaperformansi sistem jika menggunakan platform yang lain. Hal ini disebabkan karena disampingLinux adalah platform open source yang paling banyak memiliki distribusi yang tersedia, ditambahdengan dukungan aplikasi terkenal lainnya seperti Apache, PHP, Oracle, SAP, dan lainnya.Latar BelakangMeskipun Solaris bukan turunan langsung dari UNIX, namun topologi dan konfigurasi-nya sangatmirip dengan keluarga UNIX. Solaris pada awalnya adalah platform yang didesain hanya untukkomputer Sun yang berbasis prosesor Sparc, namun sekarang telah tersedia platform Solarisuntuk prosesor dengan arsitektur x86 dimana didalamnya mencakup Intel dan AMD. PopularitasSolaris x86 semakin menanjak sejak di-release secara free sepanjang untuk keperluanpembelajaran, development, dan trial.Saat ini release terakhir dari Solaris 10 adalah Solaris 5/09 yang merupakan release pada bulanMei di tahun 2009. Solaris 5/09 dikemas dalam 5 CD utama ditambah dengan 1 CD tambahan(companion). Ada beberapa aplikasi yang dibundling kedalam 5 CD tersebut, mencakup aplikasiyang sangat dibutuhkan dalam membantu pekerjaan keseharian kita yaitu Star Office.TujuanBuku manual ini ditujukan untuk memudahkan praktisi, teknisi, maupun user dalam melakukaninstalasi AMP (Apache – MySQL – PHP) diatas Solaris 10 sebagai layanan (Service) yang palingsering dibutuhkan untuk melayani kebutuhan SME (Small Medium Enterprise). Sistem Operasi ygdi-standarkan dalam buku manual ini adalah Solaris 10, Apache 2, MySQL 5, dan PHP 5.Seputar SolarisSolaris merupakan solusi yang ideal untuk server, namun masih banyak keraguan dari sisi pemakaiterutama untuk platform x86 karena beberapa pemakai melaporkan pernah mengalami gangguan(hang) saat menggunakan platform ini.
  • 3. SAMP @ Institut Manajemen Telkom (http://www.imtelkom.ac.id)Berikut tampilan dari Solaris yang menggunakan GUI GNOMEInstalasi Tool PendukungInstalasi tool pendukung untuk menunjang instalasi AMP di Solaris 10 semua berasal dariBlastwave™ (http://blastwave.network.com/csw) dimana pada situs ini tersedia repositoryaplikasi yang siap untuk diinstall karena telah berada dalam format package (.pkg.gz).Instalasi tool pendukung ini akan dijelaskan per tahap :Step 1 : Install pkgutilINTEL users : http://blastwave.network.com/csw/pkgutil_i386.pkg md5 = a9dcb973ca18d63439d6d4dd12c9bf0a sha1 = ba8ade3f4659708de716b6b6dbf5949fe4482b55 sha256 = c8734812a53c2b83dd6084a93a4c3fbe9a209f4ddcc8a280fcedcfb2a03f6266# uname -aSunOS infusion 5.10 Generic_139556-08 i86pc i386 i86pc# cat /etc/release Solaris 10 5/09 s10x_u7wos_08 X86 Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms. Assembled 30 March 2009# pkgadd -d http://blastwave.network.com/csw/pkgutil_`/sbin/uname -p`.pkg## Downloading.................25%..............50%..............75%..............100%## Download Complete
  • 4. SAMP @ Institut Manajemen Telkom (http://www.imtelkom.ac.id)The following packages are available: 1 CSWpkgutil pkgutil - installs Solaris packages easily (i386) 1.4,REV=2009.01.20Select package(s) you wish to process (or all to processall packages). (default: all) [?,??,q]:Processing package instance <CSWpkgutil> from<http://blastwave.network.com/csw/pkgutil_i386.pkg>pkgutil - installs Solaris packages easily(i386) 1.4,REV=2009.01.20Please see /opt/csw/share/doc/pkgutil/LICENSE for license information.## Processing package information.## Processing system information. 11 package pathnames are already properly installed.## Verifying disk space requirements.## Checking for conflicts with packages already installed.## Checking for setuid/setgid programs.This package contains scripts which will be executed with super-userpermission during the process of installing this package.Do you want to continue with the installation of <CSWpkgutil> [y,n,?] yInstalling pkgutil - installs Solaris packages easily as <CSWpkgutil>## Installing part 1 of 1./opt/csw/bin/bldcat/opt/csw/bin/chkcat/opt/csw/bin/pkgutil/opt/csw/etc/pkgutil.conf.CSW/opt/csw/libexec/pkgutil/wget/opt/csw/share/doc/pkgutil/LICENSE/opt/csw/share/doc/pkgutil/readme/opt/csw/share/man/man1/pkgutil.1/var/opt/csw/pkgutil/admin.CSW[ verifying class <none> ]## Executing postinstall script.Installation of <CSWpkgutil> was successful.# mkdir /etc/opt/csw# cp -p /opt/csw/etc/pkgutil.conf.CSW /etc/opt/csw/pkgutil.confStep 2 : Fetch Software catalogJika kita perhatikan dari hasil instalasi di Step 1, terlihat bahwa package pkgutil telah mencakupaplikasi ‘wget’ yang dapat digunakan untuk mengambil suatu file baik melalui protokol FTP
  • 5. SAMP @ Institut Manajemen Telkom (http://www.imtelkom.ac.id)maupun HTTP. Koneksi yang digunakan oleh ‘wget’ bisa melalui direct connection atau melaluisuatu proxy dengan setting sebagai berikut :# cat /export/home/manager/.wgetrcprogress=dot:megaftp_proxy=http://192.168.35.7:8080http_proxy=http://192.168.35.7:8080Sesuaikan IP address dan nomor port dengan setting yang berlaku di lingkungan kita.# /opt/csw/bin/pkgutil --catalogFetching new catalog if available...--01:41:49-- http://blastwave.network.com/csw/unstable/i386/5.8/catalog => `/var/opt/csw/pkgutil/catalog.i386.5.8.0Connecting to 192.168.35.7:8080... connected.Proxy request sent, awaiting response... 200 OKLength: 375,014 [text/plain] 0K ..... 100% 342.27 KB/s01:41:52 (342.27 KB/s) - `/var/opt/csw/pkgutil/catalog.i386.5.8.0 saved [375014/375014]Step 3 : SecuritySemua software dari Blastwave telah memiliki digital signature, untuk itu kita perlumenambahkan kemampuan Solaris untuk dapat melakukan pengecekan signature ini dengan carainstalasi GNU GPG dan MD5 hash :# /opt/csw/bin/pkgutil --install gnupg textutilsParsing catalog, may take a while...New packages: CSWcommon CSWisaexec CSWexpat CSWiconv CSWncurses CSWggettextCSWbzip2 CSWzlib CSWreadline CSWtextutils CSWgnupgTotal size: 9.2 MB11 packages to fetch. Do you want to continue? [Y,n]Setelah CSWgnupg terinstall, selanjutnya adalah mengambil digital key milik Blastwave.org danmemasangnya di lokal. Untuk ini, kita bisa menggunakan GPG untuk mengambil digital keytersebut di MIT keyserver, dengan cara :# /opt/csw/bin/gpg --keyserver pgp.mit.edu --recv-keys A1999E90gpg: directory `/root/.gnupg createdgpg: new configuration file `/root/.gnupg/gpg.conf createdgpg: WARNING: options in `/root/.gnupg/gpg.conf are not yet active during this rungpg: keyring `/root/.gnupg/secring.gpg createdgpg: keyring `/root/.gnupg/pubring.gpg createdgpg: requesting key A1999E90 from hkp server pgp.mit.edugpg: /root/.gnupg/trustdb.gpg: trustdb createdgpg: key A1999E90: public key “Blastwave Software (Blastwave.org Inc.)<software@blastwave.org>” importedgpg: no ultimately trusted keys foundgpg: Total number processed: 1gpg: imported: 1
  • 6. SAMP @ Institut Manajemen Telkom (http://www.imtelkom.ac.id)Selanjutnya kita akan menggunakan digital key tersebut dan memasangnya di lokal dengan 3langkah berikut :1 ) Verifikasi digital key# /opt/csw/bin/gpg --list-keys//.gnupg/pubring.gpg--------------------pub 1024D/A1999E90 2008-08-17 [expires: 2011-08-17]uid Blastwave Software (Blastwave.org Inc.) <software@blastwave.org>sub 2048g/E4845389 2008-08-17 [expires: 2011-08-17]2 ) Tandai bahwa digital key tersebut telah sesuai :# /opt/csw/bin/gpg --edit-key A1999E90gpg (GnuPG) 1.4.9; Copyright (C) 2008 Free Software Foundation, Inc.This is free software: you are free to change and redistribute it.There is NO WARRANTY, to the extent permitted by law.pub 1024D/A1999E90 created: 2008-08-17 expires: 2011-08-17 usage: SC trust: unknown validity: unknownsub 2048g/E4845389 created: 2008-08-17 expires: 2011-08-17 usage: E[ unknown] (1). Blastwave Software (Blastwave.org Inc.) <software@blastwave.org>Command> Trustpub 1024D/A1999E90 created: 2008-08-17 expires: 2011-08-17 usage: SC trust: unknown validity: unknownsub 2048g/E4845389 created: 2008-08-17 expires: 2011-08-17 usage: E[ unknown] (1). Blastwave Software (Blastwave.org Inc.) <software@blastwave.org>Please decide how far you trust this user to correctly verify other users keys(by looking at passports, checking fingerprints from different sources, etc.) 1 = I dont know or wont say 2 = I do NOT trust 3 = I trust marginally 4 = I trust fully 5 = I trust ultimately m = back to the main menuYour decision? 5Do you really want to set this key to ultimate trust? (y/N) ypub 1024D/A1999E90 created: 2008-08-17 expires: 2011-08-17 usage: SC trust: ultimate validity: unknownsub 2048g/E4845389 created: 2008-08-17 expires: 2011-08-17 usage: E[ unknown] (1). Blastwave Software (Blastwave.org Inc.) <software@blastwave.org>Please note that the shown key validity is not necessarily correctunless you restart the program.Command> quit
  • 7. SAMP @ Institut Manajemen Telkom (http://www.imtelkom.ac.id)3) edit pkgutil.conf agar pkgutil menggunakan digital key tersebut :# Configuration file for pkgutil## Nothing below is mandatory to change, pkgutil will use the default values# noted below for each option unless something is uncommented# Mirror to use for downloads# See http://www.blastwave.org/mirrors.php for alternative mirrors# Default: http://blastwave.network.com/csw/unstable#mirror=http://blastwave.network.com/csw/unstable# Solaris 10: If you wish to limit pkgutil to installing packages# only to the global zone, then uncomment this line. Note that pkgrm does not# have the same option# WARNING: do not modify this unless you know what youre doing# Default: blank#pkgaddopts=-G# Flags for use with wget, e.g. "-nv" for less verbose or "-q" for quiet# WARNING: do not modify this unless you know what youre doing# Default: blank#wgetopts=-q# To enable use of gpg or md5, uncomment these# NOTE: it doesnt make sense to use md5 but not gpg so your options should be:# 1. both disabled, 2. gpg enabled, 3. both enabled.# Default: false, falseuse_gpg=trueuse_md5=trueInstalasi MySQL 5Instalasi MySQL 5 sangat mudah, cukup dengan melakukan 2 command berikut :# /opt/csw/bin/pkg-get -i mysql5 mysql5client mysql5devel mysql5rt# /opt/csw/bin/pkg-get -i mysql5testSeanjutnya buat file configuration di /opt/csw/mysql5/my.cnf, dengan mengacu pada salah satufile my-*.cnf di /opt/csw/mysql5/share/mysql/ dan melakukan seting sesuai kebutuhan, sepertimengaktifkan InnoDB jika diperlukan.Lakukan seting group untuk MySQL :# groupadd mysql# useradd -c "MySQL Server" -d /dev/null -g mysql -s /bin/false mysqlInisialisasi MySQL database :cd /opt/csw/mysql5./bin/mysql_install_dbchown -R mysql:mysql ./var
  • 8. SAMP @ Institut Manajemen Telkom (http://www.imtelkom.ac.id)Jalankan MySQL 5 :# cd /opt/csw/mysql5 ; /opt/csw/mysql5/bin/mysqld_safe &Instalasi PHP 5Instalasi PHP 5 sangat mudah, namun memerlukan beberapa aplikasi tambahan sebagaipendukung agar PHP bisa diinstalasi, yaitu autoconf, automake, dan gsed :global# pkg-get -i autoconf...global# which autoconf && autoconf --version | head -2/opt/csw/bin/autoconfautoconf (GNU Autoconf) 2.59Written by David J. MacKenzie and Akim Demaille.global# pkg-get -i automake...global# which automake && automake --version | head -2/opt/csw/bin/automakeautomake (GNU automake) 1.8.3Written by Tom Tromey <tromey@redhat.com>.global# pkg-get -i gsed...global# which gsed && gsed --version | head -2/opt/csw/bin/gsedGNU sed version 4.1.4Copyright (C) 2003 Free Software Foundation, Inc.Selain itu dibutuhkan pula beberapa aplikasi pendukung lainnya :global# which gcc && gcc --version | head -2/usr/sfw/bin/gccgcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath)Copyright (C) 2004 Free Software Foundation, Inc.global# which gmake && gmake --version | head -2/usr/sfw/bin/gmakeGNU Make 3.80Copyright (C) 2002 Free Software Foundation, Inc.global# which flex && flex --version | head -2/usr/sfw/bin/flexflex version 2.5.4global# which bison && bison --version | head -2/usr/sfw/bin/bisonbison (GNU Bison) 1.875Written by Robert Corbett and Richard Stallman.
  • 9. SAMP @ Institut Manajemen Telkom (http://www.imtelkom.ac.id)global# which gm4 && gm4 --version | head -2/opt/csw/bin/gm4GNU M4 1.4.3Written by Rene Seindal.global# which perl && perl -v | head -2/opt/csw/bin/perlThis is perl, v5.8.7, built for sun4-solaris-thread-multiglobal# which gunzip && gunzip -V | head -2/usr/bin/gunzipgunzip 1.3.3-patch.1(2002-03-08)global# which gtar && gtar --version | head -2/usr/sfw/bin/gtartar (GNU tar) 1.14Copyright (C) 2004 Free Software Foundation, Inc.Langkah selanjutnya adalah menginstalasi PHP 5. Download source dari PHP 5 darihttp://www.php.net/downloads.php#v5 dan ambil file dengan extensi tar.gz :global# gunzip -cd php-5.1.6.tar.gz | gtar xvpf –global# cd php-5.1.6global# ./configure --with-apxs2=/usr/apache2/bin/apxs --enable-dbase --with-libxml-dir=/usr/local --with-config-file-path=/etc/apache2 --with-mysql=shared,/opt/csw/mysql5 --with-mysqli=shared,/opt/csw/mysql5/bin/mysql_config --with-xpm-dir=/usr --with-gd --with-tiff-dir=/usr --with-bz2=/usr/lib --with-jpeg-dir=/usr --with-png-dir=/usr --with-zlib --enable-mbstring --enable-calendar--enable-bcmath --enable-ftp --enable-exifglobal# gmake ... global# gmake install ... Installing PHP SAPI module: apache2handler /var/apache2/build/instdso.sh SH_LIBTOOL=/var/apache2/build/libtool libphp5.la/usr/apache2/libexec /var/apache2/build/libtool --mode=install cp libphp5.la /usr/apache2/libexec/ cp .libs/libphp5.so /usr/apache2/libexec/libphp5.so chmod +x /usr/apache2/libexec/libphp5.so cp .libs/libphp5.lai /usr/apache2/libexec/libphp5.la libtool: install: warning: remember to run libtool --finish /build/php-5.1.2/libs chmod 755 /usr/apache2/libexec/libphp5.so [activating module php5 in /etc/apache2/httpd.conf] Installing PHP CLI binary: /usr/local/bin/ Installing PHP CLI man page:/usr/local/man/man1/ Installing build environment: /usr/local/lib/php/build/ Installing header files: /usr/local/include/php/ Installing helper programs: /usr/local/bin/ program: phpize program: php-config
  • 10. SAMP @ Institut Manajemen Telkom (http://www.imtelkom.ac.id)Installing man pages: /usr/local/man/man1/ page: phpize.1 page: php-config.1Installing PEAR environment:/usr/local/lib/php/[PEAR] Archive_Tar - installed: 1.3.1[PEAR] Console_Getopt - installed: 1.2pear/PEAR can optionally use package "pear/XML_RPC" (version >= 1.4.0)[PEAR] PEAR - installed: 1.4.6Wrote PEAR system config file at: /usr/local/etc/pear.confYou may want to add: /usr/local/lib/php to your php.ini include_pathInstalling PDO headers: /usr/local/include/php/ext/pdo/Selanjutnya copy file php.ini-dist dari directory php-5.1.6 ke directory Apache :global# cp php.ini-dist /etc/apache2/php.iniDan edit file konfigurasi tersebut : ;;;;;;;;;;;;;;;;;;;;;; ; Dynamic Extensions ; ;;;;;;;;;;;;;;;;;;;;;; extension=mysql.so ; Directory in which the loadable extensions (modules) reside. extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20050922/"Pastikan bahwa modul mysql telah ada : # ls -l /usr/local/lib/php/extensions/no-debug-non-zts-20050922/ total 1088 -rwxr-xr-x1 root root103144 Aug 29 21:48 mysql.so -rwxr-xr-x1 root root429948 Aug 29 21:48 mysqli.soDan tambahkan deklarasi modul PHP di file konfigurasi Apache 2 : LoadModule php5_module libexec/libphp5.so AddType application/x-httpd-php .phpStart Apache 2: # svcadm enable apache2 # svcs | grep -i apache2 online 18:07:10 svc:/network/http:apache2