Created
February 8, 2019 04:16
-
-
Save peacefixation/d59bdcb98fba7acabe68d6cabd412bad to your computer and use it in GitHub Desktop.
Setup a Munki repo on Debian with Apache WebDAV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/munki/munkiwebadmin/wiki/MunkiWebAdmin-Ubuntu-14.04-LTS-Setup | |
echo Installing Apache | |
/usr/bin/apt-get install -y apache2 | |
echo Creating Munki repo in Apache web root | |
/bin/mkdir -p /var/www/munki/pkgsinfo \ | |
/var/www/munki/catalogs \ | |
/var/www/munki/manifests \ | |
/var/www/munki/pkgs \ | |
/var/www/munki/icons | |
/bin/chown -R www-data /var/www/munki | |
/bin/chmod -R a+rX /var/www/munki | |
echo Configuring WebDAV Apache module | |
/bin/cat > /etc/apache2/mods-enabled/dav_fs.conf << EOF | |
DAVLockDB ${APACHE_LOCK_DIR}/DAVLock | |
Alias /munki_repo /var/www/munki | |
<Location /munki_repo> | |
DAV On | |
Options None | |
<LimitExcept GET OPTIONS> | |
Order allow,deny | |
Allow from all | |
</LimitExcept> | |
</Location> | |
EOF | |
echo Enabling WebDAV Apache module | |
/usr/sbin/a2enmod dav_fs | |
echo Configuring default website | |
/bin/cat > /etc/apache2/sites-available/000-default.conf << EOF | |
<VirtualHost *:80> | |
DocumentRoot /var/www/munki | |
Alias /catalogs/ /var/www/munki/catalogs/ | |
Alias /manifests/ /var/www/munki/manifests/ | |
Alias /pkgs/ /var/www/munki/pkgs/ | |
Alias /icons/ /var/www/munki/icons/ | |
# Munki Repo | |
<Directory /var/www/munki/> | |
Options FollowSymLinks | |
AllowOverride None | |
Order allow,deny | |
allow from all | |
Require all granted | |
</Directory> | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
</VirtualHost> | |
EOF | |
echo Enabling default website | |
/usr/sbin/a2ensite 000-default | |
echo Restarting Apache | |
/etc/init.d/apache2 restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment