Setup Web Server dengan Linux Debian 8

Disebabkan tuntutan salah satu Sistem Informasi Manajemen (SIM) yang masih menggunakan PHP4 dan MySQL4, maka harus disiapkan sebuah server khusus yang dapat mengeksekusi sistem tersebut. Untuk sistem operasi, dipilih distro Linux Debian, sebagaimana dipakai pada server sebelumnya yang crash. Awalnya, diinstall Linux Debian 7.2 dari ISO DVD. Kemudian diupgrade ke Linux Debian 8.8 yang merupakan versi terbaru saat tulisan ini disusun.

Untuk kebutuhan sistem informasi terkait, pada server harus digunakan dua versi PHP, yakni PHP 4 dan PHP 5. Debian 8 memberikan default berupa PHP 5.6. Oleh karena itu, diperlukan instalasi PHP4 secara terpisah.

Langkah-langkah

  • Install Linux Debian dari ISO DVD
  • Setting network
  • Package upgrade, dist-upgrade via apt-get
  • Install pMA, Webmin
  • Firewall iptables accept port 22, 80, ICMP, 10000 for webmin
  • Login Webmin
  • Install PHP 4
  • Install MySQL 4
  • Import database
  • Test App
  • Update cron jobs

Instalasi PHP 4

Langkah dapat dilakukan sesuai referensi (2) dengan sedikit modifikasi. Untuk package PHP-4.4.9 dapat diperoleh pada link berikut :

wget http://museum.php.net/php4/php-4.4.9.tar.bz2 -O php-4.4.9.tar.bz2

Oleh karena SSL versi 0.9.8 tidak sukses diinstall juga freetype2 tidak berhasil direferensikan, maka modifikasi configure untuk PHP, menjadi berikut :

./configure --prefix=/opt/phpfcgi-4.4.9 --with-pdo-pgsql --with-zlib-dir --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-calendar --with-curl --with-mcrypt --with-zlib --with-gd --with-pgsql --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-mhash --enable-zip --with-pcre-regex --with-mysql=/usr --with-mysql-sock=/var/run/mysqld/mysqld.sock  --with-jpeg-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf  --with-libdir=/lib/x86_64-linux-gnu  --with-xpm-dir=usr/lib  --enable-ftp --with-imap --with-imap-ssl --with-kerberos --with-gettext --with-expat-dir=/usr  --enable-fastcgi

Sebelumnya, buat symbolic link terlebih dahulu untuk libXpm dengan syntax berikut :

ln -s /usr/lib/x86_64-linux-gnu/libXpm.so /usr/lib/
ln -s /usr/lib/x86_64-linux-gnu/libXpm.a /usr/lib/

Setelah sukses hingga langkah terakhir sebelum ISPConfig, maka langkah berlanjut ke konfigurasi Virtual Host pada apache 2, sesuai referensi (1), dengan sedikit modifikasi pada file conf, sebagaimana berikut :

<VirtualHost *:80>
ServerName debianserver.stmikayani.ac.id
ServerAdmin chanief@stmikayani.ac.id
ErrorLog ${APACHE_LOG_DIR}/site-error.log
CustomLog ${APACHE_LOG_DIR}/site-access.log combined
DocumentRoot /var/www/html/php4
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/html/php4>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
<FilesMatch "\.ph(p3?|tml)$">
Options ExecCGI FollowSymLinks
SetHandler fcgid-script
FCGIWrapper /opt/phpfcgi-4.4.9/bin/php .php
</FilesMatch>
</VirtualHost>

Aktifkan virtual host dan restart Apache dengan langkah berikut :

a2ensite php-four
service apache2 restart

Referensi

  1. Install PHP4 & PHP5 (https://blog.louwii.fr/2014/06/install-php4-and-php5-on-debian-linux/)
  2. https://www.howtoforge.com/how-to-use-php-4.4.9-fastcgi-with-apache-and-ispconfig-3-debian-wheezy

 

Leave a Reply

Your email address will not be published. Required fields are marked *