Pengen Punya WebSite instan kualitas intan ?

Thursday, April 15, 2010

Install Apache PHP and MySQL OpenSUSE 11.00 i586

What is Apache / HTTPD ?
Apache is a freely available Web server that is distributed under an open source license. It is the most widely-installed Web server.

What is PHP ?
PHP is a scripting language originally designed for producing dynamic web pages. It has evolved to include a command line interface capability and can be used in standalone graphical applications.

What is MySQL ?
MySQL is a relational database management system (RDBMS)[1] which has more than 6 million installations.[2] The program runs as a server providing multi-user access to a number of databases.

In This Tutorial, We will start to install and configure Apache Webserver, PHP and Mysql from Source / tar.gz in O/S OpenSUSE 11.0

So I assume you already have OpenSUSE11 installed, up and running.
This tutorial also can be implemented in other O/S such as : Centos and Fedora or other Linux O/S.

1. Download All Packages and Other dependency packages.

Login into your server with root access.
#cd /root/
#wget http://apache.the.net.id/httpd/httpd-2.2.15.tar.gz
#wget http://id.php.net/distributions/php-5.3.1.tar.gz
#wget http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.43.tar.gz

Download GD, Freetype, LibXML2,LIBJPEG, LIBPNG, CURL, ZLIB, DBI, GD
#wget ftp://xmlsoft.org/libxml2/libxml2-2.7.7.tar.gz
#wget http://www.ijg.org/files/jpegsrc.v7.tar.gz
#wget http://curl.haxx.se/download/curl-7.20.0.tar.gz
#wget http://ftp.twaren.net/Unix/NonGNU/freetype/freetype-2.3.12.tar.gz
#wget http://www.sfr-fresh.com/unix/privat/openca-base-1.1.0.tar.gz:a/openca-base-1.1.0/src/ext-modules/DBI-1.609.tar.gz
#wget http://nchc.dl.sourceforge.net/project/libpng/libpng-stable/1.2.39/libpng-1.2.39.tar.gz
#wget http://google-desktop-for-linux-mirror.googlecode.com/files/zlib-1.2.3.tar.gz
#wget http://www.libgd.org/releases/gd-2.0.35.tar.gz
#wget ftp://ftp.cac.washington.edu/imap/imap-2007e.tar.gz

make sure C compiler and Dependencies are installed
yast -i gcc gcc-c++ ncurses-devel pam-devel automake

Extract, Configure and Install MySQL Server

make sure ncurses-devel was installed

make sure user and group mysql was created
#cd /root
#tar -zxvf mysql-5.1.43.tar.gz
#cd mysql-5.1.43
#./configure --prefix=/usr/local/mysql \
--localstatedir=/usr/local/mysql/var \
--with-pthread --with-big-tables
#make && make install

Change mysql dir permission
#chown -R mysql.mysql /usr/local/mysql

Copy mysql cnf files from this directory below to /etc/ and change the file to my.cnf
#cp /usr/local/mysql/share/mysql/my-small.cnf  /etc/my.cnf

Install mysql DB

#/usr/local/mysql/bin/mysql_install_db  --user=mysql

Starting mysql server
#/usr/local/mysql/bin/mysqld_safe  --user=mysql &

Create mysql root password

#/usr/local/mysql/bin/mysqladmin  -u root password 'new-password'

Add script to start mysql into boot.local
echo "/usr/local/mysql/bin/mysqld_safe  --user=mysql &" >> /etc/init.d/boot.local

Make sure OpenSSL were installed

vmsuse:~/php-5.3.1 # rpm -qa |grep openssl
libopenssl0_9_8-0.9.8g-47.1
openssl-certs-0.9.8g-47.1
libopenssl-devel-0.9.8g-47.12
openssl-0.9.8g-47.1

Install Apache/ HTTPD Web Server
#cd /root
#tar -zxvf httpd-2.2.15.tar.gz
#cd httpd-2.2.15
#./configure --prefix=/usr/local/apache2 \
--enable-so --enable-mods-shared=most \
--enable-ssl=static --with-ssl=/usr/local/ssl
#make && make install

Starting Apache Webserver
#/usr/local/apache2/bin/apachectl  start

Add script to start Apache into boot.local
#echo "/usr/local/apache2/bin/apachectl  start" >> /etc/init.d/boot.local

Install Zlib, FreeType, GD, LibXML2,LIBJPEG, LIBPNG, CURL, DBI
#cd /root
#tar -zxvf zlib-1.2.3.tar.gz
#cd zlib-1.2.3
#./configure && make && make install

#cd ..
#tar -zxvf freetype-2.3.12.tar.gz
#cd freetype-2.3.12
#./configure && make && make install

#cd ..
#tar -zxvf jpegsrc.v7.tar.gz
#cd jpeg-7
#./configure --prefix=/usr/local  --enable-shared
#make && make install

#cd ..
#tar -zxvf libpng-1.2.39.tar.gz
#cd libpng-1.2.39
#./configure && make && make install

#cd ..
#tar -zxvf curl-7.20.0.tar.gz
#cd curl-7.20.0
#./configure && make && make install

#cd ..
#tar -zxvf libxml2-2.7.7.tar.gz
#cd libxml2-2.7.7
#./configure && make && make install

before install gd make sure gettext-tools and libtool were installed
#cd ..
#tar -zxvf gd-2.0.35.tar.gz
#cd gd-2.0.35
#./configure --with-freetype=/usr/local \
--with-jpeg=/usr/local/lib \
--with-png=/usr/local/lib
#aclocal
#make && make install

#cd ..
#tar -zxvf DBI-1.609.tar.gz
#cd DBI-1.609
#perl Makefile.PL
#make && make install

#cd /usr/local
#mv /root/imap-2007e.tar.gz /usr/local/
#tar -zxvf imap-2007e.tar.gz
#cd imap-2007e
#make slx SSLINCLUDE=/usr/include/openssl/
#cp /usr/local/imap-2007e/c-client/c-client.a /usr/lib/libc-client.a
#cp /usr/local/imap-2007e/src/c-client/mail.h /usr/include/
#cp /usr/local/imap-2007e/src/c-client/rfc822.h /usr/include/
#cp /usr/local/imap-2007e/c-client/linkage.h /usr/include/

Install PHP
#cd /root
#tar -zxvf php-5.3.1.tar.gz
#cd php-5.3.1
#./configure --with-apxs2=/usr/local/apache2/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-gd=/usr/local \
--with-gd=/usr/local \
--with-jpeg-dir=/usr/local/lib \
--with-zlib-dir=/usr/local \
--enable-ftp \
--with-png-dir=/usr/local/lib \
--with-freetype-dir=/usr/local \
--with-curl=/usr/local \
--with-imap=/usr/local/imap-2007e \
--with-imap-ssl \
--enable-mbstring
#make && make install

Copy php.ini
#cp php.ini-production  /usr/local/lib/php.ini

Configure httpd.conf to support PHP
#cd /usr/local/apache2/conf/
#nano httpd.conf

### make sure this line below is already there
LoadModule  php5_module        modules/libphp5.so
AddType application/x-httpd-php .php

Edit php.ini
#nano /usr/local/lib/php.ini

*make sure short_open_tag = On

Create a test.php with phpinfo in file
#nano /usr/local/apache2/htdocs/tes.php
<? phpinfo(); ?>

Restart service apache
/usr/local/apache2/bin/apachectl restart

Browse from browser file tes.php


or We also can check php result from console

vmsuse:~ # php -v
PHP 5.3.1 (cli) (built: Apr 15 2010 08:50:59)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies

if any mistake, please correct it





7 comments:

Install eAccelerator on PHP 5.3 | coretan dinding said...
This comment has been removed by a blog administrator.
install mrtg (localhost) on opensuse 11.0 | coretan dinding said...
This comment has been removed by a blog administrator.
install awstats on opensuse 11.0 | coretan dinding said...

[...] The dependency are php, perl, mysql (db server), apache (httpd) or you can see this. [...]

configure vhost (apache) on OpenSUSE 11.0 | coretan dinding said...

[...] dependency before configure [...]

install cacti | coretan dinding said...

[...] : WebServer,MySQL,PHP, net-snmp, rrdtool (you can install net-snmp and rrdtool from zypper or [...]

Configure Apache2 and Working With Subversion | coretan dinding said...

[...] Apache2 or HTTPD. So i assume you already have apache installed on your server. You can follow in http://www.idprayoga.com/?p=47 to install apache php and [...]

Install FFMPEG and PHP-FFMPEG Youtube Like Script | coretan dinding said...

[...] running in your server. Please follow up the apache, php and mysql installation from this URL below http://www.idprayoga.com/?p=47 and you already have Subversion up and running in your server too. Please follow up the Subversion [...]

Post a Comment