这篇文章主要介绍“arch linux上安装 httpd+php+mysql+ openssl的教程”,在日常操作中,相信很多人在arch linux上安装 httpd+php+mysql+ openssl的教程问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”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
到此,关于“arch linux上安装 httpd+php+mysql+ openssl的教程”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注亿速云网站,小编会继续努力为大家带来更多实用的文章!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。