How to compile and install the Apache, PHP, and MySQL environment in CentOS

Source: Internet
Author: User
Tags bz2 install openssl openssl centos

Compile Apache

./Configure \
-- Prefix =/opt/webservices/httpd-2.2.27 \
-- Enable-so \
-- Enable-proxy \
-- Enable-cgi \
-- Enable-mime-magic \
-- Enable-expires \
-- Enable-info \
-- Enable-rewrite
Make
Make install

Add an apache running user

Useradd-s/sbin/nologin apache

Modify/opt/webservice/httpd-2.2.27/conf/httpd. conf as follows

+ 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
</IfModule>
+
+ 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/webservices/mysql-5.1.70 \
-- With-charset = utf8 \
-- Enable-thread-safe-client
Make
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
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 \
-- Enable-pdo
Make
Make install

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.