OwnCloud-7

Own-Cloud-7-On-CentOS
====================


# cd /etc/yum.repos.d/
# wget http://download.opensuse.org/repositories/isv:ownCloud:community/CentOS_CentOS-6/isv:ownCloud:community.repo


# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

# yum repolist


# yum install php-mysql php-json php-xml php-mbstring php-zip php-gd curl php-curl php-pdo# yum --enablerepo=isv_ownCloud_community -y install owncloud


(ownCloud will install Apache with its dependency, if it doesn't get installed automatically manually install httpd)

# yum install httpd
# chkconfig --levels 235 httpd on
# /etc/init.d/httpd start



# iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
# iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT


Install and Configure MySQL

# yum install mysql-server
# chkconfig --levels 235 mysqld on
# /etc/init.d/mysqld start

# mysql_secure_installation


# mysql -u root -p
CREATE DATABASE owncloud;
GRANT ALL ON owncloud.* to 'owncloud'@'localhost' IDENTIFIED BY 'password';
exit

#
# chown -R apache:apache /var/www/html/owncloud/ 
# chmod 777 /var/www/html/owncloud/config/

Edit file “/etc/httpd/conf/httpd.conf”---->Optional
# vi /etc/httpd/conf/httpd.conf
[...] 
 AllowOverride All 
[...]
#
# service mysql restart 
# service httpd restart

Access OwnCloud at http://server-ip-address/owncloud

username:Desired Admin Username
password:Password for Admin User

dbusername:owncloud
dbname:owncloud
password:password


Php and Kernel Version....
-------------------------------------------
# rpm -qa|grep php
php-common-5.4.33-2.el6.remi.x86_64
php-5.4.33-2.el6.remi.x86_64
#
# uname -r
2.6.32-431.29.2.el6.x86_64

#


ownCloud 7 On Ubuntu 14.04
=====================

# cd /tmp
# wget http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_14.04/Release.key
# apt-key add - < Release.key
#sh -c "echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/xUbuntu_14.04/ /' >> /etc/apt/sources.list.d/owncloud.list"

# apt-get update
# apt-get install apache2 libapache2-mod-php5 php5-gd php5-json php5-mysql php5-curl php5-intl php5-mcrypt php5-imagick


# apt-get install owncloud

# chown -R www-data:www-data /var/www/owncloud

# apt-get install mariadb-server
# mysql_secure_installation

# mysql -u root -p
CREATE DATABASE owncloud;
GRANT ALL ON owncloud.* to 'owncloud'@'localhost' IDENTIFIED BY 'password';
exit

#


 
Access OwnCloud at http://server-ip-address/owncloud


Click on Storage & database:
Now select MySQL/MariaDB and create an admin account

username:Desired Admin Username
password:Password for Admin User

dbusername:owncloud
dbname:owncloud
password:password



======================================
Increase Upload File size in OwnCloud
======================================

# cd /var/www/html/owncloud
# vi .htaccess

...

php_value upload_max_filesize 6G
php_value post_max_size 6G
php_value memory_limit 512M
php_value mbstring.func_overload 0
php_value output_buffering 0
...

#

# vi /etc/php.ini
....
max_execution_time = -1    
max_input_time = -1
output_buffering = 0
...

#


Custome Store Location for OwnCloud
=====================================


# service httpd stop

# mkdir -p /OwnCloud/Server
# ls -ld /var/www/html/owncloud
# chmod 750 /OwnCloud/Server
# chown root:apache /OwnCloud/Server 

# cp -rp /var/www/html/owncloud/* /OwnCloud/Server/
# cp -rp /var/www/html/owncloud/.htaccess /OwnCloud/Server
# rm -r /var/www/html/owncloud

# ln -s /OwnCloud/Server/ /var/www/html/owncloud


# service httpd start


Error While opening owncloud URL
===========================



Error accessing from an untrusted domain ..While opening owncloud URL


Check if owncloud server IP changed/not ,if changed Add/Replace New IP Address in the
'/var/www/html/owncloud/config/config.php' file in 'trusted_domains' section

# vi /var/www/html/owncloud/config/config.php
...
$CONFIG = array (
  'instanceid' => 'oc207f07d85d',
  'passwordsalt' => '5a05bcd2f651f281cdd1d6db16ef36',
  'trusted_domains' =>
  array (
    0 => '192.168.1.8', '192.168.1.9',
  ),
  'datadirectory' => '/var/www/html/owncloud/data',
  'dbtype' => 'mysql',
  'version' => '7.0.2.1',
  'dbname' => 'owncloud',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'owncloud',
  'dbpassword' => 'password',
  'installed' => true,
);
...

#

Virtual IP-Address/Multi-IP System
-----------------------------------------------------


To Access owncloud from second ip change config.php 'trusted_domains' parameter as follows
(where 192.168.1.22 is virtual ip of eth0:1 and 'v-cloud.com' mapped host entry in /etc/hosts file)


# vi  /owncloud/config/config.php
$CONFIG = array (
  'instanceid' => 'ocd36d93faab',
  'passwordsalt' => 'd1d0a31e54aa523fe898266f904c75',
  'trusted_domains' =>
  array (
    0 => '192.168.1.22',
    1 => 'v-cloud.com',
  ),
.......

#