How to setup simple apache directory
(This is using Arch to install, otherwise substitute httpd with apache2)
Install Apache & Copy Files to Serve¶
sudo pacman -S --needed apache
sudo install -d -m 755 /srv/http/audio
sudo chmod 644 /srv/http/audio/*
Include Apache Index Module¶
sudo sed -i 's/^#\?LoadModule autoindex_module/LoadModule autoindex_module/' /etc/httpd/conf/httpd.conf
Create Directory Conf¶
sudo tee /etc/httpd/conf/extra/simple-dir.conf >/dev/null <<'EOF'
<Directory "/srv/http">
Options Indexes
AllowOverride None
Require all granted
</Directory>
EOF
Add Hostname to Conf¶
echo 'Include conf/extra/simple-dir.conf' | sudo tee -a /etc/httpd/conf/httpd.conf
echo "ServerName $(hostname -f 2>/dev/null || hostname):80" | sudo tee -a /etc/httpd/conf/httpd.conf
Check if Loaded¶
httpd -M 2>/dev/null | grep -i autoindex || echo "autoindex NOT loaded"
Test httpd config¶
httpd -t
Start httpd¶
sudo systemctl enable --now httpd
systemctl --no-pager status httpd
Copy File Over¶
cp ~/supremecourt-oralarguments-20251008-hour1.mp3 /srv/http/audio/