Owncloud, installation and setup

From PCLinuxOShelp Knowledge Base

Jump to: navigation, search

Contents

Installing OwnCloud

From synaptic install owncloud and any other appendices it relies on. We also want to install Webmin.

Now lets start all the needed services required. Open a console/terminal window and as the root user enter the following.


service httpd start

and then press enter, you should see something like this.

[root@localhost owncloud]# service httpd start
apache is already running.
[root@localhost owncloud]#

or

<font color="red"[root@localhost owncloud]#</font> service httpd start
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName [ OK ]
[root@localhost owncloud]#

NOTE: This message 'httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName' is a needed configuration change needed in the /etc/httpd/httpd.conf file. It will not effect the operation of OwnCloud.

Now enter

service mysqld start

and press enter. You should see something like this.

[root@localhost owncloud]# service mysqld start
WARNING: mysql_upgrade should be run (as root). The upgrade from mysql-5.1.55 to mysql-5.1.73 may require it. Starting MySQL: ., [ OK ]
[root@localhost owncloud]#

Again the warning does NOT effect running OwnCloud.


and finally enter

/etc/webmin/start

then press enter. You should see something like this.

[root@localhost owncloud]# /etc/webmin/start
Starting Webmin server in /usr/libexec/webmin
Pre-loaded WebminCore
[root@localhost owncloud]#

Now we have the basics installed and the services running, we can move to setting the mySQL database, users and permissions.


Setting Up MySQL Database, users and permissions using Webmin

Open your favorite web browser and go to http://localhost:10000

This is the Webmin Admin Page

It should ask you for your username and password, the default username is "root: and the password is the root password.


Webmin-login.png


In the left window pane click on Servers and then click on MySql Database Server

Webmin-mainpage.png


Webmin-servers.png


Webmin-mysql.png


Under the MySQL Database section click on "Create a new database" Under "New Database Options" enter your database name. In my example I called mine owncloud702


Database-create.png


Leave everything else blank. Press the "Create" button. You will be returned to the MySQL Database Server Page.

Database-created.png


Under the "Global Options" select "database permissions" Now click on "Create new database permissions"


Database-create-permissions.png


enter the following information.

Under Databases - click the circle in front of Selected and than click on the drop-down list and select the name of your database. In my example my database is called "owncloud702"

Under the Username - click the circle in front of the text box and enter a username for your database. NOTE: this is NOT your username... In my example I entered "owncloud"

Under Hosts - click the circle in front of the text box and enter "localhost"

Under Permissions - select all permissions.

When finished click on "Create"

You should be returned to the Database Creation Page. You should now see your database name listed.


Database-create-permissions1.png


Now click "Return to database list" You will be returned to the MySQL Database Server Main page.

Under "Global Options" click on "User Permissions"

Click on "Create new user"


Database-create-user.png


We now need to create two new users. The first one for access to the database and the second the owncloud user. Neither of these names can be the same.

Under username - click the dot in front of the text box and enter the username of the database. This is the same name a we setup in the previous step. In my example it was "owncloud"

Under Password - enter the password that you want to use.

Under Hosts - click the dot in front of the text box and enter "localhost"

Under Permissions - select all

Press "Create"


Database-create-user1.png


You will be returned to the User Permissions Page

Now we need to add one more user. Repeat the above steps only this time we need to create a username. This name can not be the same as the database owners name. It is also best not to use your own system username. In my example I entered "mycloud" for the username

Fill out the Username, Password, Hosts information. DO NOT select any Permissions. This user does not require then. When you are finished press "Create". Once again you will be returned to the User Permissions page.

You should notice both users have been added. Also note that all your passwords are now encrypted.


Database-create-user2.png


That's it...... Now press "Return to database list"

Now we want to restart the mysql server for our additions to be recognized.

Click on Stop MySQL Server

You should see a page like this


Mysql-stopped.png


Now click on Start MySQL server

If everything goes right you should see the main MySQL server page. Now click Logout in the left hand pane.


Mysql-started.png


Setting up OwnCloud configuration files

Now we want to setup OwnCloud

Point your favorite web browser to http://localhost/owncloud


Owncloud-setup-webpage.png


Under Create and Admin Account

enter the second user we created in the above steps. It this example we created the username "mycloud" and then enter the password you selected for that user.

We need to do is change the path to our Data folder. By default is is set to /var/www/html/owncloud/data. We need to change it to real /var/www/data

Now the final step is to configure the database.

Enter your Database username. This is the first user we created in this example called "owncloud" then enter the password that you chose for this user

Now enter the name you created for this database. In our example it was "owncloud702".


Owncloud-setup-webpage1.png


Do not change anything else. Click on "Finish Setup"

It may take a little while, but if everything was setup properly you should be greeted with this window.


Success.png


Congratulations you are now running owncloud and are currently logged in as the admin.


Some other suggestions

Increasing the file upload size

To increase the file upload size in owncloud you need to change a couple of php variables. There is several ways to make this change.

1. If you have access to the php.ini file you can edit it directly. The php.ini file is located at /etc/php.ini. Any changes to this file need to be done as the root user. Using your favorite text editor and open the php.ini file. You want to search for the following variables

php_value post_max_size
php_value upload_max_filesize

These are set by default a 2M (2MB) just increase the number to whatever size you would like. For example if you want your uploaded file to be 50MB in size that you need your variables to look like this

php_value post_max_size 50M php_value upload_max_filesize 50M

In order for these new values become effective you must restart your web server. In a console/terminal window as root enter the following command

service httpd restart

then press enter. You should see something like this

root@laptop dwmoar]# service httpd restart
Shutting down httpd: [ OK ]
Starting httpd: [ OK ]
[root@laptop dwmoar]#


2. You can also add a .htaccess file to the owncloud root directory. The advantaged to doing this is

a. If you happen to be on a shared hosted system. You can change the operation of php without effecting the whole system. 
   Most shared hosts will not makes these changes, since it will effect all the users on the system.
b. You don't have to mess with your php.ini file. Less chance of messing up you php.ini file.

Adding a .htaccess file is relatively a simple process.

Open your favorite text editor as root and create a .htaccess file with the following information. In my example I will use the nano editor.

[root@laptop dwmoar]# nano .htaccess <--Note the dot in front of htaccess

Than add the following, each on a line by themselves php_value post_max_size 50M
php_value upload_max_filesize 50M

I have set my two variables to 50 MB in size

I than press ctrl & x

Nano will ask me "Save modified buffer. I type in Y (yes) and press enter Then nano will ask "File Name to Write and I enter /var/www/html/owncloud/.htaccess and press enter. The file .htaccess has now been saved in my owncloud directory. I can verify this by doing a listing of my owncloud directory

at the command prompt type this command

ls -la /var/www/html/owncloud

You should see something similar to this

[root@laptop owncloud]# ls -la /var/www/html/owncloud
total 120
drwxr-xr-x 13 apache apache 4096 Dec 21 19:10 ./
drwxr-xr-x 7 root root 4096 Dec 19 15:42 ../
drwxrwxr-x 10 apache apache 4096 Dec 19 15:40 3rdparty/
drwxrwxr-x 15 apache apache 4096 Dec 19 15:40 apps/
-rw-rw-r-- 1 apache apache 246 Nov 21 10:32 AUTHORS
drwxrwxrwx 2 apache apache 4096 Dec 21 19:16 config/
-rw-rw-r-- 1 apache apache 34520 Nov 21 10:32 COPYING-AGPL
-rw-rw-r-- 1 apache apache 567 Nov 21 10:32 COPYING-README
drwxrwxr-x 9 apache apache 4096 Dec 19 15:40 core/
drwxr-xr-x 2 apache apache 4096 Dec 21 19:10 data/
-rw-rw-r-- 1 apache apache 8026 Nov 21 10:32 db_structure.xml
drwxrwxr-x 8 apache apache 4096 Dec 19 15:40 files/
-rw-r--r-- 1 apache apache 315 Dec 19 16:22 .htaccess
-rw-rw-r-- 1 apache apache 3158 Nov 21 10:33 index.php
drwxrwxr-x 27 apache apache 4096 Dec 19 15:40 l10n/
drwxrwxr-x 10 apache apache 4096 Dec 19 15:40 lib/
drwxrwxr-x 2 apache apache 4096 Dec 19 15:40 ocs/
-rw-rw-r-- 1 apache apache 502 Nov 21 10:32 README
drwxrwxr-x 7 apache apache 4096 Dec 19 15:40 search/
drwxrwxr-x 9 apache apache 4096 Dec 19 15:40 settings/
-rw-rw-r-- 1 apache apache 1176 Nov 21 10:32 status.php
lrwxrwxrwx 1 apache apache 42 Dec 19 16:22 .well-known -> /var/www/html/owncloud/apps/user_webfinger/


NOTE: the .htaccess file in the above listing.

For this to take effect the webserver must be restarted. As the root user enter the command

service httpd restart

you should see the following

root@laptop dwmoar]# service httpd restart Shutting down httpd: [ OK ]
Starting httpd: [ OK ]
[root@laptop dwmoar]#


If you are having problems installing owncloud or just have questions, please post them on the PCLinuxOS forum


additional notes

The OwnCloud database can also be setup in several different methods. Such as using the GUI program phpMyAdmin (can be found in the package manager) or from the command line. I used Webmin as this is the program I am most familiar with and I use to administrate all of my web servers with. Be aware that setting up the database using the command line (CLI) is best left to the more knowledgeable user familiar with the CLI and MySQL operational commands.

Personal tools