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 /etc/httpd.conf. Here is a sample server block:
server "example.com" {
listen on * tls port 443
tls {
certificate "/etc/ssl/example.com.fullchain.pem"
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 in the configuration is for ACME verification, not for your website. Since the document root is not specified, OpenHTTPd defaults to /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.
NOTE: Make sure to replace example.com with your actual hostname.
As practice, you can try setting up the following web sites:
| Name | Type |
|---|---|
| pmwiki | wiki |
| Dokuwiki? | wiki |
| CVSWeb | CVS Code Hosting |
| Cgit? | Git code hosting |
| Gotweb | Got code hosting |
| Fiche | Pastebin |
| Squirrelmail | Webmail |
| Wordpress | Blog |
