It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In RegisterIt looks like you're new here. If you want to get involved, click one of these buttons!
Howdy, Stranger!
It looks like you've been lurking for a while.
If you register, we also will remember what you have read and notify you about new comments. You will also be able to participate in discussions.
So if you'd like to get involved, register for an account, it'll only take you a minute!
yum install -y epel-release yum-utils unzip curl wget bash-completion policycoreutils-python mlocate bzip2 nano
yum install -y mariadb mariadb-server
Enable MariaDB to automatically start after server reboot:systemctl enable mariadb.service
Start MariaDB:When the script asks you to enter MariaDB root password, press enter because you have not set the root password yet. Then enter "Y" to set the root password for the MariaDB server. And proceed with pressing Enter to answer all the remaining questions.systemctl start mariadb
Now run the post-installation security script:
mysql_secure_installation
yum install -y httpd
systemctl enable httpd.service systemctl start httpd.service
yum install -y centos-release-sclCreate the required symlinks:
yum install -y rh-php72 rh-php72-php rh-php72-php-gd rh-php72-php-mbstring \ rh-php72-php-intl rh-php72-php-pecl-apcu rh-php72-php-mysqlnd rh-php72-php-pecl-redis \ rh-php72-php-opcache rh-php72-php-imagick
ln -s /opt/rh/httpd24/root/etc/httpd/conf.d/rh-php72-php.conf /etc/httpd/conf.d/ ln -s /opt/rh/httpd24/root/etc/httpd/conf.modules.d/15-rh-php72-php.conf /etc/httpd/conf.modules.d/ ln -s /opt/rh/httpd24/root/etc/httpd/modules/librh-php72-php7.so /etc/httpd/modules/Restart Apache to load the new version of PHP:
ln -s /opt/rh/rh-php72/root/bin/php /usr/bin/php
systemctl restart httpd
mysql -u root -p
Create a database:CREATE DATABASE nextcloud;
Create user:CREATE USER nextclouduser@localhost IDENTIFIED BY 'your-password';
Grant privileges for user and exit:GRANT ALL
PRIVILEGES
ON nextcloud.* to nextclouduser@localhost IDENTIFIED BY 'your-password';
FLUSH PRIVILEGES;
exit;
nano /etc/my.cnf
Add the following three lines in the [mysqld] section:systemctl restart mariadb
wget https://download.nextcloud.com/server/releases/nextcloud-18.0.3.zip
The latest release can be found at: https://nextcloud.com/install/#instructions-serverunzip nextcloud-18.0.3.zip
Move files to your Apache directory:mv nextcloud/* nextcloud/.* /var/www/html/
6. Setting strong directory permissionsnano permissions.sh
Insert the content: #!/bin/bashRun the file:
ncpath='/var/www/html/'
htuser='apache'
htgroup='apache'
rootuser='root'
printf "Creating possible missing Directories\n"
mkdir -p $ncpath/data
mkdir -p $ncpath/assets
mkdir -p $ncpath/updater
printf "chmod Files and Directories\n"
find ${ncpath}/ -type f -print0 | xargs -0 chmod 0640
find ${ncpath}/ -type d -print0 | xargs -0 chmod 0750
printf "chown Directories\n"
chown -R ${rootuser}:${htgroup} ${ncpath}/
chown -R ${htuser}:${htgroup} ${ncpath}/apps/
chown -R ${htuser}:${htgroup} ${ncpath}/assets/
chown -R ${htuser}:${htgroup} ${ncpath}/config/
chown -R ${htuser}:${htgroup} ${ncpath}/data/
chown -R ${htuser}:${htgroup} ${ncpath}/themes/
chown -R ${htuser}:${htgroup} ${ncpath}/updater/
chmod +x ${ncpath}/occ
printf "chmod/chown .htaccess\n"
if [ -f ${ncpath}/.htaccess ]
then
chmod 0644 ${ncpath}/.htaccess
chown ${rootuser}:${htgroup} ${ncpath}/.htaccess
fi
if [ -f ${ncpath}/data/.htaccess ]
then
chmod 0644 ${ncpath}/data/.htaccess
chown ${rootuser}:${htgroup} ${ncpath}/data/.htaccess
fi
bash permissions.sh
Comments
Are you sure with Step 5? (mv nextcloud/* nextcloud/.* /var/www/html/)
I get the following:
[root@ih0 ~]# mv nextcloud/* nextcloud/.* /var/www/html/
mv: overwrite '/var/www/html/.'? Y
mv: cannot move 'nextcloud/.' to '/var/www/html/.': Device or resource busy
May you can look at this issue? That would be great. I made excactly what you wrote. (Otherwise a very good instruction. Thank you very much!!)
Andy
root@ih0 ~]# ls -a
. .. .bash_logout .bash_profile .bashrc .cshrc .mysql_history .pki .tcshrc nextcloud nextcloud-9.0.53.zip setup-ius.sh
[root@ih0 ~]#
There can be another ways to move everything from "nextcloud" folder to "html" folder.
I'm not too familiar with CentOS, so I don't know how to remove the repository that offers the obsolete PHP 7.0. Could anyone help?
We will update this instruction in future with PHP 7.1 and NextCloud 12 version.
Regarding repository you can simply disable it by opening its file in /etc/yum.repos.d/ and replacing:
to
The next stump for me was at
because the template does not have an Apache yet. So I did
which now allows me to do