unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* Setup woes
@ 2021-02-23 15:42 Uwe Kleine-König
  2021-02-23 20:01 ` Eric Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2021-02-23 15:42 UTC (permalink / raw)
  To: meta

[-- Attachment #1: Type: text/plain, Size: 2398 bytes --]

Hello,

I'm currently (again) trying to setup a public-inbox instance and have
two problems:

 1) Import of older mails
    I used Konstantin Ryabitsev script[1] to generate a directory of
    mbob files. It's unclear to me how to easily import that into the
    archive. Not knowing a better way, I'd put them all in a Maildir and
    use public-inbox-watch to import them. Is there a nicer way?

 2) Apache configuration
    I was able to setup Apache to serve individual archives but I fail
    to get a list listing at the root. That is I can access the barebox
    archive at http://lore.pengutronix.de/barebox/, but not the overview
    of the archived lists at http://lore.pengutronix.de/.

	$ curl -D - http://lore.pengutronix.de/
	HTTP/1.1 404 Not Found
	Date: Tue, 23 Feb 2021 15:31:54 GMT
	Server: Apache/2.4.38 (Debian)
	Expires: Fri, 01 Jan 1980 00:00:00 GMT
	Pragma: no-cache
	Cache-Control: no-cache, max-age=0, must-revalidate
	Content-Length: 9
	Content-Type: text/plain

	Not Found

    The Apache config looks as follows:

	<VirtualHost *:80>
		ServerName lore.pengutronix.de

		ServerAdmin webmaster@localhost
		DocumentRoot /srv/www/lore.pengutronix.de/root

		<Directory "/srv/www/lore.pengutronix.de/root">
			AllowOverride None
			Require all granted
		</Directory>

		LogLevel debug

		ErrorLog ${APACHE_LOG_DIR}/error.log
		CustomLog ${APACHE_LOG_DIR}/access.log combined

		Include conf-available/serve-cgi-bin.conf
		Include mods-available/rewrite.load
		SetEnv PI_DIR /home/lore/.public-inbox
		SetEnv NO_SCRIPT_NAME 1

		Options +ExecCGI
		ScriptAlias /public-inbox.cgi "/usr/lib/cgi-bin/public-inbox.cgi"

		DirectoryIndex public-inbox.cgi
		RewriteEngine On
		RewriteCond %{REQUEST_FILENAME} !-f
		RewriteCond %{REQUEST_FILENAME} !-d
		RewriteRule ^.* /public-inbox.cgi/$0 [L,PT]

	</VirtualHost>

     My guess is that the "SetEnv NO_SCRIPT_NAME 1" part doesn't work as
     expected, but after some searching in the net I didn't find how to
     do this properly.

Any hints are welcome

Best regards and thanks in advance
Uwe

[1] https://git.kernel.org/pub/scm/linux/kernel/git/mricon/korg-helpers.git/plain/list-archive-maker.py

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Setup woes
  2021-02-23 15:42 Setup woes Uwe Kleine-König
@ 2021-02-23 20:01 ` Eric Wong
  2021-02-23 21:31   ` Uwe Kleine-König
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Wong @ 2021-02-23 20:01 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: meta

Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:
> Hello,
> 
> I'm currently (again) trying to setup a public-inbox instance and have
> two problems:
> 
>  1) Import of older mails
>     I used Konstantin Ryabitsev script[1] to generate a directory of
>     mbob files. It's unclear to me how to easily import that into the
>     archive. Not knowing a better way, I'd put them all in a Maildir and
>     use public-inbox-watch to import them. Is there a nicer way?

scripts/import_vger_from_mbox is probably the best maintained
of the stuff in scripts for mass imports (it supports v2, unlike
the rest of scripts/).

I will work on making -watch faster (and modeled after lei
internals) once lei is farther along in public-inbox.git...

import_maildir is v1, only, atm; but some of the stuff developed
for lei can make it easier to maintain going foward.

>  2) Apache configuration
>     I was able to setup Apache to serve individual archives but I fail
>     to get a list listing at the root. That is I can access the barebox
>     archive at http://lore.pengutronix.de/barebox/, but not the overview
>     of the archived lists at http://lore.pengutronix.de/.
> 
> 	$ curl -D - http://lore.pengutronix.de/
> 	HTTP/1.1 404 Not Found
> 	Date: Tue, 23 Feb 2021 15:31:54 GMT
> 	Server: Apache/2.4.38 (Debian)
> 	Expires: Fri, 01 Jan 1980 00:00:00 GMT
> 	Pragma: no-cache
> 	Cache-Control: no-cache, max-age=0, must-revalidate
> 	Content-Length: 9
> 	Content-Type: text/plain
> 
> 	Not Found

You might need to configure publicinbox.wwwlisting to
"all" or match=domain".  See publicinbox.wwwlisting in
public-inbox-config(5).

The default behavior is to 404 since the listing is a
fairly recent addition.

>     The Apache config looks as follows:
> 
> 	<VirtualHost *:80>
> 		ServerName lore.pengutronix.de
> 
> 		ServerAdmin webmaster@localhost
> 		DocumentRoot /srv/www/lore.pengutronix.de/root
> 
> 		<Directory "/srv/www/lore.pengutronix.de/root">
> 			AllowOverride None
> 			Require all granted
> 		</Directory>
> 
> 		LogLevel debug
> 
> 		ErrorLog ${APACHE_LOG_DIR}/error.log
> 		CustomLog ${APACHE_LOG_DIR}/access.log combined
> 
> 		Include conf-available/serve-cgi-bin.conf
> 		Include mods-available/rewrite.load
> 		SetEnv PI_DIR /home/lore/.public-inbox
> 		SetEnv NO_SCRIPT_NAME 1
> 
> 		Options +ExecCGI
> 		ScriptAlias /public-inbox.cgi "/usr/lib/cgi-bin/public-inbox.cgi"
> 
> 		DirectoryIndex public-inbox.cgi
> 		RewriteEngine On
> 		RewriteCond %{REQUEST_FILENAME} !-f
> 		RewriteCond %{REQUEST_FILENAME} !-d

Perhaps it's the -d check?  I haven't tested WwwListing with
Apache.

> 		RewriteRule ^.* /public-inbox.cgi/$0 [L,PT]
> 
> 	</VirtualHost>
> 
>      My guess is that the "SetEnv NO_SCRIPT_NAME 1" part doesn't work as
>      expected, but after some searching in the net I didn't find how to
>      do this properly.

Not sure, I haven't used Apache in ages and some of the configs
in examples/ are likely out-of-date and never tested with
WwwListing.

If you're not using public-inbox-httpd; then I strongly suggest
using at least mod_perl (and not plain CGI) since Perl startup
time is atrocious.

If you're dealing with large inboxes and supporting smart HTTP
clone/fetch, then use public-inbox-httpd (which works with
varnish, mod_proxy, or any other front-end proxy).

public-inbox-httpd can throttle CPU/memory intensive tasks
(e.g. git-http-backend, cgit) independently of other work
(the "limiter" stuff in public-inbox-config(5)).

As of public-inbox 1.6, -httpd also does git blob retrievals
around 20% faster on /T/, /t/ and t.mbox.gz requests and
decouples high-latency HDD from network ops.

> Any hints are welcome
> 
> Best regards and thanks in advance
> Uwe
> 
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/mricon/korg-helpers.git/plain/list-archive-maker.py

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Setup woes
  2021-02-23 20:01 ` Eric Wong
@ 2021-02-23 21:31   ` Uwe Kleine-König
  2021-02-23 22:11     ` Eric Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2021-02-23 21:31 UTC (permalink / raw)
  To: Eric Wong; +Cc: meta

[-- Attachment #1: Type: text/plain, Size: 5536 bytes --]

Hello Eric,

On Tue, Feb 23, 2021 at 08:01:24PM +0000, Eric Wong wrote:
> Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:
> >  1) Import of older mails
> >     I used Konstantin Ryabitsev script[1] to generate a directory of
> >     mbob files. It's unclear to me how to easily import that into the
> >     archive. Not knowing a better way, I'd put them all in a Maildir and
> >     use public-inbox-watch to import them. Is there a nicer way?
> 
> scripts/import_vger_from_mbox is probably the best maintained
> of the stuff in scripts for mass imports (it supports v2, unlike
> the rest of scripts/).

Ah, this worked great. I missed these scripts because they are not
included in my public-inbox.deb.

> >  2) Apache configuration
> >     I was able to setup Apache to serve individual archives but I fail
> >     to get a list listing at the root. That is I can access the barebox
> >     archive at http://lore.pengutronix.de/barebox/, but not the overview
> >     of the archived lists at http://lore.pengutronix.de/.
> > 
> > 	$ curl -D - http://lore.pengutronix.de/
> > 	HTTP/1.1 404 Not Found
> > 	Date: Tue, 23 Feb 2021 15:31:54 GMT
> > 	Server: Apache/2.4.38 (Debian)
> > 	Expires: Fri, 01 Jan 1980 00:00:00 GMT
> > 	Pragma: no-cache
> > 	Cache-Control: no-cache, max-age=0, must-revalidate
> > 	Content-Length: 9
> > 	Content-Type: text/plain
> > 
> > 	Not Found
> 
> You might need to configure publicinbox.wwwlisting to
> "all" or match=domain".  See publicinbox.wwwlisting in
> public-inbox-config(5).

I have this, with public-inbox-httpd I get a listing.

> The default behavior is to 404 since the listing is a
> fairly recent addition.
> 
> >     The Apache config looks as follows:
> > 
> > 	<VirtualHost *:80>
> > 		ServerName lore.pengutronix.de
> > 
> > 		ServerAdmin webmaster@localhost
> > 		DocumentRoot /srv/www/lore.pengutronix.de/root
> > 
> > 		<Directory "/srv/www/lore.pengutronix.de/root">
> > 			AllowOverride None
> > 			Require all granted
> > 		</Directory>
> > 
> > 		LogLevel debug
> > 
> > 		ErrorLog ${APACHE_LOG_DIR}/error.log
> > 		CustomLog ${APACHE_LOG_DIR}/access.log combined
> > 
> > 		Include conf-available/serve-cgi-bin.conf
> > 		Include mods-available/rewrite.load
> > 		SetEnv PI_DIR /home/lore/.public-inbox
> > 		SetEnv NO_SCRIPT_NAME 1
> > 
> > 		Options +ExecCGI
> > 		ScriptAlias /public-inbox.cgi "/usr/lib/cgi-bin/public-inbox.cgi"
> > 
> > 		DirectoryIndex public-inbox.cgi
> > 		RewriteEngine On
> > 		RewriteCond %{REQUEST_FILENAME} !-f
> > 		RewriteCond %{REQUEST_FILENAME} !-d
> 
> Perhaps it's the -d check?  I haven't tested WwwListing with
> Apache.

When I drop this I get:

	$ curl http://lore.pengutronix.de/
	<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
	<html><head>
	<title>500 Internal Server Error</title>
	</head><body>
	<h1>Internal Server Error</h1>
	<p>The server encountered an internal error or
	misconfiguration and was unable to complete
	your request.</p>
	<p>Please contact the server administrator at
	 webmaster@localhost to inform them of the time this error occurred,
	 and the actions you performed just before this error.</p>
	<p>More information about this error may be available
	in the server error log.</p>
	<hr>
	<address>Apache/2.4.38 (Debian) Server at lore.pengutronix.de Port 80</address>
	</body></html>

:-)
 
> > 		RewriteRule ^.* /public-inbox.cgi/$0 [L,PT]
> > 
> > 	</VirtualHost>
> > 
> >      My guess is that the "SetEnv NO_SCRIPT_NAME 1" part doesn't work as
> >      expected, but after some searching in the net I didn't find how to
> >      do this properly.
> 
> Not sure, I haven't used Apache in ages and some of the configs
> in examples/ are likely out-of-date and never tested with
> WwwListing.
> 
> If you're not using public-inbox-httpd; then I strongly suggest
> using at least mod_perl (and not plain CGI) since Perl startup
> time is atrocious.

I used CGI because I had the impression this was the easiest to get
running. Also ISTR that this isn't using cgi, but cgid, so the startup
time isn't that relevant.  Will try with mod_perl next, maybe the script
name issue will go away then.

When I debugged that some time ago I saw that /public-inbox.cgi/ is part
of the request URL that is handled in the CGI. Also the footer of the
generated pages has:

	This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.pengutronix.de/public-inbox.cgi/barebox/0 barebox/git/0.git

	...

which is wrong.
 
> If you're dealing with large inboxes and supporting smart HTTP
> clone/fetch, then use public-inbox-httpd (which works with
> varnish, mod_proxy, or any other front-end proxy).

Using Apache was one of the preconditions by the company's admin team,
but I will forward your information once I'm done with the setup and
when I hand over operation of lore.pengutronix.de to them.

> public-inbox-httpd can throttle CPU/memory intensive tasks
> (e.g. git-http-backend, cgit) independently of other work
> (the "limiter" stuff in public-inbox-config(5)).
> 
> As of public-inbox 1.6, -httpd also does git blob retrievals
> around 20% faster on /T/, /t/ and t.mbox.gz requests and
> decouples high-latency HDD from network ops.

Thanks for your valuable input,
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Setup woes
  2021-02-23 21:31   ` Uwe Kleine-König
@ 2021-02-23 22:11     ` Eric Wong
  2021-02-24 10:25       ` Uwe Kleine-König
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Wong @ 2021-02-23 22:11 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: meta

Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:
> Hello Eric,
> 
> On Tue, Feb 23, 2021 at 08:01:24PM +0000, Eric Wong wrote:
> > Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:
> > >  1) Import of older mails
> > >     I used Konstantin Ryabitsev script[1] to generate a directory of
> > >     mbob files. It's unclear to me how to easily import that into the
> > >     archive. Not knowing a better way, I'd put them all in a Maildir and
> > >     use public-inbox-watch to import them. Is there a nicer way?
> > 
> > scripts/import_vger_from_mbox is probably the best maintained
> > of the stuff in scripts for mass imports (it supports v2, unlike
> > the rest of scripts/).
> 
> Ah, this worked great. I missed these scripts because they are not
> included in my public-inbox.deb.

Cool.

> > >  2) Apache configuration
> > >     I was able to setup Apache to serve individual archives but I fail
> > >     to get a list listing at the root. That is I can access the barebox
> > >     archive at http://lore.pengutronix.de/barebox/, but not the overview
> > >     of the archived lists at http://lore.pengutronix.de/.
> > > 
> > > 	$ curl -D - http://lore.pengutronix.de/
> > > 	HTTP/1.1 404 Not Found
> > > 	Date: Tue, 23 Feb 2021 15:31:54 GMT
> > > 	Server: Apache/2.4.38 (Debian)
> > > 	Expires: Fri, 01 Jan 1980 00:00:00 GMT
> > > 	Pragma: no-cache
> > > 	Cache-Control: no-cache, max-age=0, must-revalidate
> > > 	Content-Length: 9
> > > 	Content-Type: text/plain
> > > 
> > > 	Not Found
> > 
> > You might need to configure publicinbox.wwwlisting to
> > "all" or match=domain".  See publicinbox.wwwlisting in
> > public-inbox-config(5).
> 
> I have this, with public-inbox-httpd I get a listing.

Alright.  It's good that -httpd alone works.  Then Apache
mod_proxy could be an option.

> > The default behavior is to 404 since the listing is a
> > fairly recent addition.
> > 
> > >     The Apache config looks as follows:
> > > 
> > > 	<VirtualHost *:80>
> > > 		ServerName lore.pengutronix.de
> > > 
> > > 		ServerAdmin webmaster@localhost
> > > 		DocumentRoot /srv/www/lore.pengutronix.de/root
> > > 
> > > 		<Directory "/srv/www/lore.pengutronix.de/root">
> > > 			AllowOverride None
> > > 			Require all granted
> > > 		</Directory>
> > > 
> > > 		LogLevel debug
> > > 
> > > 		ErrorLog ${APACHE_LOG_DIR}/error.log
> > > 		CustomLog ${APACHE_LOG_DIR}/access.log combined
> > > 
> > > 		Include conf-available/serve-cgi-bin.conf
> > > 		Include mods-available/rewrite.load
> > > 		SetEnv PI_DIR /home/lore/.public-inbox
> > > 		SetEnv NO_SCRIPT_NAME 1
> > > 
> > > 		Options +ExecCGI
> > > 		ScriptAlias /public-inbox.cgi "/usr/lib/cgi-bin/public-inbox.cgi"
> > > 
> > > 		DirectoryIndex public-inbox.cgi
> > > 		RewriteEngine On
> > > 		RewriteCond %{REQUEST_FILENAME} !-f
> > > 		RewriteCond %{REQUEST_FILENAME} !-d
> > 
> > Perhaps it's the -d check?  I haven't tested WwwListing with
> > Apache.
> 
> When I drop this I get:
> 
> 	$ curl http://lore.pengutronix.de/
> 	<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> 	<html><head>
> 	<title>500 Internal Server Error</title>
> 	</head><body>
> 	<h1>Internal Server Error</h1>
> 	<p>The server encountered an internal error or
> 	misconfiguration and was unable to complete
> 	your request.</p>
> 	<p>Please contact the server administrator at
> 	 webmaster@localhost to inform them of the time this error occurred,
> 	 and the actions you performed just before this error.</p>
> 	<p>More information about this error may be available
> 	in the server error log.</p>
> 	<hr>
> 	<address>Apache/2.4.38 (Debian) Server at lore.pengutronix.de Port 80</address>
> 	</body></html>
> 
> :-)

No idea, anything in Apache error logs?  I'm far from an Apache
expert.

> > > 		RewriteRule ^.* /public-inbox.cgi/$0 [L,PT]
> > > 
> > > 	</VirtualHost>
> > > 
> > >      My guess is that the "SetEnv NO_SCRIPT_NAME 1" part doesn't work as
> > >      expected, but after some searching in the net I didn't find how to
> > >      do this properly.

Actually, NO_SCRIPT_NAME is no longer used since we switched to Plack
5 years ago in commit 8968889e3ebfa09dd2c80fe8b917b83ac13ff356 (2016-02-25)

The examples for Apache are badly out-of-date :<

> > Not sure, I haven't used Apache in ages and some of the configs
> > in examples/ are likely out-of-date and never tested with
> > WwwListing.
> > 
> > If you're not using public-inbox-httpd; then I strongly suggest
> > using at least mod_perl (and not plain CGI) since Perl startup
> > time is atrocious.
> 
> I used CGI because I had the impression this was the easiest to get
> running. Also ISTR that this isn't using cgi, but cgid, so the startup
> time isn't that relevant.  Will try with mod_perl next, maybe the script
> name issue will go away then.

OK, there's also Plack::Handler::Apache2 (but I don't know it
well, either :x)

> When I debugged that some time ago I saw that /public-inbox.cgi/ is part
> of the request URL that is handled in the CGI. Also the footer of the
> generated pages has:
> 
> 	This inbox may be cloned and mirrored by anyone:
> 
> 	git clone --mirror http://lore.pengutronix.de/public-inbox.cgi/barebox/0 barebox/git/0.git
> 
> 	...
> 
> which is wrong.

*shrug*  If you figure it out, I'd much appreciate patches to
fix examples and docs.  The CGI/Apache stuff is largely ignored
and forgotten since public-inbox-httpd came into existence.

> > If you're dealing with large inboxes and supporting smart HTTP
> > clone/fetch, then use public-inbox-httpd (which works with
> > varnish, mod_proxy, or any other front-end proxy).
> 
> Using Apache was one of the preconditions by the company's admin team,
> but I will forward your information once I'm done with the setup and
> when I hand over operation of lore.pengutronix.de to them.

I understand; is Apache w/ mod_proxy + public-inbox-httpd
acceptable?  You'll probably want varnish or similar in front of
-httpd, as well; in case something ends up at the top of HN,
Slashdot, or whatever link aggregators are in fashion these
days.

I don't remember Apache well at all; I switched to nginx for
reverse proxying in 2006 and then some obscure, Ruby+C thing
in 2013 :>

Fwiw, there'll probably be a combined -httpd/-imapd/-nntpd
server someday, too, which should lead to memory savings.
And transparent caching so Varnish won't be required.

I'll probably drop the obscure Ruby+C thing for
public-inbox-httpd at some point, too; once HTTP reverse proxy
support is implemented; since public-inbox-httpd already
has lightly-tested HTTPS support.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Setup woes
  2021-02-23 22:11     ` Eric Wong
@ 2021-02-24 10:25       ` Uwe Kleine-König
  2021-02-24 11:09         ` Eric Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2021-02-24 10:25 UTC (permalink / raw)
  To: Eric Wong; +Cc: meta

[-- Attachment #1: Type: text/plain, Size: 1875 bytes --]

Hello Eric,

On Tue, Feb 23, 2021 at 10:11:10PM +0000, Eric Wong wrote:
> Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:
> > On Tue, Feb 23, 2021 at 08:01:24PM +0000, Eric Wong wrote:
> > > >     The Apache config looks as follows:
> > > > 
> > > > 	<VirtualHost *:80>
> > > > 		ServerName lore.pengutronix.de
> > > > 
> > > > 		ServerAdmin webmaster@localhost
> > > > 		DocumentRoot /srv/www/lore.pengutronix.de/root
> > > > 
> > > > 		<Directory "/srv/www/lore.pengutronix.de/root">
> > > > 			AllowOverride None
> > > > 			Require all granted
> > > > 		</Directory>
> > > > 
> > > > 		LogLevel debug
> > > > 
> > > > 		ErrorLog ${APACHE_LOG_DIR}/error.log
> > > > 		CustomLog ${APACHE_LOG_DIR}/access.log combined
> > > > 
> > > > 		Include conf-available/serve-cgi-bin.conf
> > > > 		Include mods-available/rewrite.load
> > > > 		SetEnv PI_DIR /home/lore/.public-inbox
> > > > 		SetEnv NO_SCRIPT_NAME 1
> > > > 
> > > > 		Options +ExecCGI
> > > > 		ScriptAlias /public-inbox.cgi "/usr/lib/cgi-bin/public-inbox.cgi"
> > > > 
> > > > 		DirectoryIndex public-inbox.cgi
> > > > 		RewriteEngine On
> > > > 		RewriteCond %{REQUEST_FILENAME} !-f
> > > > 		RewriteCond %{REQUEST_FILENAME} !-d
> > > 
> > > Perhaps it's the -d check?  I haven't tested WwwListing with
> > > Apache.

I scraped the whole rewriting now and use:

        ScriptAlias / "/usr/lib/cgi-bin/public-inbox.cgi/"

which gets rid of the added script name. So all my problems are fixed
now.

However this removes the freedom to put stuff into the document root
that is then served at the matching location. Does that make this
solution unsuitable for the documentation?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Setup woes
  2021-02-24 10:25       ` Uwe Kleine-König
@ 2021-02-24 11:09         ` Eric Wong
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Wong @ 2021-02-24 11:09 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: meta

Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:
> Hello Eric,
> 
> On Tue, Feb 23, 2021 at 10:11:10PM +0000, Eric Wong wrote:
> > Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:
> > > On Tue, Feb 23, 2021 at 08:01:24PM +0000, Eric Wong wrote:
> > > > >     The Apache config looks as follows:
> > > > > 
> > > > > 	<VirtualHost *:80>
> > > > > 		ServerName lore.pengutronix.de
> > > > > 
> > > > > 		ServerAdmin webmaster@localhost
> > > > > 		DocumentRoot /srv/www/lore.pengutronix.de/root
> > > > > 
> > > > > 		<Directory "/srv/www/lore.pengutronix.de/root">
> > > > > 			AllowOverride None
> > > > > 			Require all granted
> > > > > 		</Directory>
> > > > > 
> > > > > 		LogLevel debug
> > > > > 
> > > > > 		ErrorLog ${APACHE_LOG_DIR}/error.log
> > > > > 		CustomLog ${APACHE_LOG_DIR}/access.log combined
> > > > > 
> > > > > 		Include conf-available/serve-cgi-bin.conf
> > > > > 		Include mods-available/rewrite.load
> > > > > 		SetEnv PI_DIR /home/lore/.public-inbox
> > > > > 		SetEnv NO_SCRIPT_NAME 1
> > > > > 
> > > > > 		Options +ExecCGI
> > > > > 		ScriptAlias /public-inbox.cgi "/usr/lib/cgi-bin/public-inbox.cgi"
> > > > > 
> > > > > 		DirectoryIndex public-inbox.cgi
> > > > > 		RewriteEngine On
> > > > > 		RewriteCond %{REQUEST_FILENAME} !-f
> > > > > 		RewriteCond %{REQUEST_FILENAME} !-d
> > > > 
> > > > Perhaps it's the -d check?  I haven't tested WwwListing with
> > > > Apache.
> 
> I scraped the whole rewriting now and use:
> 
>         ScriptAlias / "/usr/lib/cgi-bin/public-inbox.cgi/"
> 
> which gets rid of the added script name. So all my problems are fixed
> now.

Good to know and thanks for the data point.

> However this removes the freedom to put stuff into the document root
> that is then served at the matching location. Does that make this
> solution unsuitable for the documentation?

Yes, it's probably unsuitable...  There really ought to be a way
to fallback to static content.

The static fallback is important if caching solutions (e.g.
varnish) aren't available.  Also, the WwwListing didn't exist
initially since I figured webmasters might want a custom
index.html anyways.

Most of the endpoints end with "/" (e.g. /T/ or /t/), so they're
even easy-to-mirror/fallback with only static webserver
functions.  An admin running without varnish can quickly put up
an index.html for any msgid and serve the static content if a
/$MSGID/, /$MSGID/t/, /$MSGID/T/, /$MSGID/t.mbox.gz endpoint
gets overloaded.

They could even script something to auto-refresh those static
endpoints periodically (but I guess it's much easier to just run
varnish :>)

There might also be other stuff (robots.txt, .well-known/)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-02-24 11:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-23 15:42 Setup woes Uwe Kleine-König
2021-02-23 20:01 ` Eric Wong
2021-02-23 21:31   ` Uwe Kleine-König
2021-02-23 22:11     ` Eric Wong
2021-02-24 10:25       ` Uwe Kleine-König
2021-02-24 11:09         ` Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).