<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Www on bramp.net</title>
    <link>https://blog.bramp.net/</link>
    <description>Recent content in Www on bramp.net</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-GB</language>
    <lastBuildDate>Wed, 21 Jan 2009 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://blog.bramp.net/tags/www/" rel="self" type="application/rss+xml" />
    
    <item>
      <title>Read/Write permissions for PHP scripts at lancs.ac.uk</title>
      <link>https://blog.bramp.net/post/2009/01/21/read-write-permissions-for-php-scripts-at-lancs.ac.uk/</link>
      <pubDate>Wed, 21 Jan 2009 00:00:00 +0000</pubDate>
      
      <guid>https://blog.bramp.net/post/2009/01/21/read-write-permissions-for-php-scripts-at-lancs.ac.uk/</guid>
      <description><p>My girlfriend wanted to create a blog, and she attempted to use her <a href="http://www.lancs.ac.uk/ug/cranen">university provided web space</a>. However, the blog software seemed unable to write to her webspace. Typically you would fix this by changing the write permissions on the file/directory like so:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">chmod g+w filename
</span></span></code></pre></div><p>or</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">chmod o+w filename
</span></span></code></pre></div><p>However this did not seem to work. I noticed that the files which hosted the website were on a SunOS 5.8 machine, and this seemed to support access control lists (ACLs). So I looked at a few of the ACLs for the files and they looked like this:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ getfacl filename
</span></span><span class="line"><span class="cl">user::rwx
</span></span><span class="line"><span class="cl">group::rwx              <span class="c1">#effective:rwx</span>
</span></span><span class="line"><span class="cl">group:httpadmin:rwx     <span class="c1">#effective:rwx</span>
</span></span><span class="line"><span class="cl">mask:rwx
</span></span><span class="line"><span class="cl">other:r--
</span></span></code></pre></div><p>Since there is the group:httpadmin line, ISS are clearly using these ACLs. So I figured I would add the user the webserver is running under to the ACL. A quick look at a phpinfo() page showed me that the web server is running under user www in group www. So I first tried the following:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">setfacl -m user:www:rw- filename
</span></span></code></pre></div><p>But that oddly didn’t work, but then I noted that the webserver was a linux machine, not SunOS, and that the UID of www was 48. A quick look at the UID of www on SunOS and it shows it is a completely different number. So for what ever reason ISS were unable to make the UIDs match between computers, so the correct command to type is:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">setfacl -m user:48:rw- filename
</span></span></code></pre></div><p>Bottom line, if you wish to make your files or directories writable by scripts running on the webserver you must log into cent1 (via ssh), change to your www directory “/home/cent1/NN/username/www/public_html” and then issue the above command to the appropriate files.</p>
</description>
    </item>
    
  </channel>
</rss>
