加個 user

useradd -m -d /var/lib/httpd httpd

確認下

# /etc/passwd
# httpd:x:1001:1001:Lightweight HTTP Daemon:/var/lib/httpd:/bin/false

增加 web server 設定

# /etc/httpd.conf
.htm:text/html
.html:text/html
.jpg:image/jpeg
.jpeg:image/jpeg
.gif:image/gif
.png:image/png
.txt:text/plain
.css:text/css
.csv:text/csv
.json:application/json

加個 systemd service 自動啟動

# /lib/systemd/system/
[Unit]
Description=Lightweight HTTP Daemon
Requires=network.target

[Service]
Type=simple
ExecStart=/usr/sbin/httpd \
    -f \
    -v -v \
    -u httpd:httpd \
    -p 8080 \
    -h /var/lib/httpd/html \
    -c /etc/httpd.conf