apache2
1 人追踪
17 篇文章
Phanix

apache2 搭配 letsencrypt certbot 關閉 TLS 1.0 與 TLS 1.1

因為安全性問題的關係,所以許多瀏覽器已經開始不支援 TLS 1.0 與 TLS 1.1,詳細資訊在這邊可以看到。而使用 certbot 安裝 letsencrypt 發的 ssl 憑證,透過https://www.ssllabs.com/檢查的時候都會因為偵測到系統還支援這兩個版本TLS,所以評分會被打成B。

Phanix

安裝非預設版號 certbot apache plugin / installing certbot apache plugin with non-default version number

在大部分情況下安裝預設版本都可以正常無痛完成,但有時候就是會遇到不一樣的情況。因為有台 server 之前要安裝 route53 plugin,然後要裝預設的版本一直無法下載成功,解決方式就是更新 certbot 版本。但接下來要安裝 apache plugin 的時候就發現 a...

Phanix

AWS Route53 Geo dns with letsencrypt

如果是單一一台主機透過 certbot 要用 letsencrypt 這個免費的 ssl 憑證服務的話,其實並不難,以 ubuntu 16.04 搭配 apache 的話會像這樣 而 Amazon AWS 的 Route53 服務有提供很好用的 geo-based dns 功能,...

Phanix

Exclude a url path using apache .htaccess

用 http auth 時,如果要避開某些 url 不做檢查(例如API)。一般來說全部都要檢查的話,.htaccess 檔案會長這樣。AuthType Basic AuthName "Restricted Content" AuthUserFile /var/opt/www...

Phanix

Apache 2.4 CORS configuration

如果是 api 的話,可以在程式的部分加上 header,但 resouce file (如圖片等)就得在 apache 裏頭做設定了 可以針對要設定的目錄在 site configuration file (/etc/apache2/sites-enabled/)中加上 &l...

Phanix

Installing apache, mysql, php 7.0, php-apcu and Phalcon framework on Centos 7

紀錄一下。被權限設定浪費不少時間 =_= #install apache2.4 httpd sudo yum install httpd sudo systemctl start httpd.service 如果直接 yum install mysql 的話,會裝 mariadb。

Phanix

php+apache 執行 sudo 命令出現 sudo: no tty present and no askpass program specified

php 用 exec (或 shell_exec 等)在 command line 下以 sudo 執行命令的時候,會出現sudo: no tty present and no askpass program specified的錯誤。主要原因是因為在 php + apache ...

Phanix

Apache 2.4 ProxyPass

ProxyPass 可以把 URL A 轉去 URL B,並保留網址是 URL A。常見的用法可能像是 原本有網址 site-a.com,可是之後做了新版的網站,但是舊有的論壇功能 (www.site-a.com/forum/) 要留著 原本有 site-a.com 跟 sit...

Phanix

Phalcon CSRF issue with Chrome

主因是 Chrome 瀏覽器有些行為很奇怪。在這篇(https://forum.phalcon.io/discussion/922/csrf-protection-not-working#C6649)討論裡面有提到,Chrome瀏覽器在 background 會去 request...

Phanix

Move wordpress to the other subfolder (or alias folder)

主要參考https://support.tigertech.net/move-wordpress#moving-wordpress-to-jmp 假設要從原本 http://www.test.com/ 移到 http://www.test.com/blog/ 如果 /blog/...

Phanix

Apache keep-alive v.s. iOS ajax bug

起因是因為 iOS 上 safari 瀏覽器在做 ajax request 的時候,有時會有bug (https://stackoverflow.com/questions/33895463/safari-ajax-request-failed-to-load-resource-...

Phanix

Adding process time in Apache log

紀錄一下,要不然每次都還要找 +__+ 用 %{ms}T $ more /etc/apache2/apache.conf .... LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O %{ms}T \"%{Referer}i\" \"%{...

Phanix

Apache redirects specific site requests to the other URL

ServerName www.site_name.com RedirectPermanent / http://www.the_other_site.com/ 起因就是因為XX的中國的機器用 domain name 連 http 要另外登記備案… WTF Original link: Phanix's Blog

Phanix

Create self-signed SSL for apache2 in ubuntu 14/16, with multi ports on https

主要參考這篇跟這篇 有些實用的命令另列於下 $ sudo apache2ctl configtest Original link: Phanix's Blog

Phanix

Apache multiple allow origin (enable CORS) for multiple domains

筆記一下 Apache web server 只能設定一次 Access-Control-Allow-Origin header,如果有多個 domain 需要設定的話,通常會習慣在 .htaccess 內處理 但如果要在 apache 本身的設定內(例如 site-enabl...

Phanix

Specify cache expire time in Apache 2.4

如果有某些檔案會經常更動(比方說一些 batch process 會將結果寫成 .html 檔),又希望每次瀏覽時能夠拿到最新的,而不是瀏覽器內的 cache,那可以在 apache2.4 內這樣設定 Alias /myfolder /var/opt/www/myfolderp...

Phanix

apache2.4 .htaccess 限定ip address 存取特定url

紀錄一下 $ more .htaccess.prod <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ public/ [L] RewriteRule (.*...

没有更多