<\/span><\/h2>\r\n\r\n\r\n\r\n# ssh root@IP_Address -p Port_number<\/pre>\r\n\r\n\r\n\r\nBefore starting, enter the command below to check whether you have the proper version of CentOS installed on your machine:<\/p>\r\n\r\n\r\n\r\n
# cat \/etc\/redhat-release<\/pre>\r\n\r\n\r\n\r\nwhich should give you the underneath output:<\/p>\r\n\r\n\r\n\r\n
CentOS Linux release 7.5.1804 (Core)<\/p>\r\n\r\n\r\n\r\n
<\/span>Step 2: Update the system<\/span><\/h2>\r\n\r\n\r\n\r\nMake sure your server is fully up to date:<\/p>\r\n\r\n\r\n\r\n
# yum update<\/pre>\r\n\r\n\r\n\r\nIf your system has not been updated for a while, it will take a few minutes to complete.<\/p>\r\n\r\n\r\n\r\n
# yum install -y epel-release<\/pre>\r\n\r\n\r\n\r\n<\/span>Step 3: Install Web Server<\/span><\/h2>\r\n\r\n\r\n\r\nIn this step, you can choose whether you want to install Apache or Nginx.<\/p>\r\n\r\n\r\n\r\n
Install Nginx web server<\/h3>\r\n\r\n\r\n\r\n# yum install nginx<\/pre>\r\n\r\n\r\n\r\nEnable Nginx to start on boot and start the service using:<\/p>\r\n\r\n\r\n\r\n
# systemctl enable nginx\r\n\r\n# systemctl start nginx<\/pre>\r\n\r\n\r\n\r\nInstall Apache\u00a0web server<\/h3>\r\n\r\n\r\n\r\n
If you would like to choose Apache instead of Nginx, you can skip the Nginx installation above then install Apache.<\/p>\r\n\r\n\r\n\r\n
# yum install httpd<\/pre>\r\n\r\n\r\n\r\nEnable Apache to start on boot and start the service using:<\/p>\r\n\r\n\r\n\r\n
# systemctl enable httpd\r\n\r\n# systemctl start httpd<\/pre>\r\n\r\n\r\n\r\n<\/span>Step 4: Install PHP 7<\/span><\/h2>\r\n\r\n\r\n\r\nThe default PHP version on CentOS 7 is PHP 5.4 and Nextcloud 14 requires PHP 7 or above, in this step, we will install PHP version 7.<\/p>\r\n\r\n\r\n\r\n
Install Remi and EPEL repository packages:<\/h3>\r\n\r\n\r\n\r\n# rpm -Uvh http:\/\/rpms.remirepo.net\/enterprise\/remi-release-7.rpm<\/pre>\r\n\r\n\r\n\r\nEnable Remi PHP 7 repo:<\/h3>\r\n\r\n\r\n\r\n# yum-config-manager \u2013enable remi-php70<\/pre>\r\n\r\n\r\n\r\nand install PHP 7 and several PHP modules required by Nextcloud by executing the following command:<\/p>\r\n\r\n\r\n\r\n
# yum install php php-mysql php-pecl-zip php-xml php-mbstring php-gd php-fpm php-intl<\/pre>\r\n\r\n\r\n\r\nNow, let’s find the following strings in \/etc\/php-fpm.d\/www.conf<\/p>\r\n\r\n\r\n\r\n
user = apache\r\ngroup = apache<\/pre>\r\n\r\n\r\n\r\nReplace the values with<\/p>\r\n\r\n\r\n\r\n
user = nginx\r\ngroup = nginx<\/pre>\r\n\r\n\r\n\r\nThen, change the permission for the PHP session directory,\u00a0you need to skip this step if you want to use Apache instead of Nginx.<\/p>\r\n\r\n\r\n\r\n
# chown -R root:nginx \/var\/lib\/php\/session\/<\/pre>\r\n\r\n\r\n\r\nFinally, restart php-fpm<\/p>\r\n\r\n\r\n\r\n
# systemctl restart php-fpm<\/pre>\r\n\r\n\r\n\r\n