arch linux上安装 httpd+php+mysql+ openssl

在arch linux安装则是非常的容易,只要执行:
# pacman -Sy apache php mysql openssl
根据提示选择输入Y即可安装!

1.修改apache配置文件
默认的情况,apache是不支持PHP的,请修改配置文件:
vi /etc/httpd/conf/httpd.conf

#LoadModule php5_module lib/apache/libphp5.so
的#去掉:
LoadModule php5_module lib/apache/libphp5.so

因为apache默认的情况没有启动ssl,所以要:
1) 修改/etc/conf.d/httpd
把: HTTPD_USE_SSL="no"
改成:HTTPD_USE_SSL="yes"

2) 生成CA的key
# cd /etc/httpd/conf
# openssl req -new -x509 -newkey rsa:1024 -days 3650 -keyout server.key -out server.crt
# openssl rsa -in server.key -out server.key

3) 修改/etc/httpd/conf/ssl.conf

SSLCertificateFile /etc/httpd/conf/server.crt
SSLCertificateKeyFile /etc/httpd/conf/server.key

最后启动apache
/etc/rc.d/httpd start

2.启动mysql
/etc/rc.d/mysqld start

最后你可以打开WEB测试一下:
简单吧?

下面是我的ssl文件:


Listen 443
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl

SSLPassPhraseDialog builtin

SSLSessionCache dbm:/var/log/httpd/ssl_scache
SSLSessionCacheTimeout 300

SSLMutex file:/var/log/httpd/ssl_mutex

SSLRandomSeed startup builtin
SSLRandomSeed connect builtin

# 这里我写直接的IP地址

DocumentRoot "/data/blog"
ServerName blog.ourlinux.net:443
ServerAdmin bixuan@ourlinux.net
ErrorLog /var/log/httpd/blog.ourlinux.net_443_error_log
TransferLog /var/log/httpd/blog.ourlinux.net_443_access_log

SSLEngine on

SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

SSLCertificateFile /etc/httpd/conf/server.crt

SSLCertificateKeyFile /etc/httpd/conf/server.key

SSLCACertificatePath /etc/httpd/conf/ssl_blog.ourlinux.net
SSLCACertificateFile /etc/httpd/conf/server.crt

SSLVerifyClient require
SSLVerifyDepth 1


SSLOptions +StdEnvVars


SSLOptions +StdEnvVars

SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0

CustomLog /var/log/httpd/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

补充:因为我这里的ssl里有虚拟主机,所以务必在:httpd.conf里加上:
NameVirtualHost ip:443
这句!
每次修改配置文件,请记着:reload
# /etc/rc.d/httpd reload

演示地址:http://blog.ourlinux.net

本文地址:http://www1.ourlinux.net/bbs/showforum.php?showtopic=459 如要转载请注明:碧轩居-(http://www.ourlinux.net)

转载于:https://www.cnblogs.com/markor/archive/2007/09/03/879800.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值