cd /usr/local/src
wget -c http://mirror.bit.edu.cn/apache//apr/apr-1.5.1.tar.gz
tar -zxvf apr-1.5.1.tar.gz
chown -R root:root apr-1.5.1
cd apr-1.5.1
./configure --prefix=/usr/local/apr
make && make install
接下来,
wget -c http://mirrors.cnnic.cn/apache//apr/apr-util-1.5.4.tar.gz
tar -zxvf apr-util-1.5.4.tar.gz
chown -R root:root apr-util-1.5.4
cd apr-util-1.5.4
./configure --prefix=/usr/local/apu --with-apr=/usr/local/apr/
make && make install
好啦,验证一下吧
wget -c http://www.openssl.org/source/openssl-1.0.1k.tar.gz
tar -zxvf openssl-1.0.1k.tar.gz
cd openssl-1.0.1k.tar.gz
./config --prefix=/usr/local/openssl -fPIC no-gost no-shared no-zlib
make && make install
三、安装apache httpd server
wget -c http://mirrors.cnnic.cn/apache//httpd/httpd-2.4.10.tar.gz
tar -zxvf httpd-2.4.10.tar.gz
cd httpd-2.4.10
安装httpd 其依赖比较多,有些参数可能是旧版本使用的 可以先 ./configure --help 查看一下
有很多从网上查看的编译方法如下,可能会发生错误: configure: error: pcre-config for libpcre not found.
./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apu/
--enable-so --enable-dav --enable-maintainer-mode --enable-rewrite
--enable-ssl --with-ssl=/usr/local/openssl
所以还得安装 pcre (正则表达式函数库)
直接到官网下载 我这里下载的版本是8.36
tar -zxvf pcre-8.36.tar.gz
cd pcre-8.36
mv pcre-8.36 /usr/local/pcre 直接拷到/usr/local
./configure (编译使用gcc+,没有就安装一下yum -y install gcc-c++)
make && make install
安装好了,就重新编译 httpd 就OK了
./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apu/
--enable-so --enable-dav --enable-maintainer-mode --enable-rewrite
--enable-ssl --with-ssl=/usr/local/openssl --with-pcre=/usr/local/pcre/pcre-config
然后就开始 make, make install(前面安装openssl时如果不加上-fPIC 这里可能就会出错)。
有些人在这一步可能会出现问题:
exports.c:1653: error: redefinition of 'ap_hack_apr_version_string'
exports.c:1022: error: previous definition of 'ap_hack_apr_version_string' was here
这个是./server/exports.c 这个文件中 出现很多 两个相同的常量 从apr apu included进来的 都是相同的,我选择了一个笨方法 把多出来的常量删掉再make install,其实 ./configure中有个参数 --with-included-apr 加上编译就OK了。
安装完毕,尝试启动 /usr/local/apache/bin/apachectl -k start
打开浏览器 输入 http://127.0.0.1
页面显示 : It works!
四、安装Zlib
wget -c http://zlib.net/zlib-1.2.8.tar.gz
tar -zxvf zlib-1.2.8.tar.gz
chown -R root:root zlib-1.2.8
mv zlib-1.2.8 zlib
mv zlib /usr/local/
cd /usr/local/zlib
./configure
make && make install
五、安装Sqlite
wget -c http://www.sqlite.org/2014/sqlite-autoconf-3080704.tar.gz
tar -zxvf sqlite.autoconf-3080704.tar.gz
chown -R root:root sqlite.autoconf-3080704.tar.gz
mv sqlite.autoconf-3080704 sqlite
mv sqlite /usr/local
cd /usr/local/sqlite
./configure
make && make install
六、安装Subversion1.8
wget -c http://mirrors.hust.edu.cn/apache/subversion/subversion-1.8.11.tar.gz
tar -zxvf subversion-1.8.11.tar.gz
cd subversion-1.8.11
mkdir -p ./sqlite-amalgamation (在这里 把刚刚安装好的sqlite中的sqlite3.c文件拷贝到这)
cp /usr/local/sqlite/sqlite3.c ./sqlite-amalgamation/
./configure --prefix=/usr/local/subversion --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apr/
--with-apr-util=/usr/local/apu/ --with-zlib --enable-maintainer-mode
make && make instal
好啦,来验证一下吧
/usr/local/subversion/bin/svnserve --version
svnserve, version 1.8.11 (r1643975)
compiled Jan 12 2015, 18:58:04 on x86_64-unknown-linux-gnu
.
.
.
看一下 /usr/local/subversion/libexec/ 目录下是否存在
mod_authz_svn.so
mod_dav_svn.so
七、Subversion 和 Apache整合
(1)配置Subversion
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:CN
State or Province Name (full name) [Some-State]:Guangdong
Locality Name (eg, city) []:Shenzhen
Organization Name (eg, company) [Internet Widgits Pty Ltd]:xxxxx
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:xxxxxxx
Email Address []:xxxxxxx
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:xxxxxxx
An optional company name []:xxxxxxx
填好信息,生成server.csr
(3)生成证书