Sounds like some sort of configuration problem. I can't believe you're the
first person on BSD that's tried to generate a PHP webpage as root.

​If you want to run weewx as a non-root user, there are instructions in the
Wiki, but they are Debian-centric. *Run as a non-root user.
<https://github.com/weewx/weewx/wiki/Run%20as%20a%20non%20root%20user>*

Seems like you have three choices:

   1. Hunt around for some PHP setting that controls whether it will
   execute a page owned by root.
   2. Change the ownership of the needed /var/run files to user weewx.
   3. Or, use the setup.py install method and give ownership of /home/weewx
   to user weewx. Then have your webserver serve pages out of there.


-tk​

On Sat, Sep 10, 2016 at 6:04 PM, Jim J <[email protected]> wrote:

> I have some embedded php script in my "index" file, so I changed it from
> index.html.tmpl to index.php.tmpl.
>
> That seems to work fine, but the problem is when Weewx produces the files
> (for the webpage), it makes the owner/group as root/root.
> The webpage will not display if the index's file owner is root.   I tested
> by manually changing the owner to "weewx" (a user I created) and the
> webpages displays correctly.
>
> I run the software by using the "weewx.bsd" script (included with the
> weewx installation).
>
> This is the script that launches weewx (that I'm using)
>
> sudo python ${WEEWX_BIN} ${WEEWX_CFG} --daemon &
> echo $! > ${PIDFILE}
>
> I tried.
>
> sudo -u weewx python ${WEEWX_BIN} ${WEEWX_CFG} --daemon &
> echo $!> ${PIDFILE]
>
> However I get a an error since /var/run are root files only, and I'm
> trying to run weewx as user weewx.
>
> In short, I'm thinking if I run weewx as user - weewx then, the files it
> produces (i.e. index.php, year.php, etc) will be under the user weewx as
> well.
>
> Any suggestions would be appreciated.
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to