X-Git-Url: http://source.bookstackapp.com/devops/blobdiff_plain/2bde9a96e8815ee3615a05e34beadecb5921393d..refs/pull/22/head:/scripts/installation-ubuntu-16.04.sh diff --git a/scripts/installation-ubuntu-16.04.sh b/scripts/installation-ubuntu-16.04.sh index 8dedde9..0f91513 100644 --- a/scripts/installation-ubuntu-16.04.sh +++ b/scripts/installation-ubuntu-16.04.sh @@ -3,13 +3,17 @@ # This script is experimental and does not ensure any security. echo "" -echo -n "Enter your the domain you want to host BookStack and press [ENTER]: " +echo -n "Enter the domain you want to host BookStack and press [ENTER]: " read DOMAIN +myip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/') + export DEBIAN_FRONTEND=noninteractive apt update -apt install -y git nginx curl php7.0 php7.0-curl php7.0-mbstring php7.0-ldap php7.0-mcrypt \ -php7.0-tidy php7.0-xml php7.0-zip php7.0-gd php7.0-mysql mysql-server-5.7 mcrypt +apt install -y software-properties-common python-software-properties +add-apt-repository -yu ppa:ondrej/php +apt install -y git nginx curl php7.3-fpm php7.3-curl php7.3-mbstring php7.3-ldap \ +php7.3-tidy php7.3-xml php7.3-zip php7.3-gd php7.3-mysql mysql-server-5.7 # Set up database DB_PASS="$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13)" @@ -48,7 +52,7 @@ sed -i.bak 's/DB_DATABASE=.*$/DB_DATABASE=bookstack/' .env sed -i.bak 's/DB_USERNAME=.*$/DB_USERNAME=bookstack/' .env sed -i.bak "s/DB_PASSWORD=.*\$/DB_PASSWORD=$DB_PASS/" .env # Generate the application key -php artisan key:generate --no-interaction +php artisan key:generate --no-interaction --force # Migrate the databases php artisan migrate --no-interaction --force @@ -60,10 +64,15 @@ curl -s https://raw.githubusercontent.com/BookStackApp/devops/master/config/ngin sed -i.bak "s/bookstack.dev/$DOMAIN/" /etc/nginx/sites-available/bookstack ln -s /etc/nginx/sites-available/bookstack /etc/nginx/sites-enabled/bookstack +# Remove the default nginx configuration +rm /etc/nginx/sites-enabled/default + # Restart nginx to load new config service nginx restart echo "" echo "Setup Finished, Your BookStack instance should now be installed." echo "You can login with the email 'admin@admin.com' and password of 'password'" -echo "MySQL was installed without a root password, It is reccomended that you set a root MySQL password." +echo "MySQL was installed without a root password, It is recommended that you set a root MySQL password." +echo "" +echo "You can access your BookStack instance at: http://$myip/"