I love the idea of my files being at my finger tips when I need them no matter where I am… I hate the idea of other people having my files at their finger tips when ever they want them. Good thing there is Owncloud, Owncloud is written in php and if you want you can dig down and check out the core functions as well as make new functionality of your own, this also allows you to see exactly what is happening with your data and see how secure or insecure it is.
This article is going to show you how to do a basic install of Owncloud on Gentoo, this is a simple installation and there are so many security and performance tweaks that can be made that I am going to cover them in another article later. Lets get started..
The first thing that we have to do is get a working Apache and PHP installation.
emerge --ask -jv www-servers/apache ; rc-update add apache2 default
If Apache is running then make sure you stop it
Add Apache to the global USE flags in /etc/portage/make.conf
vi /etc/portage/make.conf #Edit the USE= line to match below, keeping in your other use flags that are already set such as -doc USE="-doc apache2"
Change the default for the /etc/conf.d/apache2 config file as below
vi /etc/conf.d/apache2 #Replace: APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE" #With: APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE -D PHP5"
Now we can install PHP because it will pick up the global Apache USE flag in the make.conf
emerge --ask -jv dev-lang/php
Once it has finished installing you will need to setup your Apache2 module file.
Be sure to start up Apache and then give it a try
Now that we have got a working Apache2 and PHP5 setup we can continue on and setup Owncloud. For this example we are using version 8.1.0 but the steps should be almost identical no matter which version you use, you might just have to swap out the PHP version for a newer one.
First we need to make a change to the package.use file
echo '>=dev-lang/php-5.6.12 sqlite zip xmlwriter pdo gd curl' >> /etc/portage/package.use
Now we should be able to emerge Owncloud
emerge --ask -jv www-apps/owncloud
This will do a rebuild of PHP due to that package.use change we made and then it will start on installing Owncloud. Assuming that all went smoothly you should now be able to restart apache2 and then test your installation.
If you have Firefox installed you can run the following to test your install, if not then you will have to do it from another machine.
Now you can just set a username and password for the admin user and that is it you now have your own cloud!
You will see a warning about sqlite being the database and warning of possible performance issues. If we wanted to we could include mysql as the backend for the system and if you were deploying this in a business or a heavy usage situation then you would want to however, for a home cloud or just some simple testing then sqlite will be fine. You can always decide to change later on, it is as simple as backing up your owncloud data directory, adding a use flag and then running an emerge. Perhaps another article on that later.