学习服务器配置之路~~(2)

配置PHP与Apache (CENTOS 6.5)

原文参考链接: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


APR and APR-Util
Make sure you have APR and APR-Util already installed on your system. If you don't, or prefer to not use the system-provided versions, download the latest versions of both APR and APR-Util from Apache APR, unpack them into ./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.

这是Apache官方的说明

所以解压完后,你要重名名


#http-2.4.7是你刚才下载Apache解压出来的那个目录
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





原文地址:https://www.cnblogs.com/-Doraemon/p/4700064.html