postinstall.sh - create nginx config also for centos / sles
This commit is contained in:
parent
20268b8ccf
commit
5b223d2ee4
3 changed files with 14 additions and 11 deletions
|
@ -19,7 +19,7 @@
|
||||||
* exit
|
* exit
|
||||||
|
|
||||||
### Create Nginx Config
|
### Create Nginx Config
|
||||||
* cp /opt/zammad/contrib/nginx/sites-available/zammad.conf /etc/nginx/sites-available/zammad.conf
|
* cp /opt/zammad/contrib/nginx/zammad.conf /etc/nginx/sites-available/zammad.conf
|
||||||
* vi /etc/nginx/sites-available/zammad.conf
|
* vi /etc/nginx/sites-available/zammad.conf
|
||||||
* change servername "localhost" to your domain if your're not testing localy
|
* change servername "localhost" to your domain if your're not testing localy
|
||||||
* ln -s /etc/nginx/sites-available/zammad.conf /etc/nginx/sites-enabled/zammad.conf
|
* ln -s /etc/nginx/sites-available/zammad.conf /etc/nginx/sites-enabled/zammad.conf
|
||||||
|
|
|
@ -59,21 +59,24 @@ echo "# Starting Zammad"
|
||||||
${INIT_CMD} start zammad
|
${INIT_CMD} start zammad
|
||||||
|
|
||||||
# nginx config
|
# nginx config
|
||||||
if [ -d /etc/nginx/sites-enabled ]; then
|
if [ -n "$(which nginx)" ];then
|
||||||
# copy nginx config
|
# copy nginx config
|
||||||
test -f /etc/nginx/sites-available/zammad.conf || cp ${ZAMMAD_DIR}/contrib/nginx/sites-available/zammad.conf /etc/nginx/sites-available/zammad.conf
|
# debian / ubuntu
|
||||||
|
if [ -d /etc/nginx/sites-enabled ]; then
|
||||||
if [ ! -f /etc/nginx/sites-available/zammad.conf ]; then
|
NGINX_CONF="/etc/nginx/sites-enabled/zammad.conf"
|
||||||
# creating symlink
|
test -f /etc/nginx/sites-available/zammad.conf || cp ${ZAMMAD_DIR}/contrib/nginx/zammad.conf /etc/nginx/sites-available/zammad.conf
|
||||||
ln -s /etc/nginx/sites-available/zammad.conf /etc/nginx/sites-enabled/zammad.conf
|
test -f /etc/nginx/sites-available/zammad.conf || ln -s /etc/nginx/sites-available/zammad.conf /etc/nginx/sites-enabled/zammad.conf
|
||||||
|
# centos / sles
|
||||||
echo -e "\nAdd your FQDN to servername directive in /etc/nginx/sites/enabled/zammad.conf anmd restart nginx if you're not testing localy!\n"
|
elif [ -d /etc/nginx/conf.d ]; then
|
||||||
|
NGINX_CONF="/etc/nginx/conf.d/zammad.conf"
|
||||||
|
test -f /etc/nginx/conf.d/zammad.conf || cp ${ZAMMAD_DIR}/contrib/nginx/zammad.conf /etc/nginx/conf.d/zammad.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "# Restarting Nginx"
|
echo "# Restarting Nginx"
|
||||||
${INIT_CMD} restart nginx
|
${INIT_CMD} restart nginx
|
||||||
|
|
||||||
echo -e "\nOpen http://localhost in your browser to start using Zammad!\n"
|
echo -e "\nAdd your FQDN to servername directive in ${NGINX_CONF} and restart nginx if you're not testing localy"
|
||||||
|
echo -e "or open http://localhost in your browser to start using Zammad.\n"
|
||||||
else
|
else
|
||||||
echo -e "\nOpen http://localhost:3000 in your browser to start using Zammad!\n"
|
echo -e "\nOpen http://localhost:3000 in your browser to start using Zammad.\n"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue