Introducció
Configuració
Inicieu el servidor
Introducció
OpenBSD 5.6 va introduir un nou dimoni anomenat httpd, que admet CGI (mitjançant FastCGI) i TLS. No es necessita cap treball addicional per instal·lar el nou dimoni httpd perquè està inclòs al sistema base. Aquest article explica com configurar un servidor web bàsic utilitzant-lo.
Configuració
Editarem els següents fitxers.
/etc/rc.conf.local
/etc/httpd.conf
Simplement afegiu httpd_flags=""a /etc/rc.conf.local.
Obre /etc/rc.conf.localal teu editor de text preferit i afegeix:
pkg_scripts="httpd"
Actualització /etc/httpd.conf. Utilitzeu l'exemple següent com a plantilla i feu els canvis tal com s'indica a continuació als comentaris. Substituïu "exemple" en conseqüència.
ext_ip="10.0.0.1" # Change this value to your vultr IP
server "default" {
listen on $ext_ip port 80
}
types {
text/css css ;
text/html htm html ;
text/txt txt ;
image/gif gif ;
image/jpeg jpg jpeg ;
image/png png ;
application/javascript js ;
application/xml xml ;
}
server "www.example.net" {
listen on $ext_ip port 80
root "/htdocs/example.net"
}
server "www.example.com" {
listen on $ext_ip port 80
root "/htdocs/example.com"
}
Alternativament, podeu incloure tots els tipus de mímica de la següent manera:
types {
include "/usr/share/misc/mime.types"
}
A continuació, carregueu el vostre contingut web i col·loqueu-lo a /var/www/htdocs/example.com.
Inicieu el servidor
El vostre nou dimoni httpd està configurat per utilitzar-lo. Ara només cal iniciar el servidor:
$ doas /etc/rc.d/httpd start