Packaging fixes
parent
3b3a5c205a
commit
e85e9c577f
|
@ -0,0 +1,7 @@
|
||||||
|
<VirtualHost *:80>
|
||||||
|
ServerName $DOMAIN
|
||||||
|
DocumentRoot $INSTALL_DIR
|
||||||
|
|
||||||
|
CustomLog \${APACHE_LOG_DIR}/jilo-web_access.log combined
|
||||||
|
ErrorLog \${APACHE_LOG_DIR}/jilo-web_error.log
|
||||||
|
</VirtualHost>
|
15
config.nginx
15
config.nginx
|
@ -0,0 +1,15 @@
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name $DOMAIN;
|
||||||
|
|
||||||
|
root $INSTALL_DIR;
|
||||||
|
index index.php;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files \$uri \$uri/ /index.php?\$args;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ /\.ht {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
}
|
|
@ -22,6 +22,8 @@ cp ../../CHANGELOG.md "jilo-web-$VERSION/usr/share/doc/jilo-web/"
|
||||||
cp ../../LICENSE "jilo-web-$VERSION/usr/share/doc/jilo-web/"
|
cp ../../LICENSE "jilo-web-$VERSION/usr/share/doc/jilo-web/"
|
||||||
cp ../../README.md "jilo-web-$VERSION/usr/share/doc/jilo-web/"
|
cp ../../README.md "jilo-web-$VERSION/usr/share/doc/jilo-web/"
|
||||||
cp ../../TODO.md "jilo-web-$VERSION/usr/share/doc/jilo-web/"
|
cp ../../TODO.md "jilo-web-$VERSION/usr/share/doc/jilo-web/"
|
||||||
|
cp ../../config.apache "jilo-web-$VERSION/usr/share/doc/jilo-web/"
|
||||||
|
cp ../../config.nginx "jilo-web-$VERSION/usr/share/doc/jilo-web/"
|
||||||
|
|
||||||
mkdir -p "jilo-web-$VERSION/usr/share/man/man8"
|
mkdir -p "jilo-web-$VERSION/usr/share/man/man8"
|
||||||
cp ../man-jilo-web.8 "jilo-web-$VERSION/usr/share/man/man8/jilo-web.8"
|
cp ../man-jilo-web.8 "jilo-web-$VERSION/usr/share/man/man8/jilo-web.8"
|
||||||
|
|
|
@ -33,60 +33,23 @@ case "$1" in
|
||||||
|
|
||||||
# we need a webserver, check for Apache and Nginx
|
# we need a webserver, check for Apache and Nginx
|
||||||
WEB_SERVER=""
|
WEB_SERVER=""
|
||||||
|
|
||||||
|
# install and enable apache vhost
|
||||||
if dpkg-query -W -f='${status}' apache2 2>/dev/null | grep -q "ok installed"; then
|
if dpkg-query -W -f='${status}' apache2 2>/dev/null | grep -q "ok installed"; then
|
||||||
WEB_SERVER="apache2"
|
WEB_SERVER="apache2"
|
||||||
elif
|
cp "${INSTALL_DIR}/config.apache" /etc/apache2/sites-available/jilo-web.conf
|
||||||
WEB_SERVER="nginx"
|
|
||||||
else
|
|
||||||
echo "Nginx or Apache is needed, please install one of them first."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# finish configuration depending on web server
|
|
||||||
if [ "$WEB_SERVER" = "apache2" ]; then
|
|
||||||
|
|
||||||
# vhost file
|
|
||||||
VHOST_APACHE="/etc/apache2/sites-available/jilo-web.conf"
|
|
||||||
cat <<EOF > "$VHOST_APACHE"
|
|
||||||
<VirtualHost *:80>
|
|
||||||
ServerName $DOMAIN
|
|
||||||
DocumentRoot $INSTALL_DIR
|
|
||||||
|
|
||||||
CustomLog \${APACHE_LOG_DIR}/jilo-web_access.log combined
|
|
||||||
ErrorLog \${APACHE_LOG_DIR}/jilo-web_error.log
|
|
||||||
</VirtualHost>
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# enable vhost and reload
|
|
||||||
a2ensite jilo-web.conf
|
a2ensite jilo-web.conf
|
||||||
/etc/init.d/apache2 reload
|
/etc/init.d/apache2 reload
|
||||||
|
|
||||||
elif [ "$WEB_SERVER" = "nginx" ]; then
|
# install and enable nginx vhost
|
||||||
|
elif dpkg-query -W -f='${status}' nginx 2>/dev/null | grep -q "ok installed"; then
|
||||||
# vhost file
|
WEB_SERVER="nginx"
|
||||||
VHOST_NGINX="/etc/nginx/sites-available/jilo-web"
|
cp "${INSTALL_DIR}/config.nginx" /etc/nginx/sites-available/jilo-web
|
||||||
cat <<EOF > "$VHOST_NGINX"
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
server_name $DOMAIN;
|
|
||||||
|
|
||||||
root $INSTALL_DIR;
|
|
||||||
index index.php;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
try_files \$uri \$uri/ /index.php?\$args;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ~ /\.ht {
|
|
||||||
deny all;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# enable vhost and reload
|
|
||||||
ln -s /etc/nginx/sites-available/jilo-web /etc/nginx/sites-enabled/
|
ln -s /etc/nginx/sites-available/jilo-web /etc/nginx/sites-enabled/
|
||||||
/etc/init.d/nginx reload
|
/etc/init.d/nginx reload
|
||||||
|
else
|
||||||
|
echo "Nginx or Apache is needed, please install one of them first."
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# permissions for web folder
|
# permissions for web folder
|
||||||
|
|
Loading…
Reference in New Issue