initial commit
This commit is contained in:
commit
5b839e0543
174 changed files with 12261 additions and 0 deletions
24
init.sh
Normal file
24
init.sh
Normal file
|
@ -0,0 +1,24 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ ! -d "/var/www/werc/sites/$HOSTNAME" ]; then
|
||||
echo "Index directory for hostname $HOSTNAME does not exist. Creating..."
|
||||
cp -r /var/www/werc/sites/werc.cat-v.org "/var/www/werc/sites/$HOSTNAME"
|
||||
echo "# Hello World!" > "/var/www/werc/sites/$HOSTNAME/index.md"
|
||||
fi
|
||||
|
||||
CONF_FILE="/etc/lighttpd/conf.d/$HOSTNAME.conf"
|
||||
if [ ! -f "$CONF_FILE" ]; then
|
||||
echo "Creating new configuration file: $CONF_FILE"
|
||||
cat << EOF > "$CONF_FILE"
|
||||
\$HTTP["host"] =~ "^$(echo "$HOSTNAME" | sed 's/\./\\./g')$" {
|
||||
index-file.names = ( )
|
||||
server.error-handler-404 = "/werc.rc"
|
||||
alias.url += ( "/werc.rc" => "/var/www/werc/bin/werc.rc" )
|
||||
cgi.assign += ( ".rc" => "" )
|
||||
}
|
||||
EOF
|
||||
fi
|
||||
|
||||
echo "Running lighttpd"
|
||||
chmod a+w /dev/pts/0
|
||||
exec lighttpd -D -f /etc/lighttpd/lighttpd.conf
|
Loading…
Add table
Add a link
Reference in a new issue