系统环境:CentOS6.5
软件包:httpd-2.4.37.tar.gz apr-1.6.5.tar.gz apr-util-1.6.1.tar.gz
mysql-5.5.32.tar.gz cmake-2.8.8.tar.gz
php-5.6.38.tar.gz
Discuz_SC_GBK.zip
1、apache源码安装
-
关闭防火墙
-
iptables -F
-
chkconfig iptables off
-
mkdir /tmp/lamp
-
cd /tmp/lamp
-
yum install apr apr-util apr-devel apr-util-devel -y
-
tar -zxvf httpd-2.4.37.tar.gz
-
cd httpd-2.4.37
-
./configure --prefix=/usr/local/apache2 --with-included-apr --enable-rewrite --enable-so
-
---------------------------如果编译报以下错误----------------------------------
-
checking for APR... configure: WARNING: APR version 1.4.0 or later is required, found 1.3.9
-
configure:
-
-
WARNING: skipped APR at apr-1-config, version not acceptable
-
no
-
configure: error: APR not found. ?Please read
-
-
the documentation.
-
-------------------------需要更新apr apr-util版本到1.4以上---------------------
-
tar -zxvf apr-1.6.5.tar.gz -C /tmp/lamp/httpd-2.4.37/srclib/
-
tar -zxvf apr-util-1.6.1.tar.gz -C /tmp/lamp/httpd-2.4.37/srclib/
-
cd /tmp/lamp/httpd-2.4.37/srclib
-
mv apr-1.6.5 apr
-
mv apr-util-1.6.1 apr-util
-
-------------------------------------------------------------------------------
-
在进行编译:
-
./configure --prefix=/usr/local/apache2 --with-included-apr --enable-rewrite --enable-so
-
-----------------------又出现pcre-config报错----------------------------------
-
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
-
---------------------------------安装pcre-devel即可------------------------------------
-
yum -y install pcre-devel
-
或
-
wget -P /tmp/lamp ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz
-
tar -zxvf pcre-8.38.tar.gz
-
./configure --prefix=/usr/local/pcre
-
配置pcre过程C++报错
-
configure: error: You need a C++ compiler for C++ support.
-
安装gcc-c++
-
yum -y install gcc-c++
-
在编译pcre
-
./configure --prefix=/usr/local/pcre
-
make
-
make install
-
--------------------------------------------------------------------------------------
-
在重新进行编译:
-
./configure --prefix=/usr/local/apache2 --with-included-apr --enable-rewrite --enable-so
-
make
-
make install
-
---------------------------------------apache安装完毕-------------------------------
2、mysql源码安装
3、PHP源码安装
-
cd /tmp/lamp/
-
tar -zxvf php-5.6.38.tar.gz
-
cd php-5.6.38
-
./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php/etc --with-
-
-
apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql/
-
--------------------------------------报错---------------------------------
-
configure: error: xml2-config not found. Please check your libxml2 installation.
-
---------------------------安装libxml2 libxml2-devel-------------------------
-
yum install libxml2 libxml2-devel -y
-
在重新配置
-
./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php/etc --with-
-
-
apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql/
-
make
-
make install
-
-
整合apache+php环境,修改/usr/local/apache2/conf/httpd.conf
-
修改
-
ServerName localhost:80
-
添加
-
AddType application/x-httpd-php .php
-
DirectoryIndex index.php index.html
-
-
编译index.php配置文件
-
cat >> /usr/local/apache2/htdocs/index.php << EOF
-
php
-
phpinfo();
-
?>
-
EOF
-
启动apache
-
/usr/local/apache2/bin/apachectl start
-
IE访问
4、安装discuz
-
cd /tmp/lamp
-
unzip Discuz_SC_GBK.zip -d /usr/local/apache2/htdocs/
-
cd /usr/local/apache2/htdocs/
-
mv dir_SC_GBK/upload/* .
-
chmod -R 777 data/ uc_server/ config/ uc_client/
-
/usr/local/apache2/bin/apachectl restart
-
创建discuz数据库
-
mysql -uroot -p123456
-
mysql> create database discuz;
-
mysql> grant all on discuz.* to discuz@'localhost' identified by '123456'
-
IE访问
阅读(781) | 评论(0) | 转发(0) |