{"id":798,"date":"2011-08-30T08:24:20","date_gmt":"2011-08-30T13:24:20","guid":{"rendered":"http:\/\/it.thelibrarie.com\/weblog\/?p=798"},"modified":"2012-02-27T11:45:36","modified_gmt":"2012-02-27T16:45:36","slug":"owncloud-ubuntu","status":"publish","type":"post","link":"https:\/\/it.thelibrarie.com\/weblog\/2011\/08\/owncloud-ubuntu\/","title":{"rendered":"Owncloud Ubuntu"},"content":{"rendered":"<p>I was recently tasked again to come up with a better solution than using dropbox.  iFolder is great when it was working, at least from an IT perspective.  The end users thought it was a little bit bulky and wanted something a little easier to use and understand.  That&#8217;s when I saw owncloud &#8211; It had all the features of webdav without many of the headaches.<\/p>\n<p>Owncloud is opensource &#8211; they even have packages for Ubuntu!  I was excited.<\/p>\n<p><code>apt-get install mp3info curl libcurl3 libcurl3-dev php5-curl zip build-essential<\/code><br \/>\n<code>wget http:\/\/owncloud.org\/releases\/owncloud-1.2.tar.bz2<\/code><br \/>\n<code>tar xvjf owncloud-1.2.tar.bz2<\/code><br \/>\n<code>mv owncloud \/var\/www\/<\/code><br \/>\n<code>chown -R www-data:www-data owncloud\/<\/code><br \/>\n**EDIT2** it&#8217;s now up to final 2.0 http:\/\/owncloud.org\/releases\/owncloud-2.tar.bz2<\/p>\n<p>Browser to http:\/\/serveripaddress\/owncloud<br \/>\nThere is no LDAP setup quite yet.  Maybe next revision?<\/p>\n<p>Since I wanted to connect a windows machine to this server as a test, I setup a user and then attempted to connect to the webdav.<br \/>\nUnfortunately we require another piece of software to be installed to support owncloud:<br \/>\n<a href=\"http:\/\/www.netdrive.net\/\" target=\"_blank\">http:\/\/www.netdrive.net\/<\/a><br \/>\nNetDrive is free for personal use.  Webdrive, a variant of NetDrive, is not free.  If this gets approved by the PTB, then we&#8217;ll end up buying maybe 25 licenses (for developers).<\/p>\n<p>After the install of netdrive and a reboot, you can connect to your owncloud server!<br \/>\nYou may have noticed on the http:\/\/serveripaddress\/owncloud site when you logged in as the administrator, you can see at the very bottom of the page:<br \/>\n&#8220;Hint: Mount it via webdav like this: webdav:\/\/address\/to\/your\/webdav\/here\/owncloud.php&#8221;<br \/>\nYou will need that entire address to connect using NetDrive.<br \/>\n<a href=\"http:\/\/it.thelibrarie.com\/weblog\/wp-content\/uploads\/2011\/08\/owndrive.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/it.thelibrarie.com\/weblog\/wp-content\/uploads\/2011\/08\/owndrive-150x150.png\" alt=\"\" title=\"owndrive\" width=\"150\" height=\"150\" class=\"alignnone size-thumbnail wp-image-799\" \/><\/a><\/p>\n<p>After connection you will see your webdav drive as a shared drive on My Computer.<\/p>\n<p>***EDIT***<br \/>\nTurns out that you don&#8217;t require this software.  You can just edit a registry key and add it to you windows 7 machine without issues:<br \/>\nStart the WebClient service<br \/>\nAdd the following key in regedit<br \/>\nHKLM\\SYSTEM\\CurrentControlSet\\services\\WebClient\\Parameters<br \/>\n&#8220;BasicAuthLevel&#8221; set to &#8220;2&#8221;<\/p>\n<p>Since this is an external\/internal facing server, I had to secure it up a bit.<br \/>\nFirewall rule only allowing ports 80, and 443. SSH can be accessed internally only.<\/p>\n<p>I edited the hosts file to deny all, and only allow certain ranges for my networks:<br \/>\nHosts.deny<\/p>\n<blockquote><p>sshd:all<\/p><\/blockquote>\n<p>Hosts.allow<\/p>\n<blockquote><p>sshd:internaliprange\/24 publicip anotherip<\/p><\/blockquote>\n<p><code>nano \/etc\/fail2ban\/filter.d\/apache-owncloud.conf<\/code><\/p>\n<blockquote><p># Fail2Ban configuration file<br \/>\n# Author: TheLibrarie.com<br \/>\n# $Revision: 001 $<br \/>\n#<\/p>\n<p>[Definition]<\/p>\n<p><code>failregex = <HOST> -.* 401 499<\/code><br \/>\nOR<br \/>\n<code>failregex = <HOST> -.*POST.*\/index\\.php<\/code><br \/>\nignoreregex =<\/p><\/blockquote>\n<p>Test with the regex<br \/>\n<code>fail2ban-regex \/var\/log\/apache2\/access.log \/etc\/fail2ban\/filter.d\/apache-owncloud.conf<\/code><\/p>\n<p>As that worked, I put the following in my \/etc\/fail2ban\/jail.local<\/p>\n<blockquote><p>[owncloud]<br \/>\nenabled = true<br \/>\nport = http,https<br \/>\nfilter = apache-owncloud<br \/>\nlogpath = \/var\/log\/apache\/access.log<br \/>\nmaxretry = 5<\/p><\/blockquote>\n<p><code>\/etc\/init.d\/fail2ban restart<\/code><\/p>\n<p>I also noticed that someone could simply navigate to http:\/\/servername\/owncloud\/data and see all the usernames and then drill down into all of the files.  Obviously a huge issue.<br \/>\nI edited \/etc\/apache2\/sites-available\/default to disallow directory listing for the entire site:<br \/>\n<code>nano \/etc\/apache2\/sites-available\/default<\/code><br \/>\nUnder &#8220;Directory \/var\/www\/>&#8221; Change the following line from:<br \/>\n<code>Options Indexes FollowSymLinks MultiViews<\/code><br \/>\nTo<br \/>\n<code>Options -Indexes IncludesNOEXEC FollowSymLinks MultiViews<\/code><br \/>\n<code>apache2ctl restart<\/code><\/p>\n<p>Final Thoughts:<br \/>\nAfter I run through some more testing on my end, I will unleash it to the QA department to hit the crap out of it.  If it still passes testing, I&#8217;ll implement SSL.  And then test again.  Then release to the masses.<\/p>\n<p>**EDIT3**<br \/>\nI&#8217;ve installed the 2b1 beta &#8211; there is LDAP, but I haven&#8217;t configured just yet.  I had to write this down before I forget:<br \/>\nChange PHP to allow larger than 2MB file uploads<\/p>\n<blockquote><p><code>nano \/etc\/php5\/apache2\/php.ini<\/code><br \/>\nSearch for &#8220;2m&#8221;<br \/>\nChange to 10m<br \/>\nSave, quit, restart apache<\/p><\/blockquote>\n<p>**EDIT4**<br \/>\nIE9 has some issues with compatibility mode for this software.  I had to add this to the html meta portion (:<br \/>\n<code>meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\" \/<\/code><\/p>\n<p>**EDIT5**<br \/>\nI was having problems with downloading certain docx files &#8211; the server was thinking these were actually compressed archives.  I had to edit the mimetypes.fixlist.php file with the following:<br \/>\n<code>nano \/owncloud\/lib\/mimetypes.fixlist.php<\/code><br \/>\n<code>'docx'=>'application\/msword',<\/code><br \/>\nETC &#8211; add any other applications you require<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was recently tasked again to come up with a better solution than using dropbox. iFolder is great when it was working, at least from an IT perspective. The end users thought it was a little bit bulky and wanted something a little easier to use and understand. That&#8217;s when I saw owncloud &#8211; It &hellip; <a href=\"https:\/\/it.thelibrarie.com\/weblog\/2011\/08\/owncloud-ubuntu\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Owncloud Ubuntu<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,8],"tags":[],"class_list":["post-798","post","type-post","status-publish","format-standard","hentry","category-linux","category-microsoft"],"_links":{"self":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/798","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/comments?post=798"}],"version-history":[{"count":14,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/798\/revisions"}],"predecessor-version":[{"id":922,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/798\/revisions\/922"}],"wp:attachment":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/media?parent=798"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/categories?post=798"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/tags?post=798"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}