Gentoo Archives: gentoo-user

From: Michael <confabulate@××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] How to set up a website
Date: Thu, 19 Mar 2020 18:36:24
Message-Id: 3292252.iIbC2pHGDl@lenovo.localdomain
In Reply to: Re: [gentoo-user] How to set up a website by "J. Roeleveld"
1 On Thursday, 19 March 2020 17:53:53 GMT J. Roeleveld wrote:
2 > On 19 March 2020 18:19:38 CET, Peter Humphrey <peter@××××××××××××.uk> wrote:
3 > >Hello list,
4 > >
5 > >I want to set up a web server on a local box, and I'm following the
6 > >Gentoo
7 > >guide[1]. I'd like two sites: one under /var/www/localhost and the
8 > >other under
9 > >/var/www/mydomain, in which mydomain is registered to me.
10 > >
11 > >The main problem I'm having is that all the Gentoo documents I've found
12 > >assume
13 > >far too much familiarity with apache. I've installed NextCloud using
14 > >webapp-
15 > >config; this is the layout:
16 > >
17 > >$ tree -L 3 /var/www
18 > >/var/www
19 > >├── localhost
20 > >│ └── htdocs
21 > >│ ├── fcgid-bin
22 > >│ ├── index.orig
23 > >│ └── index.php
24 > >└── mydomain
25 > >
26 > > ├── cgi-bin
27 > > ├── error
28 > > ├── htdocs
29 > > │ ├── cloud
30 > > │ ├── fcgid-bin
31 > > │ ├── index.orig
32 > > │ └── index.php
33 > > └── icons
34 > >
35 > >Is this a suitable layout? Once I get past this I may be asking for
36 > >help with /etc/apache2/vhosts.d/* .
37
38 There is nothing wrong with your layout.
39
40 It is easier to have the webroot of multiple domains hosted under /var/www,
41 each in their respective directory; e.g.
42
43 /var/www/mydomain1/htdocs/
44
45 /var/www/mydomain2/htdocs/
46
47 ...
48
49 /var/www/mydomain-n/htdocs/
50
51 and leave /var/www/localhost/htdocs as the default catch-all apache webpage to
52 be served for testing purposes.
53
54 Then set separate configuration files (/etc/apache2/vhosts.d/* and /etc/
55 apache2/modules.d/*) for each domain, which you can easily clone/copy
56 thereafter.
57
58
59 > Is there a specific reason you are using Apache?
60 > I found it far simpler to use Nginx when dealing with different websites,
61 > incl. seperate SSL certificates per site even though it is 1 server and
62 > public IP.
63 >
64 > --
65 > Joost
66
67 nginx has a smaller footprint and it is faster than apache, especially when
68 serving static websites. I understand NextCloud works with WebDAV and nginx
69 also comes with WebDAV modules to allow this functionality. For low user
70 numbers either will do, but if we're talking about a home grown embedded
71 device acting as the server I would lean towards nginx or other light-footed
72 servers.

Attachments

File name MIME type
signature.asc application/pgp-signature