apt install apache2 unzip mariadb-server mariadb-client php7.0-fpm php7.0-mysql php7.0-common php7.0-gd php7.0-json php7.0-cli php7.0-curl libapache2-mod-php7.0 php7.0-common php7.0-gd php7.0-json php7.0-curl php7.0-zip php7.0-xml php7.0-mbstring
mysql_secure_installation
mysql -u root -p
create database nextcloud; |
create user BENUTZER@localhost identified by 'PASSWORD'; |
grant all privileges on nextcloud.* to BENUTZER@localhost identified by 'PASSWORD'; |
cd /var/www
unzip /Pfad/Zum/NectCloud/Download
mkdir /var/www/nextcloud-data/
vi /etc/apache2/sites-available/nextcloud.conf
DocumentRoot "/var/www/nextcloud" |
ServerName HOST.DOMAIN.DOM |
<Directory /var/www/nextcloud/> |
SetEnv HOME /var/www/nextcloud |
SetEnv HTTP_HOME /var/www/nextcloud |
a2ensite nextcloud.conf
a2enmod rewrite && a2enmod headers && a2enmod env && a2enmod dir && a2enmod mime && a2enmod setenvif && a2enmod ssl
service apache2 restart
vi nextcloud.sh
ocpath='/var/www/nextcloud' |
printf "Creating possible missing Directories\n" |
printf "chmod Files and Directories\n" |
find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640 |
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750 |
printf "chown Directories\n" |
chown -R ${rootuser}:${htgroup} ${ocpath}/ |
chown -R ${htuser}:${htgroup} ${ocpath}/apps/ |
chown -R ${htuser}:${htgroup} ${ocpath}/assets/ |
chown -R ${htuser}:${htgroup} ${ocpath}/config/ |
chown -R ${htuser}:${htgroup} ${ocpath}/data/ |
chown -R ${htuser}:${htgroup} ${ocpath}/themes/ |
chown -R ${htuser}:${htgroup} ${ocpath}/updater/ |
printf "chmod/chown .htaccess\n" |
if [ -f ${ocpath}/.htaccess ] |
chmod 0644 ${ocpath}/.htaccess |
chown ${rootuser}:${htgroup} ${ocpath}/.htaccess |
if [ -f ${ocpath}/data/.htaccess ] |
chmod 0644 ${ocpath}/data/.htaccess |
chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess |
chown www-data:www-data /var/www/nextcloud-data -R |
chmod +x nextcloud.sh
./nextcloud.sh
systemctl daemon-reload
apt install letsencrypt python-letsencrypt-apache
letsencrypt --apache --agree-tos --email EMAIL@DOMAIN.DOM -d HOST.DOMAIN.DOM |