<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>apache on IT Quicktasks</title><link>https://quicktasks.ismael.casimpan.com/tags/apache/</link><description>Recent content in apache on IT Quicktasks</description><generator>Hugo -- gohugo.io</generator><copyright>Copyright © 2018–2022, Ismael Casimpan Jr.; All Rights Reserved</copyright><lastBuildDate>Fri, 10 Jul 2020 00:20:25 +0800</lastBuildDate><atom:link href="https://quicktasks.ismael.casimpan.com/tags/apache/index.xml" rel="self" type="application/rss+xml"/><item><title>Apache 2.4: IP Whitelisting</title><link>https://quicktasks.ismael.casimpan.com/post/ip-whitelisting-apache2.4/</link><pubDate>Fri, 10 Jul 2020 00:20:25 +0800</pubDate><guid>https://quicktasks.ismael.casimpan.com/post/ip-whitelisting-apache2.4/</guid><description>
1... 2... 3AuthType Basic 4AuthName &amp;#34;Development Area&amp;#34; 5AuthUserFile /var/www/sites/.htpasswd 6&amp;lt;RequireAny&amp;gt; 7Require ip 19.233.95.152 8Require ip 31.169.217.174 9Require ip 33.202.255.41 10Require ip 31.175.111.184 11Require ip 51.209.11.159 12Require ip 129.162.144.55 13Require valid-user 14&amp;lt;/RequireAny&amp;gt; 15... 16... See https://stackoverflow.com/questions/10419592/htaccess-htpasswd-bypass-if-at-a-certain-ip-address</description></item><item><title>Apache Basic Auth</title><link>https://quicktasks.ismael.casimpan.com/post/apache-basic-auth/</link><pubDate>Fri, 10 Jul 2020 00:20:25 +0800</pubDate><guid>https://quicktasks.ismael.casimpan.com/post/apache-basic-auth/</guid><description>
1AuthType Basic 2AuthName &amp;#34;Development&amp;#34; 3AuthUserFile /var/www/sites/.htpasswd 4Require valid-user</description></item><item><title>Apache Basic Authentication in ProxyPass</title><link>https://quicktasks.ismael.casimpan.com/post/apache-basic-authentication-proxypass/</link><pubDate>Fri, 10 Jul 2020 00:20:25 +0800</pubDate><guid>https://quicktasks.ismael.casimpan.com/post/apache-basic-authentication-proxypass/</guid><description>
1&amp;lt;VirtualHost *:443&amp;gt; 2ServerName example.com 34SSLEngine on 5SSLCertificateFile /etc/httpd/conf.d/ssl/2017-example.com.crt 6SSLCertificateKeyFile /etc/httpd/conf.d/ssl/2017-example.com.key 7SSLCertificateChainFile /etc/httpd/conf.d/ssl/2017-example.com.bundle.crt 8910ProxyPreserveHost On 1112ProxyPass / http://127.0.0.1:8025/ 13ProxyPassReverse / http://127.0.0.1:8025/ 1415&amp;lt;Location /&amp;gt; 16Options -Indexes 17AllowOverride All 1819AuthType Basic 20AuthName &amp;#34;Development Area&amp;#34; 21AuthUserFile /var/www/sites/.htpasswd 22Require valid-user 23&amp;lt;/Location&amp;gt; 24&amp;lt;/VirtualHost&amp;gt;</description></item><item><title>Apache HSTS</title><link>https://quicktasks.ismael.casimpan.com/post/apache-hsts/</link><pubDate>Fri, 10 Jul 2020 00:20:25 +0800</pubDate><guid>https://quicktasks.ismael.casimpan.com/post/apache-hsts/</guid><description>
When a user visits your website, the above header will load first and the expiration time is 2 years (63072000 in seconds).
1# Optionally load the headers module: 2LoadModule headers_module modules/mod_headers.so 3&amp;lt;VirtualHost 67.89.123.45:443&amp;gt; 4Header always set Strict-Transport-Security “max-age=63072000; includeSubdomains;” 5&amp;lt;/VirtualHost&amp;gt; 6... 7... 8... 9&amp;lt;VirtualHost *:80&amp;gt; 10[…] 11ServerName example.com 12Redirect permanent / https://example.com/ 13&amp;lt;/VirtualHost&amp;gt; More details in https://medium.com/@sslsecurity/how-to-enable-hsts-on-apache-nginx-and-lighttpd-8b0c64155911</description></item><item><title>Apache Redirect for http to https via .htaccess</title><link>https://quicktasks.ismael.casimpan.com/post/redirect-http-to-https-in-htaccess/</link><pubDate>Fri, 10 Jul 2020 00:20:25 +0800</pubDate><guid>https://quicktasks.ismael.casimpan.com/post/redirect-http-to-https-in-htaccess/</guid><description>
Generic way to do it but would result into duplicate URLs, e.g. https://example.com &amp;amp; https://www.example.com
1RewriteCond %{HTTPS} off 2RewriteCond %{HTTP:X-Forwarded-Proto} !https 3RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] To avoid the duplicate URLs, do the following:
1## 1. Redirect all non-https except www to https://www 2RewriteCond %{HTTP_HOST} !foo\.example\.com [NC] # exclude foo.example.com domain 3RewriteCond %{HTTP_HOST} !bar\.example\.net [NC] # exclude foo.example.net domain 4RewriteCond %{HTTP_HOST} . 5RewriteCond %{HTTP_HOST} !^www\. [NC] 6RewriteCond %{HTTP:X-Forwarded-Proto} !https 7RewriteRule ^ https://www.</description></item><item><title>Dump All Apache Modules Installed</title><link>https://quicktasks.ismael.casimpan.com/post/dump-all-apache-modules-installed/</link><pubDate>Fri, 10 Jul 2020 00:20:25 +0800</pubDate><guid>https://quicktasks.ismael.casimpan.com/post/dump-all-apache-modules-installed/</guid><description>
1httpd -t -D DUMP_MODULES</description></item><item><title>Logging Cloudflare Country Code in Apache Backend</title><link>https://quicktasks.ismael.casimpan.com/post/logging-cloudflare-countrycode-apache-backend/</link><pubDate>Fri, 10 Jul 2020 00:20:25 +0800</pubDate><guid>https://quicktasks.ismael.casimpan.com/post/logging-cloudflare-countrycode-apache-backend/</guid><description>
1... 2... 3LogFormat &amp;#34;%h %l %u %t \&amp;#34;%r\&amp;#34; %&amp;gt;s %b \&amp;#34;%{Referer}i\&amp;#34; \&amp;#34;%{User-Agent}i\&amp;#34; %{cf-ipcountry}i&amp;#34; cloudflare_custom 4CustomLog /var/log/httpd/site.example.com-cloudflare_custom.log cloudflare_custom 5... 6... See details in https://support.cloudflare.com/hc/en-us/articles/200168236-What-does-Cloudflare-IP-Geolocation-do-</description></item><item><title>SSLPassPhraseDialog and How to Use It</title><link>https://quicktasks.ismael.casimpan.com/post/sslpassphrasedialog-how-to-use/</link><pubDate>Fri, 10 Jul 2020 00:20:25 +0800</pubDate><guid>https://quicktasks.ismael.casimpan.com/post/sslpassphrasedialog-how-to-use/</guid><description>
See https://griffith.wordpress.com/tag/sslpassphrasedialog/</description></item><item><title>Formerly using nginx, Moving to Apache won't Renew Cert</title><link>https://quicktasks.ismael.casimpan.com/post/renew-from-nginx-to-apache/</link><pubDate>Sun, 07 Jun 2020 00:20:25 +0800</pubDate><guid>https://quicktasks.ismael.casimpan.com/post/renew-from-nginx-to-apache/</guid><description>
It's quite expected that certificate won't renew as the automation has been broken. What you can do is install the apache version of certbot
1yum install python-certbot-apache and re-issue the certificate
1sudo certbot --apache -d www.example.org</description></item></channel></rss>