最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
CentOS下编译安装Apache、PHP、MySQL环境教程
时间:2022-06-30 21:25:09 编辑:袖梨 来源:一聚教程网
编译Apache
./configure \
--prefix=/opt/webservice/httpd-2.2.27 \
--enable-so \
--enable-proxy \
--enable-cgi \
--enable-mime-magic \
--enable-expires \
--enable-info \
--enable-rewrite
make
make install
添加apache运行用户
useradd -s /sbin/nologin apache
针对/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
- DirectoryIndex index.html
+ DirectoryIndex index.html index.php
+
+User apache
+Group apache
+
+Include conf/conf.d/*.conf
编译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 \
--enable-thread-safe-client
make
make 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
编译 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/
相关文章
- 王者荣耀侦探能力大测试攻略 王者荣耀侦探能力大测试怎么过 11-22
- 无期迷途主线前瞻兑换码是什么 11-22
- 原神欧洛伦怎么培养 11-22
- 炉石传说网易云音乐联动怎么玩 11-22
- 永劫无间手游确幸转盘怎么样 11-22
- 无期迷途主线前瞻兑换码是什么 无期迷途主线前瞻直播兑换码介绍 11-22