diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2009-05-06 09:53:36 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-05-06 09:53:36 +0000 |
commit | ec0c7a74bbf5824adc4efa54e1f91984ac870a8e (patch) | |
tree | 7f5a8763836154b10c8325629b493ebc67ead7e6 /setup-webconf | |
parent | f590563940559429ffe77094473d12361937852d (diff) | |
download | alpine-conf-ec0c7a74bbf5824adc4efa54e1f91984ac870a8e.tar.bz2 alpine-conf-ec0c7a74bbf5824adc4efa54e1f91984ac870a8e.tar.xz |
move to .in files
Diffstat (limited to 'setup-webconf')
-rw-r--r-- | setup-webconf | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/setup-webconf b/setup-webconf deleted file mode 100644 index 6a4ca84..0000000 --- a/setup-webconf +++ /dev/null @@ -1,98 +0,0 @@ -#!/bin/sh - -PROGRAM=setup-acf -VERSION=0.1 - -PREFIX= -. $PREFIX/lib/libalpine.sh - -usage() { - echo "$PROGRAM [-adh] [-l address] [PACKAGE...]" - exit 0; -} - -pkgs="acf-core acf-alpine-baselayout acf-apk-tools" - -while getopts "adhl:" opt ; do - case $opt in - a) pkgs=`apk_fetch -l | grep ^acf-`;; - d) pkgs="$pkgs acf-devtools";; - h) usage;; - l) address="$OPTARG";; - *) usage;; - esac -done -shift `expr $OPTIND - 1` - -while [ $# -gt 0 ]; do - pkgs="$pkgs acf-$1" - shift -done - -# install packages -apk_add mini_httpd $pkgs || exit 1 - -# setup mini_httpd and start it -mkdir -p /var/www/localhost/ -ln -s /usr/share/acf/www/ /var/www/localhost/htdocs -lbu add /var/www/localhost/htdocs - - -SSLDIR=/etc/ssl/mini_httpd -SSLCNF=$SSLDIR/mini_httpd.cnf -KEYFILE=$SSLDIR/server.key -CRTFILE=$SSLDIR/server.crt -PEMFILE=$SSLDIR/server.pem - -if [ -f $PEMFILE ]; then - echo "$PEMFILE already exist." -else - mkdir -p $SSLDIR -cat >$SSLCNF <<EOF -[ req ] -default_bits = 1024 -encrypt_key = yes -distinguished_name = req_dn -x509_extensions = cert_type -prompt = no - -[ req_dn ] -OU=HTTPS server -CN=$(hostname) -emailAddress=postmaster@example.com - -[ cert_type ] -nsCertType = server -EOF - echo "Generating certificates for HTTPS..." - openssl genrsa 2048 > $KEYFILE - openssl req -new -x509 -nodes -sha1 -days 3650 -key $KEYFILE \ - -config $SSLCNF > $CRTFILE - cat $KEYFILE >> $CRTFILE - rm $KEYFILE - mv $CRTFILE $PEMFILE -fi - -cat >/etc/mini_httpd.conf <<EOF -nochroot -dir=/var/www/localhost/htdocs -user=nobody -logfile=/var/log/mini_httpd.log -cgipat=cgi-bin** -certfile=$PEMFILE -port=443 -ssl -EOF -if [ -n "$address" ]; then - echo "host=$address" >> /etc/mini_httpd.conf -fi - -cat >/etc/conf.d/mini_httpd <<EOF -MINI_HTTPD_OPTS="-C /etc/mini_httpd.conf" -MINI_HTTPD_DOCROOT=/var/www/localhost/htdocs -EOF - -pidof mini_httpd >/dev/null && /etc/init.d/mini_httpd stop -rc_add -k mini_httpd -/etc/init.d/mini_httpd start - |