Difference between revisions of "OwnCloud"

From PC-BSD Wiki
Jump to: navigation, search
(Configuring ownCloud)
(Configuring ownCloud)
Line 57: Line 57:
  '''cd /usr/local/www/apache22/data'''
  '''cd /usr/local/www/apache22/data'''
  '''fetch http://download.owncloud.org/releases/owncloud-4.0.7.tar.bz2'''
  '''fetch http://download.owncloud.org/releases/owncloud-4.0.7.tar.bz2'''
  '''tar xvf owncloud-4.0.7.tar.bz2'''
  '''tar xzvf owncloud-4.0.7.tar.bz2'''
  '''chown -R www:www owncloud'''
  '''chown -R www:www owncloud'''

Revision as of 11:02, 5 September 2012

(Sorry for the inconvenience)


ownCloud[1] is open source software that allows you to create your own cloud storage. This allows you to share data, contacts, and calendars with the devices and users that you define.

In PC-BSD®, you can create your own cloud service by installing ownCloud into a traditional jail that you created using Warden®, or into a TrueOS® installation. For security reasons, it is recommended to not install ownCloud directly onto a desktop installation as the web and database services it requires may expose the desktop to security vulnerabilities. If you are installing ownCloud on your desktop, a traditional jail is recommended as it isolates the software installed into the jail from the desktop system.

Install and Start the Required Services

If you are installing ownCloud into a traditional jail, make sure that the jail is started, then go to the Packages tab of the jail as seen in Figure 9.9a.

Figure 9.9a: Install the Required Packages


Check the boxes for Database-Servers ➜ MySQL, Languages ➜ PHP, and Web-Servers ➜ Apache, then click the Apply button to install these packages.

Once installed, go to Tools ➜ Service Manager which will open the screen shown in Figure 9.9b. Highlight the apache22 service and click the "Enable Service" button and then the "Start" button. Repeat for the mysql service.

Figure 9.9b: Start the Required Services


Verify that you can reach the web server by typing the IP address of the jail into a web browser. You should receive a "It works!" message. You will need to first allow incoming TCP port 80 on the jail interface using Firewall Manager if you use a web browser on a different computer.

If you are installing ownCloud onto a TrueOS™ system, you will need to create the jail and install the dependencies from the command line. When creating the jail, specify the jail IP address and hostname as seen in this example:

warden create owncloudjail --startauto
pc-metapkgmanager --pkgset warden --chroot /usr/jails/ add MySQL,Apache,PHP

Once the software is installed, access the jail by its IP address in order to edit the /etc/rc.conf file within the jail so that the required services start when the jail is available:

warden chroot
vi /etc/rc.conf

Add these two lines to that file:


Save your edits then start the services:

usr/local/etc/rc.d/apache22 start
/usr/local/etc/rc.d/mysql-server start

Verify that you can reach the web server by typing the IP address of the jail into a web browser. You should receive a "It works!" message. You will need to first edit /etc/pf.conf in order to allow incoming TCP port 80 using if you use a web browser on a different computer. An example would be to add a line to the "Nic specific rules" section:

pass in quick on re0 proto tcp from any to (re0) port 80 keep state

You may wish to modify "any" to the machines on your network and "re0" should be replaced with the interface used by the jail.

Configuring ownCloud

You are now ready to download and configure ownCloud. If you are using a traditional jail on your desktop, go to Tools -> Launch Terminal to access the jail's command line. If you are using TrueOS™, use the warden chroot command to access the command line of the jail.

Once at the command line of the jail, download ownCloud into the Apache data directory:

cd /usr/local/www/apache22/data
fetch http://download.owncloud.org/releases/owncloud-4.0.7.tar.bz2
tar xzvf owncloud-4.0.7.tar.bz2
chown -R www:www owncloud

Next, configure the MySQL database, substituting "ocuser" and "mypass" with the username and password that you wish to use:

mysql -u root
mysql> create database owncloud;
mysql> grant all on owncloud.* to ocuser@localhost identified by "mypass";
mysql> quit

Next, add the required PHP options to Apache. Open /usr/local/etc/apache22/httpd.conf in an editor and look for this line:

#AddType application/x-gzip .tgz

Add the following lines directly below that line:

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Next, look for the following section:

<IfModule dir_module>
   DirectoryIndex index.html

and change it to:

<IfModule dir_module>
   DirectoryIndex index.html index.php

Save your changes and restart Apache:

/usr/local/etc/rc.d/apache22 restart

Test your changes from a web browser by adding "owncloud" to the end of the IP address of the jail. For example, type ''''<nowiki>. You should see the setup screen shown in Figure 9.9c. '''Figure 9.9c: ownCloud Initial Setup Screen''' [[File:Owncloud2.png]] Create a new user and password, then click the advanced button. In the advanced settings, input the MySQL username, password, and database name that you configured. Click the “Finish” button to finalize the ownCloud configuration and enter your new cloud interface. <noinclude>{{refheading}}</noinclude> <noinclude> [[category:handbook]] [[category:Common Tasks]] [[category:ownCloud]] </noinclude>

Cite error: <ref> tags exist, but no <references/> tag was found