From 4f824ba29a8e63cc23666fbc9cd6efa34a200566 Mon Sep 17 00:00:00 2001 From: structix Date: Sun, 17 Sep 2017 19:25:53 +0200 Subject: [PATCH] New InstallServer script. Apache config added. Restserver install script updated --- ApacheConfigs/laravel.conf | 15 +++++++++++++++ RestServer/installscript.sh | 2 +- installServer.sh | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 ApacheConfigs/laravel.conf create mode 100644 installServer.sh diff --git a/ApacheConfigs/laravel.conf b/ApacheConfigs/laravel.conf new file mode 100644 index 0000000..6364dad --- /dev/null +++ b/ApacheConfigs/laravel.conf @@ -0,0 +1,15 @@ + + ServerName localhost + + ServerAdmin lala@lala.de + DocumentRoot /var/www/html/public + + + AllowOverride All + + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + + + diff --git a/RestServer/installscript.sh b/RestServer/installscript.sh index 7cf6092..74df21b 100644 --- a/RestServer/installscript.sh +++ b/RestServer/installscript.sh @@ -1,6 +1,6 @@ #!/bin/bash -apt-get install libmicrohttpd-dev libjansson-dev libcurl4-gnutls-dev libgnutls28-dev libgcrypt20-dev +apt-get install libmicrohttpd-dev libjansson-dev libcurl4-gnutls-dev libgnutls28-dev libgcrypt20-dev -y git clone https://github.com/babelouest/ulfius.git cd ulfius/ diff --git a/installServer.sh b/installServer.sh new file mode 100644 index 0000000..8c5c662 --- /dev/null +++ b/installServer.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +#Install rest server +echo "Installing rest server and dependencies" +cd RestServer +./installscript.sh +make +make install +cd .. + +#Install apache2 and dependencies +echo "Installing apache2 and php dependencies" +sudo apt install php7.0 php7.0-curl php7.0-gd php7.0-intl php7.0-mbstring php7.0-mcrypt php7.0-bz2 php7.0-cli php7.0-json php7.0-mysql php7.0-opcache php7.0-readline php7.0-xml php7.0-zip + +echo "Configuring apache" +#Disable default apache config +sudo a2dissite 000-default.conf + +#Copy and enable Apache Configs +cd ApacheConfigs +sudo cp laravel.conf /etc/apache2/sites-available +sudo a2ensite laravel.conf + +#Rewrite aktivieren +sudo a2enmod rewrite + +#Service neustarten +sudo service apache2 restart +cd .. + +echo "Copying laravel files" +cp -r Laravel/* /var/www/html/ +echo "Please create a .env File in /var/www/html" + + +