2018年2月24日 星期六

XAMPP 更新...

修正httpd.conf下列內容:

  1.  取消目錄瀏覽
  2. 將logs定時roration

取消目錄瀏覽,找到:
<Directory "D:/xampp/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>

刪除其中的 Options 改成
<Directory "D:/xampp/htdocs">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>

將logs做rotation
ErrorLog "|D:/xampp/apache/bin/rotatelogs.exe D:/xampp/apache/logs/error-%Y%m%d.log 86400"
CustomLog "|D:/xampp/apache/bin/rotatelogs.exe D:/xampp/apache/logs/access-%Y%m%d.log 86400" combined

將 / 重導至 HTTPS
<If "%{HTTP_HOST} != 'www.sclai.tk'">
    Redirect "/" "https://www.sclai.tk/"
</If>

<If "%{HTTPS} != 'on'">
    Redirect "/" "https://www.sclai.tk/"
</If>

修正httpd-ssl.conf下列內容:

  1. 將logs定時rotation
  2. #ErrorLog "D:/xampp729/apache/logs/error.log"
    ErrorLog "|D:/xampp729/apache/bin/rotatelogs.exe D:/xampp729/apache/logs/error-%Y%m%d.log 86400"

    #TransferLog "D:/xampp729/apache/logs/access.log"
    TransferLog "|D:/xampp729/apache/bin/rotatelogs.exe D:/xampp729/apache/logs/access-%Y%m%d.log 86400"

    #CustomLog "D:/xampp729/apache/logs/ssl_request.log" \
              "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
    CustomLog "|D:/xampp729/apache/bin/rotatelogs.exe D:/xampp729/apache/logs/ssl_request-%Y%m%d.log 86400" \
              "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

  3. 調整ServerName及ServerAdmin
  4. #ServerName www.example.com:443
    #ServerAdmin admin@example.com
    ServerName www.myname.com:443
    ServerAdmin nobody@gmail.com

  5. 配合sslforfree調整憑證檔案(全部憑證置放於conf/sslforfree/目錄下)
  6. #SSLCertificateFile "conf/ssl.crt/server.crt" SSLCertificateFile "conf/sslforfree/certificate.crt"

    #SSLCertificateKeyFile "conf/ssl.key/server.key" SSLCertificateKeyFile "conf/sslforfree/private.key" SSLCACertificateFile "conf/sslforfree/ca_bundle.crt"

修正php.ini的下列內容:

  1.  設定 PHP 的時區
  2. 開啟imap extension

設定PHP的時區
找到
[Date] ;date.timezone =

改成
[Date] date.timezone = "Asia/Taipei"

或者在 php 中加入:
date_default_timezone_set("Asia/Taipei");

就可以確保時區的正確性。

開啟imap extension
找到
;extension=imap

改成
extension=imap

沒有留言: