arch linux上安裝 httpd+php+mysql+ openssl(轉)

worldblog發表於2007-08-10
arch linux上安裝 httpd+php+mysql+ openssl(轉)[@more@]

  在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

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10752043/viewspace-940389/,如需轉載,請註明出處,否則將追究法律責任。

相關文章