Home » Categories » Multiple Categories

How To Setup ownCloud 5 On Ubuntu 12.10

ownCloud is an open source Data Storage solution similar to Dropbox or Google Drive. One can grab its source code and install it anywhere he/she wants and thus gain much more control over his/her data.

The latest version of ownCloud as of this writing is 5.0.4 and that version will be installed in this tutorial.

LAMP Stack Setup on a server


First off, we need a LAMP (Linux, Apache, MySQL and PHP) stack in order to run ownCloud 5. Before installing it, we should perform a few system updates and upgrades.
sudo apt-get update
sudo apt-get upgrade

Next, we install the actual LAMP stack with the following command:
sudo apt-get install lamp-server^

Note the "^" character at the end of the package name, it is important to type it for the LAMP stack to be installed properly. The setup will prompt you for the MySQL root password, be sure to enter something sensible and easy to remember.

That's it, now we have a fully working LAMP stack on our server.

Setting Up MySQL and MySQL Database


Although ownCloud can use SQLite to store its data, in this tutorial, we will use MySQL database for ownCloud's internal data as MySQL is way faster than SQLite.

Type the following to run MySQL secure installation:
sudo mysql_secure_installation

It will prompt you for your MySQL root password. Enter the password you entered upon installation of LAMP stack.
It will ask you to change root password, type "n" for no.
It will ask you to remove anonymous users, type "y" for yes.
It will ask you to disallow remote root logins, type "y" for yes.
It will ask you to remove test database and access to it, type "y" for yes.
It will ask you to reload privilege tables, type "y" for yes.

Now we have a secure MySQL installation in place.

Installing Prerequisites For ownCloud


Before we can fully utilize ownCloud, we need to install additional libraries that will be used by ownCloud. Execute the following:
sudo apt-get install php5-gd php-xml-parser php5-intl smbclient curl libcurl3 php5-curl

Ubuntu will install additional libraries, and now we have fulfilled all system requirements for ownCloud to function.

ownCloud uses Apache's .htaccess files (you can find more information on .htaccesshere) for security purposes. However, in order to use them, we need to enable two apache modules and edit the apache configuration to allow for the .htaccess file.

Now we need to enable mod_rewrite and mod_headers, the Apache2 modules that are needed for ownCloud to function normally.

The mentioned two modules are used for URL rewrite rules, that is, they help Apache2 rewrite URLs of a certain web site in a proper way. mod_headers module is used for controlling HTTP request and response headers.

To enable mod_rewrite and mod_headers, type the following:
sudo a2enmod rewrite
sudo a2enmod headers

Additionally, we have to change Apache2 config file in order for ownCloud rewrite rules to work properly. Execute the following:
sudo nano /etc/apache2/sites-available/default

There, find "<Directory /var/www/>" section and change the following:
AllowOverride None
to
AllowOverride All

Hit Ctrl + X, then Y, and then Enter to save the changes.

Now we need to restart Apache2 for changes to take effect:
sudo service apache2 restart

That's it, proceed to the next step.

Downloading ownCloud Source Files and Installing ownCloud 5


Now we need to download the source files of ownCloud 5 and place them in the corresponding directory in order for a web server to be able to serve requests properly.

To download ownCloud 5.0.4 source files, execute the following:
wget http://download.owncloud.org/community/owncloud-latest.tar.bz2

It will download the latest version of ownCloud 5. Now we need to extract the archive. Execute the following:
tar -xjf owncloud-latest.tar.bz2

Now we need to move ownCloud source files in the appropriate directory. Execute the following:
mv owncloud /var/www

Having ownCloud source files in the right place is nice, but we have to change a few folder permissions for ownCloud to function normally. Execute the following:
cd /var/www
sudo chown -R www-data:www-data owncloud

Setting Up a MySQL Database


We're almost done, there's only one thing left to do before we begin installation - setting up a proper MySQL database.

First, log in to MySQL with the following command:
mysql -u root -p

It will prompt you for root password, enter the one you entered upon installing LAMP stack.

Next, create a new database with the following command:
CREATE DATABASE owncloud;

Then assign a new user with proper privileges to the new database:
GRANT ALL ON owncloud.* TO 'owncloud'@'localhost' IDENTIFIED BY 'some_password';

Be sure to replace "some_password" with the actual password you desire for your MySQL database.

Believe it or not, we're done! Type "quit" to exit MySQL interface and point your browser to http://fqdn-of-your-panel.tld/owncloud to access ownCloud 5 installation.

Be sure to replace "fqdn-of-your-panel.tld" with the actual FQDN of your panel.

Then, after the installation dialog opens, fill in the details for the admin account. Next, enter the MySQL database details as you set them up in the previous step and click Finish Setup.

You've reached the end of the tutorial! Enjoy your new ownCloud 5 installation.
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
How To Import and Export Databases and Reset a Root Password in MySQL
Viewed 2893 times since Thu, Dec 26, 2013
How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu
Viewed 6628 times since Thu, Jan 2, 2014
How To Install (LEMP) nginx, MySQL, PHP stack on Arch Linux
Viewed 13592 times since Sun, Dec 29, 2013
How To Create An Off-Site Backup Of Your Site With Rsync On Centos 6
Viewed 5778 times since Sat, Jan 4, 2014
How To Configure Secure Updates and Installations in WordPress on Ubuntu
Viewed 5203 times since Sat, Jan 4, 2014
How to Setup Additional Entropy for Cloud Servers Using Haveged
Viewed 2524 times since Sat, Jan 4, 2014
How To Use CakePHP to Create a Small Web Application
Viewed 3070 times since Fri, Jan 3, 2014
How To Launch Your Site on a New Ubuntu 12.04 Server with LAMP, SFTP, and DNS
Viewed 2561 times since Thu, Dec 26, 2013
How To Install nginx on Ubuntu 12.04 LTS
Viewed 2791 times since Tue, Dec 24, 2013