- 輸入 htpasswd -c .htpasswd 你要的帳號
- Enter 之後會要求你輸入你想要的密碼. 設定完成之後...
- 在網站的主資料夾, 增加.htaccess 檔. 比方說: /var/www/mysite/public_html/.htaccess
- .htaccess 的內容如下:
AuthType Basic|
AuthName "Restricted Area"
AuthUserFile "/var/www/mysite/.htpasswd"
require valid-user
- 儲存起來, 然後可以立刻refresh 你的網站/網頁看看.
解決Apache 2.2, 關於HTTPS 之下使用PROXY 面對的 proxy server received an invalid response from an upstream server 以及 proxy: pass request body failed 的問題
修改以下 (proxy 以及 從proxy 接收的server): httpd.conf: ----------- 在 Include conf.d/*.conf 的前面加入以下: LimitRequestBody 2147483647 #2Gb Timeout 24000 ProxyTimeout 24000 ProxyBadHeader Ignore ssl.conf ---------- 在各個virtualhost 裡加入以下: SSLEngine on SSLProxyEngine on SSLProxyVerify none SSLProxyCheckPeerCN off #SSLProxyCheckPeerName off SSLProxyProtocol +SSLv3 +TLSv1 +TLSv1.1 +TLSv1.2 以下這個只在proxy server 裡的virtualhost 設定 ProxyPass / https://REMOTE_HOST:443/ retry=1 acquire=3000 timeout=3600 Keepalive=On
留言
張貼留言