mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2024-11-26 02:57:04 +00:00
19f5f144ae
We were installing .deb's from Debian. The next apt-get upgrade would cause roundcube to be upgraded. Maybe that also triggered the installation of apache. Now install roundcube from Ubuntu. So long as Ubuntu doesn't post an update to roundcube, at least it won't trigger an upgrade on the next apt-get upgrade. This should also mean we don't need to purge the installation of apache2. Also try using apt-mark hold to prevent roundcube from being updated, in case that will trigger dependencies.
40 lines
1.2 KiB
Bash
Executable File
40 lines
1.2 KiB
Bash
Executable File
# HTTP: Turn on a web server serving static files
|
|
#################################################
|
|
|
|
source scripts/functions.sh # load our functions
|
|
|
|
apt_install nginx php5-cgi
|
|
|
|
rm -f /etc/nginx/sites-enabled/default
|
|
|
|
STORAGE_ROOT_ESC=$(echo $STORAGE_ROOT|sed 's/[\\\/&]/\\&/g')
|
|
PUBLIC_HOSTNAME_ESC=$(echo $PUBLIC_HOSTNAME|sed 's/[\\\/&]/\\&/g')
|
|
|
|
# copy in the nginx configuration file and substitute some
|
|
# variables
|
|
cat conf/nginx.conf \
|
|
| sed "s/\$STORAGE_ROOT/$STORAGE_ROOT_ESC/g" \
|
|
| sed "s/\$PUBLIC_HOSTNAME/$PUBLIC_HOSTNAME_ESC/g" \
|
|
> /etc/nginx/conf.d/local.conf
|
|
cp conf/nginx-ssl.conf /etc/nginx/nginx-ssl.conf
|
|
|
|
# make a default homepage
|
|
mkdir -p $STORAGE_ROOT/www/static
|
|
cp conf/www_default.html $STORAGE_ROOT/www/static/index.html
|
|
chown -R $STORAGE_USER $STORAGE_ROOT/www/static/index.html
|
|
|
|
# Create an init script to start the PHP FastCGI daemon and keep it
|
|
# running after a reboot. Allows us to serve Roundcube for webmail.
|
|
rm -f /etc/init.d/php-fastcgi
|
|
ln -s $(pwd)/conf/phpfcgi-initscript /etc/init.d/php-fastcgi
|
|
update-rc.d php-fastcgi defaults
|
|
|
|
# Start services.
|
|
service nginx restart
|
|
service php-fastcgi restart
|
|
|
|
# Open ports.
|
|
ufw_allow http
|
|
ufw_allow https
|
|
|