How to Install NextCloud on CentOS 7

Prerequisite

yum -y update
adduser nextcloud
passwd nextcloud
usermod -aG wheel nextcloud
sudo su - nextcloud

Install Nginx with PHP 7

sudo yum -y install epel-release yum-utils nano unzip
sudo rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum-config-manager --enable remi-php71
sudo yum -y install nginx php php-fpm php-mysqlnd php-ctype php-dom php-gd php-iconv php-json php-libxml php-mbstring php-posix php-xml php-zip php-openssl php-zlib php-curl php-fileinfo php-bz2 php-intl php-mcrypt php-ftp php-exif php-gmp php-memcached php-imagick
sudo nano /etc/php.ini
; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 512M
...
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone =Asia/Kolkata
...
cgi.fix_pathinfo=0
...
post_max_size = 512M
...
upload_max_filesize = 512M
sudo nano /etc/php-fpm.d/www.conf
user = nginx
group = nginx
... ;listen = 127.0.0.1:9000
listen = /var/run/php-fpm/php-fpm.sock
...listen.owner = nginx
listen.group = nginx
env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp
sudo mkdir -p /var/lib/php/session
sudo chown nginx:nginx -R /var/lib/php/session/
sudo chown nginx:nginx /var/run/php-fpm/php-fpm.sock
sudo chmod 660 /var/run/php-fpm/php-fpm.sock
sudo systemctl restart php-fpm
sudo systemctl enable php-fpm
sudo systemctl restart nginx
sudo systemctl enable nginx

Related Blog Posts

Related Market Products

Related Documentation

Related Products

Related Course

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store