Host a website (httpd)

Host you own website is a great project ! 😄 It's the best way to have your personal space to do whatever you want without restrictions.

OpenBSD is shipped with "httpd", a http server. It is light and easy to configure. Most of the time, it is more than enough, but if you need even more features, look for "nginx" or "apache" in ports.

In this part, we'll see how to host a simple static website, then how to add PHP support to finally show some web applications examples.

Before going any further, take note that http is chrooted in "/var/www" by default.

What is that supposed to mean ?

To httpd, every file "above" "/var/www" can't be read. In other words, httpd see "/var/www" as the new root "/". For obvious security reasons, if httpd can't even reach system files, it reduce the risk that someone find sensitive data through a weak website.