How to install Owncloud 6 on Ubuntu 14.04 LTS Server
In this tutorial we will learn about, how to install Owncloud 6 on Ubuntu 14.04 LTS Server. Owncloud now a days very popular in Internet World. It is one the awesome alternate for Drop Box. Moreover it is free and Open Source software, primarily using for ‘file hosting’.
In case you are looking for creating your Own file hosting Server, Owncloud is more suitable for you. It is free and Open source, has many great features.
You can find many apps developed by Owncloud team and many volunteers in owncloud apps repository. You can also write the apps for Owncloud and submit in the repository . It will be great help to Owncloud community.
Currently, Owncloud has released version 6 series. You can read about the new features of Owncloud 6 from this link.
Installing Owncloud 6 on Ubuntu 14.04 LTS Server (Trusty Tahr)
In this practical, the installation has been done on Single Server, where Owncloud, Apache and MySQL are installed.
Requirements :
(1) Database Server : MySQL (version 5.6)
(2) Web Server : Apache (version 2.4)
(3) Operating System : Ubuntu 14.04 LTS Server Edition
(4) Web Application : Owncloud version 6.x
(5) Knowledge of IP based and Name based Virtual Hosting in Apache
(1) Database Server : MySQL (version 5.6)
(2) Web Server : Apache (version 2.4)
(3) Operating System : Ubuntu 14.04 LTS Server Edition
(4) Web Application : Owncloud version 6.x
(5) Knowledge of IP based and Name based Virtual Hosting in Apache
Follow the given below steps to install Owncloud 6 on Ubuntu 14.04 LTS (Trusty Tahr)
(Step 1): Install MySQL Server
You can install MySQL 5.6 on Ubuntu 14.04 LTS . At the time of writing this post, it is the latest and stable release. The latest MySQL 5.6 version is available in Ubuntu repository, hence it can be installed via using apt-get command .
1
2
|
sudo apt-get update
sudo apt-get install mysql-server-5.6
|
(Step 2) : Create MySQL user for Owncloud server
Now create mysql user for Owncloud server. The MySQL user will help the Owncloud Server to connect with Database. We also give full privilege to this MySQL user on Owncloud’s database.
The given below are the details which will create in MySQL Server.
Database Name : owncloud
MySQL User Name : ownclouduser
MySQL User’s Password : Password
MySQL User Name : ownclouduser
MySQL User’s Password : Password
Login into MySQL Server with root user (Use MySQL root password here).
1
2
3
4
5
6
7
8
9
10
11
|
mysql -u root -p
After login you will get the mysql prompt like this
mysql >
Now create a user and set the password. Use strong password
mysql> CREATE USER 'ownclouduser'@'localhost' IDENTIFIED BY 'Password';
create database called owncloud
mysql> create database owncloud;
Grant privileges to owncloud user in owncloud database
mysql> GRANT ALL ON owncloud.* TO 'ownclouduser'@'localhost';
mysql> flush privileges;
mysql> exit
|
( Step 3 ): Install Apache and PHP
For web server requirement, we are installing Apache . The Owncloud is PHP based application, hence we will install PHP version 5 . To connect PHP code with MySQL database, we will install the module named as php5-mysql.
1
|
sudo apt-get install apache2 php5 php5-mysql
|
(Step 4 ) : Enable rewrite module
The Owncloud application has .htaccess file which has some rewrite rules. Use below given command to enable rewrite module
1
2
3
|
sudo a2enmod rewrite
sudo service apache2 restart
|
(Step 5 ): Install Owncloud Server
Now in this step we will install owncloud package on Ubuntu 14.04 LTS
1
2
3
4
5
6
7
8
|
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/xUbuntu_14.04/ /' >> /etc/apt/sources.list.d/owncloud.list"
wget http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_14.04/Release.key
sudo apt-key add - < Release.key
sudo apt-get update
sudo apt-get install owncloud
|
( Step 6 ): Move Owncloud data directory
By default, after installation of Owncloud its data directory is saved in /var/www .
In Ubuntu 14.04, default Apache 2.4 is shipped. You can see defualt DocumentRoot as /var/www/html in Apache 2.4 (Ubuntu 14.04 LTS) , which is different than previous Ubuntu version (Earlier it was only /var/www)
Move the Owncloud data directory to /var/www/html
1
|
sudo mv /var/www/owncloud /var/www/html
|
(Step 7 ) : Configuring owncloud.conf file
By default, you will get owncloud.conf file in /etc/apache2/conf.d after owncloud installation.
Here we will do some changes, so that it should work with Apache 2.4 version
Take backup of original owncloud.conf file.
1
|
sudo cp -p /etc/apache2/conf.d/owncloud.conf /etc/apache2/conf.d/owncloud.conf.orig.`date +%F`
|
Move owncloud.conf file to /etc/apache2/sites-enabled
1
|
mv /etc/apache2/conf.d/owncloud.conf /etc/apache2/sites-enabled
|
Unlink the default Apache Configuration file, known as 000-default.conf
Note: 000-default.conf is softlink
Note: 000-default.conf is softlink
1
|
sudo unlink /etc/apache2/sites-enabled/000-default.conf
|
Edit the owncloud.conf file as given below .
YOU HAVE TWO OPTIONS EITHER CONFIGURE WITH IP BASED VIRTUAL HOST or NAME BASED VIRTUAL HOST.
I AM WRITING BOTH METHOD. YOU HAVE TO SELECT ONLY ONE METHOD TO EDIT owncloud.conf FILE
I AM WRITING BOTH METHOD. YOU HAVE TO SELECT ONLY ONE METHOD TO EDIT owncloud.conf FILE
IP based Virtual Host
For configuring Apache we use IP Address of Server here. Which you can obtain by using
ifconfig
command
1
|
sudo vi /etc/apache2/sites-enabled/owncloud.conf
|
Paste given below contents in owncloud.conf file. NOTE: Replace 192.168.56.101 with your Server IP Address
1
2
3
4
5
6
7
8
9
10
11
12
13
|
<VirtualHost 192.168.56.101:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/owncloud
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html/owncloud>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
|
OR
Name based Virtual Hosting
In case you have Domain name, you can use Name based Virtual Hosting .
1
|
sudo vi /etc/apache2/sites-enabled/owncloud.conf
|
Paste given below contents in owncloud.conf file. NOTE: Replace owncloud.example.com with your domain name.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/owncloud
ServerName owncloud.example.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html/owncloud>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
|
(Step 8): Restart apache service
After doing configuration, restart apache service.
1
|
sudo service apache2 restart
|
( Step 8 ): Installing Owncloud through Web Interface
* Open the Owncloud URL in Web Browser .
* Give Owncloud Dashboard administrator user name. We have given the name as “admin”
* Click on Advanced tab , it will open the Database option. Click on MySQL tab. And give the MySQL credentials, which we have already set up in Step 2
Then, finally click on Finish setup button. And that is it, you are into Owncloud Admin dashboard.
Then, finally click on Finish setup button. And that is it, you are into Owncloud Admin dashboard.
We would like you to explore awesome features of Owncloud. You can give your contribution to Owncloudproject, it will be wonderful gift to others.
No comments:
Post a Comment