[HCoop-Help] Help please with running my own apache.

Clinton Ebadi clinton at unknownlamer.org
Sat Jul 6 16:51:27 EDT 2019

Matthew Smith <dogman at unifone.net.nz> writes:

> At this point I have two more questions:
> 1. How do I change my domtool config to serve my app at mydomain as
> well as www.mydomain. Currently I have the config suggested on the
> ancient "running you own apache" page, namely:
>> mds at marsh:~$ cat .domtool/bdn-nz
>> dom "barkingdognatives.nz" where
>>     PhpVersion = php56;
>> with
>>   web "www" with
>>     proxyPass "/" "http://marsh:50100/";
>>     proxyPassReverse "/" "http://marsh:50100/";
>>   end;
>> end;
> I made some effort with the domtool docs but it  still wasn't clear
> what to do.

This should work:

dom "barkingdognatives.nz" where
    PhpVersion = php56;
    WWW = begin
      proxyPass "/" "http://marsh:50100/";
      proxyPassReverse "/" "http://marsh:50100/";

By default, the `dom' injects the value of the WWW environment variable
into a subdomain "www" and sets it as the
`serverAliasDefault'. /afs/hcoop.net/common/etc/domtool/lib/easy_domain.dtl
shows exactly what it does if you want to get a better idea of how it
works under the hood.

> 2. How would I have gunicorn persist after logout? I seem to be able
> do this by just appending '&' to the command line, but something tells
> me there is a better way.

You will want to use k5start to obtain and manage $USER.daemon tokens,
and use an @reboot cron job to spawn the process if the shell server
reboots (it does happen occasionally when kernel upgrades are required
for security).

https://wiki.hcoop.net/RunningUnattendedCommandsWithoutRunInPagsh gives
a general idea, what I do for my tt-rss daemon for example is:

  @reboot k5start -bqtUf /etc/keytabs/user.daemon/clinton -- \

Just replace clinton with your username, and everything after the `--'
with your script and any arguments. k5start handles backgrounding and
renews tokens as needed indefinitely.

There isn't any process management beyond that currently; if you need
anything more advanced it should be possible to run supervisord as your
user (I eventually want to make a set of tools for easily managing
processes using supervisord + k5start, but that is way behind upgrading
to Debian Buster and getting letsencrypt integrated on the todo

More information about the HCoop-Help mailing list