edits
This commit is contained in:
parent
ce31702280
commit
b21831536e
|
@ -1,7 +1,7 @@
|
||||||
+++
|
+++
|
||||||
date = '2024-11-13T11:53:13+01:00'
|
date = '2024-11-13T11:53:13+01:00'
|
||||||
draft = false
|
draft = false
|
||||||
title = 'Permissions Strike Again'
|
title = 'Permissions strike again'
|
||||||
tags = ['linux']
|
tags = ['linux']
|
||||||
+++
|
+++
|
||||||
|
|
||||||
|
@ -15,9 +15,9 @@ Please, Andrzej. Please. The next time you're building a website, be it for a cl
|
||||||
|
|
||||||
## What?
|
## What?
|
||||||
|
|
||||||
In Linux we open directories by 'executing' them. A directory is an executable that lists part of file-system for us, basically. Now, by default, the home directory is only executable by its owner. This makes sense when you think about it -- you don't want your sister, or co-worker, or (more likely) whatever barely-audited application you're installing today, to be able to open that directory. But you probably do want your webserver to be able to open it, especially if you are symlinking to it from `/var/www`.
|
In Linux we open directories by 'executing' them. A directory is an executable that maps part of the file-system for us. Now, by default, the home directory is only executable by its owner. This makes sense when you think about it -- you don't want your sister, or co-worker, or (more likely) whatever barely-audited application you're installing today, to be able to open that directory. But you probably *do* want your webserver to be able to open it, especially if you are symlinking to it from `/var/www` or wherever.
|
||||||
|
|
||||||
[Hugo](https://gohugo.io/) (the framework I'm using to build this blog) likes to deploy to the home directory by default. In fact there are lots of reasons why you'd want to deploy there. I do this exact same thing with [Jenkins](https://jenkins.io), and I wasted an hour troubleshooting this exact same problem when I set up that server too.
|
There are lots of reasons why you'd want to deploy to the home directory of an unprivileged user. I do this exact same thing with [Jenkins](https://jenkins.io), and I wasted an hour troubleshooting this exact same problem when I set up that server too.
|
||||||
|
|
||||||
So, Andrzej of the future (did anyone non-ghoulish win an election yet?), for future reference, let's say you're deploying to `/home/devlog/website`:
|
So, Andrzej of the future (did anyone non-ghoulish win an election yet?), for future reference, let's say you're deploying to `/home/devlog/website`:
|
||||||
|
|
||||||
|
|
|
@ -139,8 +139,8 @@ a:hover {
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
color: var(--rp-text);
|
color: var(--rp-text);
|
||||||
background-color: var(--rp-highlight-high);
|
/* background-color: var(--rp-highlight-high); */
|
||||||
/* background-image: linear-gradient(to bottom, var(--rp-highlight-high), var(--rp-overlay), var(--rp-base)); */
|
background-image: linear-gradient(to bottom, var(--rp-highlight-high) 80%, var(--rp-base));
|
||||||
border-radius: 1rem 1rem 0 0;
|
border-radius: 1rem 1rem 0 0;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
text-shadow: 1px 1px 5px var(--rp-base);
|
text-shadow: 1px 1px 5px var(--rp-base);
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<description><p><strong>I had a bit of an issue with my <a href="https://demos.ajstepien.xyz">website</a> recently.</strong></p>
<p>I pushed some changes incorporating images for the first time (I know &ndash; very swish, very modern), and everything seemed to be working just fine, but when I loaded the production site in Firefox&hellip; the images were not styled. Stranger still, they <em>were</em> styled when I loaded the same page in Chrome.</p>
<p>The experienced computer touchers amongst you will be saying &ldquo;this is obviously a cache problem&rdquo;, and you&rsquo;re right, it is obviously a cache problem. Pressing <code>CTR + SHIFT + R</code> (which forces Firefox to clear the cache and do a full reload) proved this thesis, and solved the immediate problem for me, on my machine. But what about other people&rsquo;s machines? <strong>I needed to cache-bust.</strong></p></description>
|
<description><p><strong>I had a bit of an issue with my <a href="https://demos.ajstepien.xyz">website</a> recently.</strong></p>
<p>I pushed some changes incorporating images for the first time (I know &ndash; very swish, very modern), and everything seemed to be working just fine, but when I loaded the production site in Firefox&hellip; the images were not styled. Stranger still, they <em>were</em> styled when I loaded the same page in Chrome.</p>
<p>The experienced computer touchers amongst you will be saying &ldquo;this is obviously a cache problem&rdquo;, and you&rsquo;re right, it is obviously a cache problem. Pressing <code>CTR + SHIFT + R</code> (which forces Firefox to clear the cache and do a full reload) proved this thesis, and solved the immediate problem for me, on my machine. But what about other people&rsquo;s machines? <strong>I needed to cache-bust.</strong></p></description>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<title>Permissions Strike Again</title>
|
<title>Permissions strike again</title>
|
||||||
<link>http://localhost:1313/posts/permissions-strike-again/</link>
|
<link>http://localhost:1313/posts/permissions-strike-again/</link>
|
||||||
<pubDate>Wed, 13 Nov 2024 11:53:13 +0100</pubDate>
|
<pubDate>Wed, 13 Nov 2024 11:53:13 +0100</pubDate>
|
||||||
<guid>http://localhost:1313/posts/permissions-strike-again/</guid>
|
<guid>http://localhost:1313/posts/permissions-strike-again/</guid>
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<h2 class="center"><a href="/posts/permissions-strike-again/">Permissions Strike Again</a></h2>
|
<h2 class="center"><a href="/posts/permissions-strike-again/">Permissions strike again</a></h2>
|
||||||
<p>Configuring Apache really isn’t rocket science. There are a wealth of great tutorials online, the documentation is very well documented, and the defaults work more or less out of the box. But it’s one of those jobs that I do just infrequently enough that I always forget things in the interim, and end up making the same old mistakes.</p>
|
<p>Configuring Apache really isn’t rocket science. There are a wealth of great tutorials online, the documentation is very well documented, and the defaults work more or less out of the box. But it’s one of those jobs that I do just infrequently enough that I always forget things in the interim, and end up making the same old mistakes.</p>
|
||||||
<p><em><strong>And it almost always has to do with permissions.</strong></em></p>
|
<p><em><strong>And it almost always has to do with permissions.</strong></em></p>
|
||||||
<p>So, I’m writing this post both as a means of christening this devlog (<a href="https://demos.ajstepien.xyz">Hi! I’m Andrzej! Hire me!</a>) and also as a reminder to myself that <em>the home folder is not executable by default.</em></p>
|
<p>So, I’m writing this post both as a means of christening this devlog (<a href="https://demos.ajstepien.xyz">Hi! I’m Andrzej! Hire me!</a>) and also as a reminder to myself that <em>the home folder is not executable by default.</em></p>
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<description><p><strong>I had a bit of an issue with my <a href="https://demos.ajstepien.xyz">website</a> recently.</strong></p>
<p>I pushed some changes incorporating images for the first time (I know &ndash; very swish, very modern), and everything seemed to be working just fine, but when I loaded the production site in Firefox&hellip; the images were not styled. Stranger still, they <em>were</em> styled when I loaded the same page in Chrome.</p>
<p>The experienced computer touchers amongst you will be saying &ldquo;this is obviously a cache problem&rdquo;, and you&rsquo;re right, it is obviously a cache problem. Pressing <code>CTR + SHIFT + R</code> (which forces Firefox to clear the cache and do a full reload) proved this thesis, and solved the immediate problem for me, on my machine. But what about other people&rsquo;s machines? <strong>I needed to cache-bust.</strong></p></description>
|
<description><p><strong>I had a bit of an issue with my <a href="https://demos.ajstepien.xyz">website</a> recently.</strong></p>
<p>I pushed some changes incorporating images for the first time (I know &ndash; very swish, very modern), and everything seemed to be working just fine, but when I loaded the production site in Firefox&hellip; the images were not styled. Stranger still, they <em>were</em> styled when I loaded the same page in Chrome.</p>
<p>The experienced computer touchers amongst you will be saying &ldquo;this is obviously a cache problem&rdquo;, and you&rsquo;re right, it is obviously a cache problem. Pressing <code>CTR + SHIFT + R</code> (which forces Firefox to clear the cache and do a full reload) proved this thesis, and solved the immediate problem for me, on my machine. But what about other people&rsquo;s machines? <strong>I needed to cache-bust.</strong></p></description>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<title>Permissions Strike Again</title>
|
<title>Permissions strike again</title>
|
||||||
<link>http://localhost:1313/posts/permissions-strike-again/</link>
|
<link>http://localhost:1313/posts/permissions-strike-again/</link>
|
||||||
<pubDate>Wed, 13 Nov 2024 11:53:13 +0100</pubDate>
|
<pubDate>Wed, 13 Nov 2024 11:53:13 +0100</pubDate>
|
||||||
<guid>http://localhost:1313/posts/permissions-strike-again/</guid>
|
<guid>http://localhost:1313/posts/permissions-strike-again/</guid>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width" />
|
<meta name="viewport" content="width=device-width" />
|
||||||
<title>
|
<title>
|
||||||
Permissions Strike Again | Coding with Andrzej
|
Permissions strike again | Coding with Andrzej
|
||||||
</title>
|
</title>
|
||||||
|
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
<main>
|
<main>
|
||||||
|
|
||||||
|
|
||||||
<h1>Permissions Strike Again</h1>
|
<h1>Permissions strike again</h1>
|
||||||
|
|
||||||
<time datetime="2024-11-13T11:53:13+01:00">November 13, 2024</time>
|
<time datetime="2024-11-13T11:53:13+01:00">November 13, 2024</time>
|
||||||
|
|
||||||
|
@ -59,8 +59,8 @@
|
||||||
<p>So, I’m writing this post both as a means of christening this devlog (<a href="https://demos.ajstepien.xyz">Hi! I’m Andrzej! Hire me!</a>) and also as a reminder to myself that <em>the home folder is not executable by default.</em></p>
|
<p>So, I’m writing this post both as a means of christening this devlog (<a href="https://demos.ajstepien.xyz">Hi! I’m Andrzej! Hire me!</a>) and also as a reminder to myself that <em>the home folder is not executable by default.</em></p>
|
||||||
<p>Please, Andrzej. Please. The next time you’re building a website, be it for a client or for yourself, and you find yourself scratching your head, wondering what error you may have made in the <code>.confs</code>, checking the permissions of your symlink again and again, ask yourself: is my symlink pointing to a directory in the home folder? Because Apache can’t open the home folder until you change the permissions!</p>
|
<p>Please, Andrzej. Please. The next time you’re building a website, be it for a client or for yourself, and you find yourself scratching your head, wondering what error you may have made in the <code>.confs</code>, checking the permissions of your symlink again and again, ask yourself: is my symlink pointing to a directory in the home folder? Because Apache can’t open the home folder until you change the permissions!</p>
|
||||||
<h2 id="what">What?</h2>
|
<h2 id="what">What?</h2>
|
||||||
<p>In Linux we open directories by ’executing’ them. A directory is an executable that lists part of file-system for us, basically. Now, by default, the home directory is only executable by its owner. This makes sense when you think about it – you don’t want your sister, or co-worker, or (more likely) whatever barely-audited application you’re installing today, to be able to open that directory. But you probably do want your webserver to be able to open it, especially if you are symlinking to it from <code>/var/www</code>.</p>
|
<p>In Linux we open directories by ’executing’ them. A directory is an executable that maps part of the file-system for us. Now, by default, the home directory is only executable by its owner. This makes sense when you think about it – you don’t want your sister, or co-worker, or (more likely) whatever barely-audited application you’re installing today, to be able to open that directory. But you probably <em>do</em> want your webserver to be able to open it, especially if you are symlinking to it from <code>/var/www</code> or wherever.</p>
|
||||||
<p><a href="https://gohugo.io/">Hugo</a> (the framework I’m using to build this blog) likes to deploy to the home directory by default. In fact there are lots of reasons why you’d want to deploy there. I do this exact same thing with <a href="https://jenkins.io">Jenkins</a>, and I wasted an hour troubleshooting this exact same problem when I set up that server too.</p>
|
<p>There are lots of reasons why you’d want to deploy to the home directory of an unprivileged user. I do this exact same thing with <a href="https://jenkins.io">Jenkins</a>, and I wasted an hour troubleshooting this exact same problem when I set up that server too.</p>
|
||||||
<p>So, Andrzej of the future (did anyone non-ghoulish win an election yet?), for future reference, let’s say you’re deploying to <code>/home/devlog/website</code>:</p>
|
<p>So, Andrzej of the future (did anyone non-ghoulish win an election yet?), for future reference, let’s say you’re deploying to <code>/home/devlog/website</code>:</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>Add Apache to the ‘devlog’ user group.</li>
|
<li>Add Apache to the ‘devlog’ user group.</li>
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<h2 class="center"><a href="/posts/permissions-strike-again/">Permissions Strike Again</a></h2>
|
<h2 class="center"><a href="/posts/permissions-strike-again/">Permissions strike again</a></h2>
|
||||||
<p>Configuring Apache really isn’t rocket science. There are a wealth of great tutorials online, the documentation is very well documented, and the defaults work more or less out of the box. But it’s one of those jobs that I do just infrequently enough that I always forget things in the interim, and end up making the same old mistakes.</p>
|
<p>Configuring Apache really isn’t rocket science. There are a wealth of great tutorials online, the documentation is very well documented, and the defaults work more or less out of the box. But it’s one of those jobs that I do just infrequently enough that I always forget things in the interim, and end up making the same old mistakes.</p>
|
||||||
<p><em><strong>And it almost always has to do with permissions.</strong></em></p>
|
<p><em><strong>And it almost always has to do with permissions.</strong></em></p>
|
||||||
<p>So, I’m writing this post both as a means of christening this devlog (<a href="https://demos.ajstepien.xyz">Hi! I’m Andrzej! Hire me!</a>) and also as a reminder to myself that <em>the home folder is not executable by default.</em></p>
|
<p>So, I’m writing this post both as a means of christening this devlog (<a href="https://demos.ajstepien.xyz">Hi! I’m Andrzej! Hire me!</a>) and also as a reminder to myself that <em>the home folder is not executable by default.</em></p>
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<description><p><strong>I had a bit of an issue with my <a href="https://demos.ajstepien.xyz">website</a> recently.</strong></p>
<p>I pushed some changes incorporating images for the first time (I know &ndash; very swish, very modern), and everything seemed to be working just fine, but when I loaded the production site in Firefox&hellip; the images were not styled. Stranger still, they <em>were</em> styled when I loaded the same page in Chrome.</p>
<p>The experienced computer touchers amongst you will be saying &ldquo;this is obviously a cache problem&rdquo;, and you&rsquo;re right, it is obviously a cache problem. Pressing <code>CTR + SHIFT + R</code> (which forces Firefox to clear the cache and do a full reload) proved this thesis, and solved the immediate problem for me, on my machine. But what about other people&rsquo;s machines? <strong>I needed to cache-bust.</strong></p></description>
|
<description><p><strong>I had a bit of an issue with my <a href="https://demos.ajstepien.xyz">website</a> recently.</strong></p>
<p>I pushed some changes incorporating images for the first time (I know &ndash; very swish, very modern), and everything seemed to be working just fine, but when I loaded the production site in Firefox&hellip; the images were not styled. Stranger still, they <em>were</em> styled when I loaded the same page in Chrome.</p>
<p>The experienced computer touchers amongst you will be saying &ldquo;this is obviously a cache problem&rdquo;, and you&rsquo;re right, it is obviously a cache problem. Pressing <code>CTR + SHIFT + R</code> (which forces Firefox to clear the cache and do a full reload) proved this thesis, and solved the immediate problem for me, on my machine. But what about other people&rsquo;s machines? <strong>I needed to cache-bust.</strong></p></description>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<title>Permissions Strike Again</title>
|
<title>Permissions strike again</title>
|
||||||
<link>http://localhost:1313/posts/permissions-strike-again/</link>
|
<link>http://localhost:1313/posts/permissions-strike-again/</link>
|
||||||
<pubDate>Wed, 13 Nov 2024 11:53:13 +0100</pubDate>
|
<pubDate>Wed, 13 Nov 2024 11:53:13 +0100</pubDate>
|
||||||
<guid>http://localhost:1313/posts/permissions-strike-again/</guid>
|
<guid>http://localhost:1313/posts/permissions-strike-again/</guid>
|
||||||
|
|
|
@ -139,8 +139,8 @@ a:hover {
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
color: var(--rp-text);
|
color: var(--rp-text);
|
||||||
background-color: var(--rp-highlight-high);
|
/* background-color: var(--rp-highlight-high); */
|
||||||
/* background-image: linear-gradient(to bottom, var(--rp-highlight-high), var(--rp-overlay), var(--rp-base)); */
|
background-image: linear-gradient(to bottom, var(--rp-highlight-high) 80%, var(--rp-base));
|
||||||
border-radius: 1rem 1rem 0 0;
|
border-radius: 1rem 1rem 0 0;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
text-shadow: 1px 1px 5px var(--rp-base);
|
text-shadow: 1px 1px 5px var(--rp-base);
|
||||||
|
|
Loading…
Reference in New Issue