Setting Up a Website
Before You Begin
This guide assumes you have already correctly configured OpenHTTPd and set up TLS.
Finding the Document Root
To set up a website, put files in your document root. You'll want to check your httpd.conf(5) for the document root. For example, consider this block:
server "example.com" { listen on * tls port 443 tls { certificate "/etc/ssl/example.com.crt" key "/etc/ssl/private/example.com.key" } location "/pub/*" { directory auto index } location "/.well-known/acme-challenge/*" { root "/acme" request strip 2 } }
In this example, the only document root declared in the configuration is in
line 11, for ACME verification (which is not for the webpages we plan to
serve). Since the document root is not specified,
httpd(8) defaults to using /htdocs
.
Since OpenHTTPd runs in a chroot by default, this means your
files should go in /var/www/htdocs/
.
Creating a Webpage
Create your own webpage by editing /var/www/htdocs/index.html
.
Save this page, then load https://example.com/index.html in your web browser to view.
Remember to replace example.com
with your actual hostname.
Here are some sample web applications you can configure:
Name | Type |
---|---|
pmwiki | wiki |
CVSWeb | CVS Code Hosting |
Gotweb | Got code hosting |
Fiche | Pastebin |
Squirrelmail | Webmail |
You can find more web applications in the Almanack.