Catatan dokumentasi buat project indosa* build server sederhana, untuk web server. Kali ini menggunakan sistem operasi Suse Linux Enterprise, sebenarnya untuk versi ini adalah berbayar namun kalau hanya untuk belajar bisa menggunakan versi evaluation. Merupakan pengalaman pertama bagi saya untuk server menggunakan suse, untung sebelumnya sudah pernah menggunakan suse versi desktop tepatnya. Karena dari saya sendiri lebih familiar dengan menggunakan debian based, untuk konfig beda2 dikit, tapi konsepnya sama semuanya. Selama perjalanan muncul erorr beberapa dan ternyata memang butuh dicustom tidak seperti biasanya langsung jalan.
1. Catatan Awal
Pada tutorial kali ini saya menggunakan hostname rampage.com dengan IP Address 192.168.2.60. Konfigurasi tersebut bisa berbeda dengan konfigurasi yang anda lakukan, jadi tingal sesuaikan saja. Saya menggunakan Suse Enterprise 11.3
2. Adding Repository
3. Installing MySQL
Instalasi MySQL seperti berikut
Dan kemudian konfigurasikan agar MySQL bisa langsung running otomatis ketika system booting.
Jalankan service mysql dan verifikasi apakah mysql sudah jalan atau belum
rcmysql status
Verifikasi
Checking for service MySQL: running
localhost:/ #
Konfigurasi password pada mysql, ada 2 cara yang bisa digunakan. Bisa pakai automatic command atau set secara manual di mysqlnya. Untuk automatic command bisa gunakan.
Dan kemudian nanti akan muncul beberapa pertanyaan.
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!In order to log into MySQL to secure it, we’ll need the current
password for the root user. If you’ve just installed MySQL, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.Enter current password for root (enter for none): <– ENTER
OK, successfully used password, moving on…Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.Set root password? [Y/n] <– Y
New password: <– fill in your desired MySQL root password
Re-enter new password: <– confirm that password
Password updated successfully!
Reloading privilege tables..
… Success!By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.Remove anonymous users? [Y/n] <– Y
… Success!Normally, root should only be allowed to connect from ‘localhost’. This
ensures that someone cannot guess at the root password from the network.Disallow root login remotely? [Y/n] <– Y
… Success!
By default, MySQL comes with a database named ‘test’ that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] <– Y
– Dropping test database…
… Success!
– Removing privileges on test database…
… Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] <– Y
… Success!
Cleaning up…
All done! If you’ve completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
Atau konfigurasi secara manual pada MySQL
mysql> UPDATE user SET Password=PASSWORD(‘password’) where USER=’root’;
mysql> FLUSH PRIVILEGES;
4. Installing Apache2
Install Apache2
Buat Virtualhost untuk Apache2
cp vhost.template suse.conf
Konfigurasi root direktori di virtualhost
Sesuaikan root direktori, root direktori saya berada pada /srv/www/htdocs/
ServerAdmin webmaster@rampage.com.com
ServerName rampage.com# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
DocumentRoot /srv/www/htdocs/
<Directory “/srv/www/htdocs/”>
</Directory>
</VirtualHost>
By default konfigurasi firewall di suse adalah memblock semua traffic yang datang menuju port 80. Jadi kita perlu merubah konfigurasi tersebut agar mengijinkan web server bisa diakses dari dalam LAN. Ada 2 file apache2 dan apache2-ssl. Bisa diaktifkan melalui YaST, dengan cara menambahkan keduanya di FW_CONFIGURATIONS_EXT pada direktori /etc/sysconfig/SuSEfirewall2
sysconf_addword /etc/sysconfig/SuSEfirewall2 FW_CONFIGURATIONS_EXT apache2-ssl
rcSuSEfirewall2 restart
Restart service Apache2
Dan konfigurasikan agar apache2 bisa langsung running ketika system boot.
5. Installing PHP5
Install php5 module seperti berikut.
Buat file PHPINFO untuk melihat php instalation pada system kita.
——————————–
<?php
phpinfo();
?>
Namun tidak cukup install php saja, ketika anda browse file php tersebut pada 192.168.2.60, ketika anda klik file php tersebut bukan muncul datanya anda akan diminta mendownload file .php tersebut dikarenakan kita perlu menambahkan PHP5 pada APACHE_MODULES di /etc/sysconfig/apache2 kemudian restart apache2. Untuk VI Editor kalau ingin mencari spesifik kata pada sebuah file anda cukup mengetikan tanda tanya (?) kemudian diikuti kata yang ingin dicari.
——————————–
?APACHE_MODULE
——————————–
APACHE_MODULES=”php5 actions alias auth_basic authn_file authz_host
authz_groupfile authz_default authz_user autoindex cgi dir env expires include log_config mime negotiation setenvif ssl userdir php5″
6. Installing PHPMyAdmin
By default untuk suse versi 11.3 paket phpmyadmin tidak tersedia pada repositori. Ada dua cara untuk instalasi phpmyadmin pada suse 11.3, yang pertama anda bisa menggunakan layanan fitur dari suse sendiri yaitu one click install. Anda cukup tinggal akses web browser menuju.
http://software.opensuse.org/package/phpMyAdmin
Kemudian akses ke
http://192.168.2.60/phpmyadmin
Yang kedua instalasi via source, instalasi ini tidak saya rekomendasikan. Lebih menyarankan menggunakan one click install.
tar -zxvf phpMyAdmin-4.2.5-english.tar.gz -C /srv/www/htdocs/
mv phpMyAdmin-4.2.5-english phpmyadmin
yast -i php5-mcrypt php5-mbstring
chown -R root:wheel /srv/www/htdocs/
Jika anda menggunakan cara yang kedua, akan ada error seperti berikut
The mysqli|mysql extension is missing. Please check your PHP configuration.
Itu menandakan bahwa keduanya antara mysql dan php belum saling terhubung. Instal paket php-mysql agar keduanya bisa berhubungan.
Halo mas Randy,
Thanks untuk share-nya mas. Keren. Sekedar tambahan info,
1. SLES 11 SP3 berbeda dengan openSUSE 11.3, itu sebabnya ada kemungkinan bentrok package & tidak langsung jalan
2. Semua package diatas sebenarnya sudah ada di DVD SLES, tidak perlu download dari repo
3. Untuk perintah sapu jagat (install LAMP Server), cukup menjalankan perintaha :
zypper ref
zypper in -t pattern lamp_server
Atau bisa juga menggunakan YASt | Software | Software Management dan memilih pattern lamp server
Reff : http://opensuse.or.id/panduan/server-setup/opensuse-sebagai-web-server/instalasi-konfigurasi-apache-web-server-pada-opensuse/
Terimakasih mas vavai sudah berkung dan ikut berkomentar, menambah wawasan 🙂 Baru tahu juga hehe