Install NextCloud on CentOS 7 with Alibaba Cloud ECS

This article will show you how to install ** NextCloud ** on ** CentOS 7 ** using ** Alibaba Cloud ECS **.

NextCloud is a free, open source, self-hosted service that replaces Dropbox and Google Drive. You can host your files on your private server and have full control over your data.

Prerequisites

  1. A new ECS instance using CentOS 7.4 as the OS.
  2. Connect to your ECS instance and log in as the root user. 3, the domain name directed to the ECS instance.

After logging in to your CentOS 7 instance, run the following command to update your base system with the latest available packages.

yum -y update

Create a new user.

adduser nextcloud
passwd nextcloud

Add a user to the sudo group and switch to the newly created user.

usermod -aG wheel nextcloud
sudo su - nextcloud

Install Nginx with PHP 7

Currently, Nextcloud supports PHP versions 7.0 and 7.1. This tutorial installs PHP 7.1. Install EPEL and Remi repositories and directly install the pre-built PHP package Allows you to install.

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

Install the Nginx web server and PHP 7.1 with the required PHP module.

sudo yum -y install nginx php php php-fpm php-mysqlnd php-ctype php-dom php-gd php-iconv php-json php-libxml php-mbstring php-posix php-json php-libxml php-mbstring php-posix php-json php-json php-libxml php-mbstring php-mbstring php-posix 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

Edit the loaded PHP configuration file.

sudo nano /etc/php.ini

Set the appropriate time zone and memory limit. If desired, you can use -1 as the memory limit to lift the limit on the amount of memory the script consumes. Uncomment the value of cgi.fix_pathinfo and set it to 0 to increase the file upload limit. If you update the parameters, they should be updated as follows:

; 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

After setting up php.ini, open the php-fpm configuration file.

sudo nano /etc/php-fpm.d/www.conf

Find the user and group parameters and change from apache to nginx. Find the listen = 127.0.0.1: 9000 file, comment it out, and add listen = /var/run/php-fpm/php-fpm.sock just below it. Finally, uncomment listen.owner and change its value from nobody to nginx. After updating the parameters, it should be updated as follows.

user = nginx
group = nginx

...    

;listen = 127.0.0.1:9000
listen = /var/run/php-fpm/php-fpm.sock

...

listen.owner = nginx
listen.group = nginx

Also, search for the following line and uncomment it to enable the php environment variable.

env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp

Save the file and exit the editor. Now create a new directory to store your PHP session data.

sudo mkdir -p /var/lib/php/session
sudo chown nginx:nginx -R /var/lib/php/session/

Set the appropriate permissions and ownership on the php-fpm socket file.

sudo chown nginx:nginx /var/run/php-fpm/php-fpm.sock
sudo chmod 660 /var/run/php-fpm/php-fpm.sock

After that, start php-fpm so that it will start automatically at startup.

sudo systemctl restart php-fpm
sudo systemctl enable php-fpm

Also, start the Nginx web server so that it starts automatically at startup.

sudo systemctl restart nginx
sudo systemctl enable nginx

This completes the Nginx installation. Download NextCloud, configure SSL, configure MySQL database, complete web-based installation, this [Tutorial](https://www.alibabacloud.com/blog/Install-NextCloud-on-CentOS-7-using-Alibaba -Cloud-ECS_399323? Spm = a2c65.11461447.0.0.12da5082PLe198) Set up the Cron job as shown.

Related blog articles

How to configure PHP on Ubuntu 16.04

PHP is one of the most widely used server-side scripting languages. An open source general-purpose programming language is a powerful tool for running dynamic and interactive web applications.

In this article, you will get information about installing some tools using PHP on Ubuntu 16.04.

[How to install ClipBucket and Nginx on CentOS 7](https://www.alibabacloud.com/blog/how-to-install-clipbucket-and-nginx-on-centos-7_593774?spm=a2c65.11461447.0.0.12 da5082PLe198)

ClipBucket does not restrict installation on any particular operating system (OS). You can use your favorite OS, but the installation procedure differs depending on the OS.

In this tutorial, you will install and configure ClipBucket and Nginx on an Alibaba Cloud Elastic Compute Service (ECS) instance using CentOS 7.

Related market products

Some products with PHP infrastructure and Centos built by partner companies can be launched immediately on Alibaba Cloud servers.

PHP infrastructure using Websoft9 (LAMP | CentOS7.2)

The Websoft9 LAMP stack is a pre-configured, executable image for running PHP applications on Alibaba Cloud.

CentOS 7.0 64bit The CentOS image was officially applied and tested by Alibaba Cloud. The CentOS Linux distribution is a stable, predictable, manageable and reproducible platform derived from Red Hat Enterprise Linux (RHEL) sources. CentOS is fully compliant with upstream vendor redistribution policies and aims to be 100% functionally compatible with RHEL (CentOS primarily modifies packages for upstream vendor branding and art. The work is being deleted). CentOS Linux can be redistributed free of charge.

related documents

Some documentation may be helpful.

Change PHP version

Web hosting supports PHP and uses PHP 5.3 by default.

If the default PHP version is different from what your program requires, you can change the PHP version.

Building LNMP environment on CentOS 7

NGINX is a small and efficient web server software for Linux. With NGINX, you can easily build an LNMP web service environment. The LNMP environment is based on the four main components required for this architecture. Linux, NGINX, MySQL, PHP. This topic describes how to manually build an LNMP environment on your ECS instance.

related products

Web Hosting

Web hosting is used to store and host website content and behaves like a virtual server. ECS instances are divided into multiple spaces that can be of various sizes. The space corresponds to your account and indicates an instance of web hosting. Each space has independent FTP and web permissions, but all spaces share the hardware resources of the ECS instance.

Web Application Firewall

Web Application Firewall (WAF) protects your website's servers from intrusion. Our services detect and block malicious traffic directed to your website or application. WAF protects your core business data and prevents server malfunctions due to malicious activity or attacks.

Related courses

Deep dive in attack and defense of web applications

Web applications are the most common way to serve services in the cloud and are the most vulnerable security targets. Through this course, you will be able to understand the top 10 security risks of network applications listed by OWASP. We will explain these 10 security risks one by one, select the three most common attack methods, XSS, SQL injection, and Webshell, and have a deeper discussion. Finally, we will introduce the WAF products of Alibaba Cloud. You can solve the security problems of online applications.

How to troubleshoot problems with web hosting services

This video will show you how to find and resolve database connectivity issues.

Database connection problem DNS record problem Invalid response problem

Recommended Posts

Install NextCloud on CentOS 7 with Alibaba Cloud ECS
Continuous integration on Alibaba Cloud ECS Ubuntu instance with Jenkins
Install Golang on CentOS 8
Install Neo4j 4.1.3 on centOS
Install Vertica 10.0 on CentOS 6.10
Install PostgreSQL 12 on Centos8
Install nginx on centOS7
Install Python 3 on CentOS 7
Install GitLab on CentOS 8 with no internet connection
Install kuromoji on CentOS7
Install Mattermost on CentOS 7
Install PostGIS 2.5.5 on CentOS7
Install jpndistrict on CentOS 7
Install Redmine 4.1.1 on CentOS 7
Smokeping Install on CentOS7
Install PostgreSQL 13 on CentOS 7.5
Network install CentOS 8 with Kickstart.
Install OpenFOAM v2006 on CentOS
Install Jenkins on Docker's CentOS
Install Apache on CentOS on VirtualBox
Install Ruby 2.7 on CentOS 7 (SCL)
Note: Install nginx from official repositories with dnf on CentOS 8
How to develop an app with Jersey Java RESTful API on Alibaba Cloud ECS instance
Try DPDK20 SDK on CentOS7 â‘ Install
Install Java with zip on Windows
Install Ruby 2.5 on CentOS 7 using SCL
Install Java Open JDK 8 on CentOS 7
WordPress with Docker Compose on CentOS 8
How to install MariaDB 10.4 on CentOS 8
Install apache 2.4.46 from source on CentOS7
Steps to install MySQL 8 on CentOS 8
Install SonarQube on ECS instance on Ubuntu 16.04
Steps to install devtoolset-6 on CentOS 7
Install ruby on Ubuntu 20.04 with rbenv
Install Java 9 on windows 10 and CentOS 7
Install samba4 from source code on CentOS8
Set up ImpressPages 5.0 with LAMP on CentOS 7.3
Install the webmail client Rainloop on CentOS 8
How to install beta php8.0 on CentOS8
Install Java8 with Yum on Amazon Linux
Personal tips on working with CentOS servers
Install CentOS 7 on Raspberry pi 4 Model B
Command to install nginx / PHP7 / php-fpm on CentOS7
Install Java 11 (OpenJDK: AdoptOpenJDK) on macOS with Homebrew
Note Book: OpenCV with CUDA Install On Windows10
Install Java 14 (OpenJDK: AdoptOpenJDK) on macOS with Homebrew
Install Java 8 (OpenJDK: AdoptOpenJDK) on macOS with Homebrew
Install CMS Made Simple v2.2.2 on LAMP on CentOS 7.3
Install MariaDB (CentOS 8)
[CentOS] Install apache-loggen
OpenVPN on CentOS 8
Install Veeam PN on Ubuntu in IBM Cloud VPC and connect with SSL VPN
Install BookStack Documentation Wiki on Elastic Compute Service on CentOS 7
Install Java 8 (OpenJDK: Amazon Corretto) on macOS with Homebrew
Install the latest hardware drivers from ELRepo on CentOS
Create a user with an empty password on CentOS7
Install Java 8 (OpenJDK: Zulu Community) on macOS with Homebrew
Install rbenv with apt on ubuntu and put ruby
I struggled with pip install on an M1 Mac
Install MySQL 5.6 on CentOS6 [How to specify the version]
Install ag (the silver searcher) [on CentOS / Ubuntu / Mac]