<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body bgcolor=white lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Sorry I couldn’t be more help.  I know I’ve done it in
public_html where I’ve (over 10 years ago) created a java tetris game, then allowed
it to save high scores on the server (pretty simplistic perl cgi script).  I
think it was a matter of giving ‘user’ ownership to the directory, and giving ‘group’
ownership of the directory to the apache group.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Rob<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:
"Tahoma","sans-serif";color:windowtext'> lilug-bounces@lilug.org
[mailto:lilug-bounces@lilug.org] <b>On Behalf Of </b>Kenneth Downs<br>
<b>Sent:</b> Thursday, February 26, 2009 10:13 AM<br>
<b>To:</b> LILUG Mailing List<br>
<b>Subject:</b> Re: [Lilug] Still stuck on file permissions<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal>Robert Wilkens wrote: <o:p></o:p></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>This probably _<i>Doesn’t</i>_ give you the answer you were
looking for…  But is an option for the development machine to work on
files in the public_html directory of the users home dir, then access (for
development purposes) the files as if they were in <a
href="http://localhost/%7Eusername">http://localhost/~username</a> work?</span><o:p></o:p></p>

<p class=MsoNormal><br>
Yeah, that's where I've got them, but in order for apache to write generated
files, it still needs full perms.  Turns out to be the same whether they
are in ~/public_html or /var/www<br>
<br>
<br>
<o:p></o:p></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'> </span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I mean, I think you can still do this with apache, but I haven’t
used it in forever.</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'> </span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Rob</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'> </span><o:p></o:p></p>

<div style='border:none;border-left:solid windowtext 1.5pt;padding:0in 0in 0in 4.0pt;
border-color:-moz-use-text-color -moz-use-text-color -moz-use-text-color blue'>

<div>

<div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;
border-color:-moz-use-text-color -moz-use-text-color'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:
"Tahoma","sans-serif";color:windowtext'> <a
href="mailto:lilug-bounces@lilug.org">lilug-bounces@lilug.org</a> [<a
href="mailto:lilug-bounces@lilug.org">mailto:lilug-bounces@lilug.org</a>] <b>On
Behalf Of </b>Kenneth Downs<br>
<b>Sent:</b> Thursday, February 26, 2009 9:47 AM<br>
<b>To:</b> LILUG Mailing List<br>
<b>Subject:</b> [Lilug] Still stuck on file permissions</span><o:p></o:p></p>

</div>

</div>

<p class=MsoNormal> <o:p></o:p></p>

<p class=MsoNormal>I've complained about this before, but I'm still hoping
somebody can tell me something I don't know.<br>
<br>
I'll skip the details and just say the situation is that a programmer is
developing a web app, but the web app also does code generation, so the
programmer (a regular linux user) must have full control over the files, but
the apache process (www-data on ubuntu) must also have full control.<br>
<br>
This is only on a dev workstation, the situation can be avoided on a production
server but not on a dev workstation.<br>
<br>
Here is the question: It seems to me that everything about Linux is set up to
prevent this from happening without major interventions that a newer Linux user
will not understand and a veteran will consider inappropriate.  Am I
missing something?  Is there a simple way to give two users full control
over a body of files?  Don't just say "groups" automatically,
see below:<br>
<br>
METHOD 1: <br>
<br>
1) Add the programmer's user account to the www-data group (veterans may
object, newbies may stumble)<br>
2) Put perms to 6770 on the file tree<br>
3) Set ownership to <user>:www-data on the file tree<br>
<br>
This is what I am doing now.  Believe it or not this is as simple as I
could figure it, but I'm shooting for simpler.<br>
<br>
METHOD 2:<br>
<br>
This gives the veterans fits, but I figured <i>on a dev workstation</i> I would
just run apache as my account.  This is <i>more invasive</i>, but <i>only
at a single point</i>.  At this point the veterans jump in with
"never, never, never" but don't usually address the context of the
situation, so I don't know what to do with their advice.  <br>
<br>
<br>
METHOD 3:<br>
<br>
Complex ACL's.  There seems to be on-off support for more complex file
permissions in Linux, but I get the sense it is a red-headed stepchild. 
If there were a more powerful permissions system that understood the idea of
giving two separate users the same permissions, I'd be very happy to accept a <i>configurable
dependency</i>, but I don't get the idea that's out there.<br>
<br>
So I'm really hoping I missed something in the last 10 years on how linux
controls file permission :(<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<o:p></o:p></p>

<pre>-- <o:p></o:p></pre><pre>Kenneth Downs<o:p></o:p></pre><pre>Secure Data Software<o:p></o:p></pre><pre><a
href="mailto:ken@secdat.com">ken@secdat.com</a>  <a
href="http://www.andromeda-project.org">www.andromeda-project.org</a> <a
href="http://www.secdat.com">www.secdat.com</a><o:p></o:p></pre><pre>Office: 631-689-7200<o:p></o:p></pre><pre>Cell: 631-379-0010<o:p></o:p></pre><pre>Fax: 631-689-0527<o:p></o:p></pre></div>

<pre><o:p> </o:p></pre><pre style='text-align:center'>

<hr size=4 width="90%" align=center>

</pre><pre><o:p> </o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>Lilug mailing list<o:p></o:p></pre><pre><a
href="mailto:Lilug@lilug.org">Lilug@lilug.org</a><o:p></o:p></pre><pre><a
href="http://lists.lilug.org/listinfo.cgi/lilug-lilug.org">http://lists.lilug.org/listinfo.cgi/lilug-lilug.org</a><o:p></o:p></pre><pre>  <o:p></o:p></pre>

<p class=MsoNormal><br>
<br>
<br>
<o:p></o:p></p>

<pre>-- <o:p></o:p></pre><pre>Kenneth Downs<o:p></o:p></pre><pre>Secure Data Software<o:p></o:p></pre><pre><a
href="mailto:ken@secdat.com">ken@secdat.com</a>  <a
href="http://www.andromeda-project.org">www.andromeda-project.org</a> <a
href="http://www.secdat.com">www.secdat.com</a><o:p></o:p></pre><pre>Office: 631-689-7200<o:p></o:p></pre><pre>Cell: 631-379-0010<o:p></o:p></pre><pre>Fax: 631-689-0527<o:p></o:p></pre></div>

</div>

</body>

</html>