tutorials questions & answers
by Dary

CentOS compiler installed under the Apache, PHP, MySQL

  • centos
  • Compile
  • apache
  • php
  • mysql
  • openssl

Just start this tutorial to compile CentOS under Apache, PHP and MySQL.

Compile Apache

./configure \
--prefix=/opt/webservice/httpd-2.2.27 \
--enable-so \
--enable-proxy \
--enable-cgi \
--enable-mime-magic \
--enable-expires \
--enable-info \
make install

Add apache run user

useradd -s /sbin/nologin apache

Make the following changes to /opt/webservice/httpd-2.2.27/conf/httpd.conf

+LoadModule php5_module        modules/libphp5.so
+AddType application/x-httpd-php .php .phtml .phpm .do
+AddType application/x-httpd-php-source .phps

 <IfModule dir_module>
-    DirectoryIndex index.html
+    DirectoryIndex index.html index.php
+User apache
+Group apache
+Include conf/conf.d/*.conf

Compile Mysql

wget http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.70.tar.gz
tar -xzvf mysql-5.1.70.tar.gz
./configure \
--prefix=/opt/webservice/mysql-5.1.70 \
--with-charset=utf8 \
make install

Install OpenSSL

wget --no-check-certificate 'https://www.openssl.org/source/openssl-0.9.8zc.tar.gz'
./config --prefix=/opt/webservice/openssl-0.9.8z
make install

./config shared --prefix=/opt/webservice/openssl-0.9.8z
make clean
make install

Compile PHP

wget http://cn2.php.net/get/php-5.5.20.tar.bz2/from/this/mirror
tar -xjvf php-5.5.20.tar.bz2
./configure --prefix=/opt/webservice/php-5.5.20 \
--with-apxs2=/opt/webservice/httpd-2.2.27/bin/apxs \
--with-openssl=/opt/webservice/openssl-0.9.8z \
--with-config-file-path=/opt/webservice/php-5.5.20/etc/ \
--with-mysql=/opt/webservice/mysql-5.1.70 \
--with-curl \
--with-iconv \
--enable-mbstring \
make install

cp ./php.ini-production /opt/webservice/php-5.5.20/etc/

comments (0)

    leave comment

    Please choose login or register to comment in this thread.

    Start now for as low as $5 a month!

    • 8 Characters
    • 1 Uppercase Atleast
    • 1 Number Atleast