原文参考链接:Click me
第一步:安装Apache
下载Apache源码到目录 如:/home/apache/
解压(linux下我用.tar.gz 可以用tar工具命令:tar -zxvf your-file.tar.gz)到当前目录
第二部:编译、安装
./configure --enable-so --enable-ssl --with-mpm=prefork --with-included-apr
中间报错 apr没有找到等错误
下载:Apr and Apr-devel
./srclib/apr
and ./srclib/apr-util
(be sure the directory names do not have version numbers; for example, the APR distribution must be under ./srclib/apr/) and use ./configure
's --with-included-apr
option. On some platforms, you may have to install the corresponding -dev
packages to allow httpd to build against your installed copy of APR and APR-Util.mv apr-1.4.6 /usr/src/httpd-2.4.7/srclib/apr
mv apr-util-1.5.3 /usr/src/httpd-2.4.7/srclib/apr-util
然后开启ssl
cd /usr/local/apache2/conf/
vim httpd.conf
找到# LoadModule ssl_module modules/mod_ssl.so
并注释掉
wq保存退出
cd /usr/local/apache2/conf/执行如下命令:
openssl genrsa -des3 -out server.key 1024
按提示操作然后:openssl req -new -key server.key -out server.csr
然后
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
启动服务
/usr/local/apache2/bin/apachectl start
第三部:安装配置PHP