{"id":465,"date":"2025-02-21T12:03:57","date_gmt":"2025-02-21T17:03:57","guid":{"rendered":"https:\/\/mkt.selfregional.org\/edit\/?p=465"},"modified":"2025-02-23T14:41:56","modified_gmt":"2025-02-23T19:41:56","slug":"configuration","status":"publish","type":"post","link":"https:\/\/mkt.selfregional.org\/edit\/configuration\/","title":{"rendered":"Configuration"},"content":{"rendered":"\n<p>I like the idiom &#8216;configuration over code&#8217; which means that the way you configure your editor and tools takes precedence over the code itself. I&#8217;m documenting various configurations here for posterity.<\/p>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><\/p>\n\n\n\n<ol style=\"list-style-type:upper-roman\" class=\"wp-block-list\">\n<li>environment\n<ol style=\"list-style-type:lower-roman\" class=\"wp-block-list\">\n<li>server<\/li>\n\n\n\n<li>client<\/li>\n<\/ol>\n<\/li>\n\n\n\n<li>development\n<ol style=\"list-style-type:lower-roman\" class=\"wp-block-list\">\n<li>editor<\/li>\n\n\n\n<li>cms <\/li>\n\n\n\n<li>version control ( git )\n<ol style=\"list-style-type:lower-alpha\" class=\"wp-block-list\">\n<li class=\"has-medium-font-size\">\ud83d\udcc2 <a href=\"https:\/\/code.davidawindham.com\/david\/ssh-edit\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/code.davidawindham.com\/david\/ssh-edit<\/a><\/li>\n\n\n\n<li class=\"has-medium-font-size\">\ud83d\udcc1 <a href=\"https:\/\/github.com\/windhamdavid\/srh-edit\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/github.com\/windhamdavid\/srh-edit<\/a><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n\n\n\n<li>language\n<ol style=\"list-style-type:lower-roman\" class=\"wp-block-list\">\n<li>perfs<\/li>\n<\/ol>\n<\/li>\n\n\n\n<li>error reporting<\/li>\n\n\n\n<li>debugging<\/li>\n\n\n\n<li>logging<\/li>\n<\/ol>\n\n\n\n<div style=\"height:150px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Environment -&gt; Server<\/h3>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>Because we\u2019ll be using both Apache and nginx web servers for performance reasons, the configuration files for each can be server wide or target specific websites.  Apache uses <code>.htaccess<\/code> and Nginx uses <code>nginx.conf<\/code> files<\/p>\n\n\n\n<pre class=\"wp-block-code alignwide\"><code lang=\"apacheconf\" class=\"language-apacheconf\"># .htaccess\n\n# .htpasswd\n&lt;FilesMatch \"(\\.htaccess|\\.htpasswd)\"&gt;\n  Order deny,allow\n  Deny from all\n&lt;\/FilesMatch&gt;\n\n# Blocking bots\nRewriteCond %{HTTP_USER_AGENT} (AdsBot-Google|AI2Bot|Ai2Bot-Dolma|Amazonbot|anthropic-ai|Applebot|Applebot-Extended|AwarioRssBot|AwarioSmartBot|Bytespider|CCBot|ChatGPT|ChatGPT-User|Claude-Web|ClaudeBot|cohere-ai|cohere-training-data-crawler|Crawlspace|DataForSeoBot|Diffbot|DuckAssistBot|FacebookBot|FriendlyCrawler|Google-Extended|GoogleOther|GoogleOther-Image|GoogleOther-Video|GPTBot|iaskspider\/2.0|ICC-Crawler|ImagesiftBot|img2dataset|ISSCyberRiskCrawler|Kangaroo Bot|magpie-crawler|Meta-ExternalAgent|Meta-ExternalFetcher|OAI-SearchBot|omgili|omgilibot|PanguBot|peer39_crawler|PerplexityBot|PetalBot|Scrapy|SemrushBot|Sidetrade indexer bot|Timpibot|VelenPublicWebCrawler|Webzio-Extended|YouBot) [NC]\nRewriteRule ^ \u2013 [F]\n\n# Caching\n&lt;IfModule mod_headers.c&gt;\n  &lt;FilesMatch \"\\.(ico|pdf|js|mjs|css|gif|png|jpg|jpeg|txt|woff2|woff)$\"&gt;\n    Header set Cache-Control \"max-age=31536000, public\"\n  &lt;\/FilesMatch&gt;\n&lt;\/IfModule&gt;\n\n&lt;IfModule mod_headers.c&gt;\n  &lt;FilesMatch \"\\.(js|mjs|css|xml|gz)$\"&gt;\n    Header append Vary Accept-Encoding\n  &lt;\/FilesMatch&gt;\n&lt;\/IfModule&gt;\n\n&lt;IfModule mod_headers.c&gt;\n  &lt;FilesMatch \".(js|mjs|css|xml|gz|html|woff|woff2|ttf)$\"&gt;\n    Header append Vary: Accept-Encoding\n  &lt;\/FilesMatch&gt;\n&lt;\/IfModule&gt;\n\n# Keep Alive Header\n&lt;IfModule mod_headers.c&gt;\n  Header set Connection keep-alive\n&lt;\/IfModule&gt;\n\n# CORS\n&lt;IfModule mod_headers.c&gt;\n  &lt;FilesMatch \"\\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js|mjs|gif|png|jpe?g|svg|svgz|ico|webp)$\"&gt;\n  Header set Access-Control-Allow-Origin \"*\"\n  &lt;\/FilesMatch&gt;\n&lt;\/IfModule&gt;\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code alignwide\"><code lang=\"nginx\" class=\"language-nginx\"># nginx.conf\n\n# Security Headers\n  add_header X-Frame-Options \"SAMEORIGIN\" always;\n  add_header X-Content-Type-Options \"nosniff\" always;\n  add_header X-XSS-Protection \"1; mode=block\" always;\n  add_header Referrer-Policy \"strict-origin-when-cross-origin\" always;\n  add_header Content-Security-Policy \"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data: https:;\" always;\n  server_tokens off;\n\n# compression\n  gzip_vary on;\n  gzip_comp_level 6;\n  gzip_types text\/plain text\/css application\/json application\/javascript text\/xml application\/xml application\/xml+rss text\/javascript;\n  gzip_proxied no-cache no-store private expired auth;\n  gzip_disable \"MSIE [1-6]\\.\";<\/code><\/pre>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Development -&gt; WordPress<\/h3>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>WordPress 6.3 introduced &#8216;development mode&#8217; which avoids the theme.json caching.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">define( 'WP_DEVELOPMENT_MODE', 'theme' );\n\ndefine('WP_DEBUG', true);\ndefine('WP_DEBUG_DISPLAY', true );\ndefine('WP_DEBUG_LOG', '\/_log\/error.log');<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I like the idiom &#8216;configuration over code&#8217; which means that the way you configure your editor and tools takes precedence over the code itself. I&#8217;m documenting various configurations here for posterity. Environment -&gt; Server Because we\u2019ll be using both Apache and nginx web servers for performance reasons, the configuration files for each can be server [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-465","post","type-post","status-publish","format-standard","hentry","category-code"],"_links":{"self":[{"href":"https:\/\/mkt.selfregional.org\/edit\/wp-json\/wp\/v2\/posts\/465","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mkt.selfregional.org\/edit\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mkt.selfregional.org\/edit\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mkt.selfregional.org\/edit\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mkt.selfregional.org\/edit\/wp-json\/wp\/v2\/comments?post=465"}],"version-history":[{"count":34,"href":"https:\/\/mkt.selfregional.org\/edit\/wp-json\/wp\/v2\/posts\/465\/revisions"}],"predecessor-version":[{"id":655,"href":"https:\/\/mkt.selfregional.org\/edit\/wp-json\/wp\/v2\/posts\/465\/revisions\/655"}],"wp:attachment":[{"href":"https:\/\/mkt.selfregional.org\/edit\/wp-json\/wp\/v2\/media?parent=465"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mkt.selfregional.org\/edit\/wp-json\/wp\/v2\/categories?post=465"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mkt.selfregional.org\/edit\/wp-json\/wp\/v2\/tags?post=465"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}