New Post has been published on WebSetNet
New Post has been published on http://websetnet.com/how-to-install-owncloud-8-on-a-centos-7-vps-2/
How to install ownCloud 8 on a CentOS 7 VPS
ownCloud is an open source web application for data synchronization and file sharing. The latest version of ownCloud brings improved sharing and collaboration and introduces an improved search, faster ways of getting at your files with favorites and provides extremely quick and easy access to important files.
The installation of ownCloud 8 on a CentOS 7 VPS should take about ten minutes if you follow the very easy steps described below.
Stop the Apache service and disable it to start on server boot:
systemctl stop httpd systemctl disable httpd
Install Nginx and PHP-FPM:
yum install nginx php-fpm php-cli php-gd php-mcrypt php-mysql php-pear php-xml bzip2
Download the latest version of ownCloud available at https://download.owncloud.org/ and extract it to a directory on your server:
cd /opt/ wget https://download.owncloud.org/community/owncloud-8.0.0.tar.bz2 tar xfv owncloud-8.0.0.tar.bz2 mv owncloud /var/www/html
The webserver user (nginx) needs to be able to write to files and directories inside the ‘/var/www/html/owncloud’ directory, so it can easily be accomplished by executing the following command:
chown nginx:nginx -R /var/www/html/owncloud
Edit the ‘/etc/php-fpm.d/www.conf’ configuration file and set user and group to nginx:
sed -i s'/user = apache/user = nginx/' /etc/php-fpm.d/www.conf sed -i s'/group = apache/group = nginx/' /etc/php-fpm.d/www.conf
Create ‘data’ directory outside the document root, so that it is not accessible from the web:
mkdir -p /data chown nginx:nginx /data
ownCloud 8 requires a database, so create a new database using the following commands:
mysql -uroot -p MariaDB [(none)]> create database ownclouddb; MariaDB [(none)]> GRANT ALL PRIVILEGES ON ownclouddb.* TO 'owncloud'@'localhost' IDENTIFIED BY 'your-password'; MariaDB [(none)]> flush privileges; MariaDB [(none)]> quit
It is recommended to secure ownCloud with SSL certificate and force ownCloud using HTTPS to encrypt ownCloud traffic. You can purchase a trusted SSL Certificate, or create a self-signed SSL certificate using:
openssl req -new -x509 -days 365 -nodes -out /etc/nginx/your-domain.com.crt -keyout /etc/nginx/your-domain.com.key chmod 600 /etc/nginx/your-domain.com.crt chmod 600 /etc/nginx/your-domain.com.key
Create a new Nginx server block with the following content:
vi /etc/nginx/sites-available/your-domain.com.conf
server listen 80; server_name your-domain.com;. rewrite ^ https://$server_name$request_uri? permanent; server README) deny all; location / rewrite ^/.well-known/carddav /remote.php/carddav/ redirect; rewrite ^/.well-known/caldav /remote.php/caldav/ redirect; rewrite ^(/core/doc/[^\/]+/)$ $1/index.html; try_files $uri $uri/ index.php; location ~ \.php(?:$
Run the following command to see the ‘session.save_path’ setting:
#cat /etc/php-fpm.d/www.conf | grep session.save_path php_value[session.save_path] = /var/lib/php/session
Change permissions on PHP’s ‘session.save_path’ directory:
chown root:nginx /var/lib/php/session chown -R nginx:nginx /var/lib/php/session/*
Enable the newly created Nginx server block:
mkdir -p /etc/nginx/sites-available mkdir -p /etc/nginx/sites-enabled ln -s /etc/nginx/sites-available/your-domain.com.conf /etc/nginx/sites-enabled/your-domain.com.conf
Edit Nginx’s main configuration file (/etc/nginx/nginx.conf) and add this line:
include /etc/nginx/sites-enabled/*.conf;
to the end of the http block, immediately before the server block:
vi /etc/nginx/nginx.conf
include /etc/nginx/sites-enabled/*.conf;
Optionally, delete the default server block.
Edit the ‘/etc/php-fpm.d/www.conf’ configuration file and change (or comment out) ‘listen = 127.0.0.1:9000′ to ‘listen = /var/run/php5-fpm.sock’ .
vi /etc/php-fpm.d/www.conf
;listen = 127.0.0.1:9000 listen = /var/run/php5-fpm.sock
Restart PHP-FPM and Nginx services for the changes to take effect:
systemctl restart php-fpm systemctl restart nginx
Set PHP-FPM and Nginx to start on server boot:
systemctl enable php-fpm systemctl enable nginx
Open https://your-domain.com in your favorite web browser, create an admin account (set admin username and password), change the ‘data’ directory to ‘/data’ (do not leave the default setting ‘/var/www/html/owncloud/data’), click ‘Storage & database’, select MySQL/MariaDB, enter database info (MariaDB user, password, database and hostname) and click ‘Finish setup’.
That is it, the OwnCloud 8 installation is now complete.














