SH1NU11b1

cloud9.txt

Nov 29th, 2016
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.32 KB | None | 0 0
  1. OwnCloud:
  2. Share and sync
  3. Take charge of your data by creating your own cloud service.
  4. Do you want the convenience of an omnipresent
  5. Dropbox-like storage service without doling out wads
  6. of cash and your data to a third party? OwnCloud is
  7. one of the best pieces of open source software to help you
  8. create your own private and protected cloud-sharing service.
  9. Using OwnCloud, you can sync and share your private data,
  10. and access it from any device connected to the internet. For
  11. added security, OwnCloud can also encrypt your files. The
  12. software can handle files in a variety of formats and you can
  13. extend its usability by adding a number of other apps.
  14. As with other online cloud storage services, you can sync
  15. files on OwnCloud either using the web browser or a desktop
  16. client on Windows, Mac and Linux, as well as mobile clients
  17. for Android and iOS devices. Furthermore, your OwnCloud
  18. server keeps older versions of all changed files and enables
  19. you to revert to an older version without much effort.
  20. In this tutorial, we’re setting up the OwnCloud server on
  21. top of the Raspbian distribution for the Raspberry Pi. The
  22. server software has modest requirements and it performs
  23. well even on the Raspberry Pi Model B in certain small and
  24. controlled environments, such as your house. You also need a
  25. USB portable disk for storing the data. For maximum
  26. reliability and performance, it’s best to use a self-powered
  27. disk that doesn’t draw power from the Raspberry Pi. Before
  28. OwnCloud has a well designed browser-based dashboard
  29. that exposes a lot of features but is still easy to operate.
  30. To view some
  31. stats on the APC
  32. cache, copy its
  33. script to your
  34. DocumentRoot
  35. with cp /usr/
  36. share/doc/phpapc/
  37. apc.php /var/
  38. www/ and then
  39. view it in the
  40. web browser on
  41. http://localhost/
  42. apc.php.
  43. Quick
  44. tip
  45. COMPATIBILITY
  46. All Pi’s
  47. best on
  48. Pi 2
  49. WorldMags.net
  50. WorldMags.net
  51. Projects
  52. Raspberry Pi Projects | 53
  53. snappier. Pull in the components with sudo apt-get install
  54. php-apc and then open APC’s configuration file and add:
  55. $ sudo nano /etc/php5/conf.d/20-apc.ini
  56. extension=apc.so
  57. apc.enabled=1
  58. apc.shm_size=12M
  59. Then bring the cache online by restarting Apache with:
  60. $ sudo apachectl restart.
  61. Now that the server is set up and configured, it’s time to
  62. prepare the storage medium. Plug the USB disk into the Pi
  63. and enter sudo blkid in a terminal. The USB disk is probably
  64. be mounted as /dev/sda1 if you don’t have any other USB
  65. disks attached. Make a note of the corresponding UUID,
  66. which looks something like 6154-F660. Now create a
  67. directory to mount this drive using:
  68. $ sudo mkdir /media/owncloud
  69. Then mount the drive with:
  70. $ sudo mount -t vfat -o umask=007,auto,uid=33,gid=33 /dev/
  71. sda1 /media/owncloud
  72. The above command assumes your drive has a FAT32
  73. filesystem and is mounted at /dev/sda1. Once the drive is
  74. mounted correctly, you can edit the fstab file to make sure
  75. it’s automatically mounted:
  76. $ sudo nano /etc/fstab
  77. UUID=6154-F660 /media/owncloud/ vfat
  78. rw,umask=007,auto,uid=33,gid=33 0 0
  79. Configure the cloud
  80. That’s all there is to installing the server components. You’re
  81. now all set to configure your cloud. Launch a web browser
  82. and navigate to the OwnCloud installation instance at
  83. 192.168.3.111/owncloud. Because this is a brand new
  84. installation, you are asked to create a new user account for
  85. the OwnCloud administrator.
  86. Next, we need to ask OwnCloud to use the MySQL
  87. database and store files under the mounted USB drive. For
  88. this, click on the Storage & Database pull-down menu. Then
  89. enter /media/owncloud/data in the text box corresponding
  90. to the Data Folder entry and select the MySQL/MariaDB
  91. option in the Database section. You’re asked to enter the
  92. connection details of the database serve, so just enter
  93. localhost as the host and root as the username, along with
  94. the password you configured when the database was pulled
  95. in along with OwnCloud.
  96. That’s it – you’ve set up OwnCloud. You can now log into
  97. your cloud server as the administrator using the credentials
  98. you have just created for OwnCloud. While you can start using
  99. the server to upload and download files straight away, let’s
  100. take a moment to get the house in order. For starters, when
  101. you log into the OwnCloud server, click on the pull-down
  102. menu next to your username and click on Personal. Here you
  103. can change the settings for your account, such as the login
  104. password and display name. You can also add a profile picture
  105. and configure how you would like to be notified about certain
  106. actions. Also, if your cloud is going to be used by multiple
  107. people, it’s advisable to add users and organise them into
  108. different groups. To do this, select the Users option from the
  109. pull-down menu. While adding users, you can restrict their
  110. storage space and even share your admin responsibilities
  111. with other users, and mark certain users as admins for a
  112. particular group.
  113. Upload and share files
  114. You’re now all set to upload data into your OwnCloud server.
  115. After you’ve logged in, you are in the Files section. To upload a
  116. file, click on the arrow button. To organise files into folders,
  117. click on the button labelled New, and select the Folder option
  118. from the drop-down menu to create a new folder.
  119. If you’ve uploaded a file in a format that OwnCloud
  120. understands, you can click on its name to view and edit the
  121. file. OwnCloud can visualise the data it houses in different
  122. views. For example, click on the Files pull-down menu in the
  123. top-left corner of the interface, and select the Pictures option.
  124. This view helps you view images in your cloud by filtering out
  125. all other types of content.
  126. Another way to upload files to the server is by using the
  127. WebDAV protocol, with which you can access your cloud
  128. server from your file manager. For example, in the Files file
  129. manager, press Ctrl+L to enable the location area. Here you
  130. can point to your OwnCloud server, such as
  131. dav://192.168.3.111/owncloud/remote.php/webdav.
  132. Once authenticated, the OwnCloud storage is mounted and
  133. you can interact with it just like a regular folder.
  134. To share uploaded files, go to the Files section in the web
  135. interface and hover over the file or folder you wish to share.
  136. This displays several options, including Share, which enables
  137. you to select which users or groups you want to share the
  138. item with and whether you want to give them permission to
  139. edit and delete the files. You can also share with someone
  140. who isn’t registered with your OwnCloud server. Click on
  141. Share with Link, and OwnCloud displays a link to the item that
  142. you can share with anybody on the internet. You can also
  143. password-protect the link and set an expiration date.
  144. While you can interact with the cloud using the web
  145. interface, it’s far easier to use one of its official clients.
  146. OwnCloud has clients for all the major desktop and mobile
  147. If your drive has
  148. an NTFS partition,
  149. install the NTFS
  150. driver with sudo
  151. apt-get install
  152. ntfs-3g and use
  153. -t ntfs-3g in the
  154. mount command.
  155. Quick
  156. tip
  157. Ready-made solutions
  158. Although it doesn’t take too much effort to install
  159. and configure the OwnCloud server from scratch,
  160. there’s a couple of ways to save time and effort.
  161. The chaps behind PetRockBlog have written a
  162. script that automates the whole installation
  163. process.
  164. The script downloads and sets up an
  165. OwnCloud installation on top of a Raspbian
  166. distribution. However, unlike the tutorial, the
  167. script uses the Nginx web server instead of the
  168. Apache web server. To use the script, install the
  169. required components with:
  170. $ sudo apt-get install git dialog
  171. Then download the script with:
  172. $ git clone git://github.com/petrockblog/
  173. OwncloudPie.git
  174. which creates a directory called OwncloudPie.
  175. Move into this directory:
  176. $ cd OwncloudPie
  177. Make the script executable:
  178. $ chmod +x owncloudpie_setup.sh
  179. Then execute it:
  180. $ sudo ./owncloudpie_setup.sh
  181. Now give it some time to download all the
  182. components and configure your server. Once
  183. you’ve installed OwnCloud from the script, you
  184. can run it again to update the installation
  185. whenever a new
  186.  
  187.  
  188.  
  189.  
  190. platforms. These clients also help you synchronise folders
  191. from the desktop to your OwnCloud server with ease.
  192. Set up clients
  193. Most desktop distros host the Linux client in their
  194. official repos. You can also grab the latest version by
  195. adding the corresponding repo for your distro from here:
  196. http://bit.ly/1HZxhOy.
  197. The page has instructions for popular distros including
  198. Debian, Fedora, Ubuntu, OpenSUSE, and more. To download
  199. clients for other platforms, head to the downloads page on
  200. OwnCloud’s website (https://owncloud.org/
  201. install/#install-clients). Mobile clients are best fetched
  202. from either Apple’s App Store or Google’s Play Store.
  203. Once the client is installed, it prompts you for your login
  204. credentials in order to connect to the OwnCloud installation.
  205. Once connected, the Linux clients create a local sync folder
  206. named owncloud under the home directory, such as
  207. /home/bodhi/owncloud. Any files you move into this
  208. directory are automatically synced to the server. You can also
  209. specify one or more directories on a local machine to sync
  210. with the OwnCloud server. If a directory is shared with several
  211. users, when anyone makes a change to a file on one
  212. computer, it automatically flows across to the others.
  213. When collaborating with other users, you’ll appreciate
  214. OwnCloud’s version control system, which creates backups of
  215. files before modifying them. These backups are accessible via
  216. the Versions pull-down option corresponding to each file,
  217. along with a Restore button to revert to an older version.
  218. In addition to files, you can also sync your calendar and
  219. address book with your OwnCloud server. Follow the
  220. walkthrough opposite to enable the Calendar and Contacts
  221. apps. Once you’ve enabled both, the top-left pull-down menu
  222. now includes the Calendar and Contacts option.
  223. Now you need to import your contacts and calendar from
  224. your existing apps into your cloud server. OwnCloud supports
  225. the popular vCard file format (which has the .vcf file
  226. extension) and almost every popular email app, including
  227. online ones such as Gmail, export their address books in this
  228. format. Similarly, calendars can be imported in the popular
  229. iCal format. Before proceeding further, make sure you
  230. download both the .vcf and .ical files from your existing
  231. contacts and calendar apps.
  232. Now head to Contacts in OwnCloud and click on Import
  233. Contacts. In the pop-up window, click on Upload File and
  234. point it to the .vcf file. Once the contacts have been imported,
  235. you can sync them with your email clients using CardDAV
  236. links. Head to the Contacts section in OwnCloud, click on the
  237. gears icon at the bottom, hover over the name of the address
  238. book you imported and click on the Chain icon. This spits out
  239. a CardDAV link for this address book that you can feed to your
  240. desktop or mobile address book client.
  241. Sync and share your calendar
  242. Similarly, you can use OwnCloud to manage your calendar
  243. and tasks. To create an event in your calendar, head over to
  244. the Calendar app. You can view the calendar for the entire
  245. month or for the current week. To add a new event, click on
  246. the appropriate date in the calendar. This brings up a window,
  247. which gives you several options to configure the event. To
  248. import an existing client, simply upload the .ical file to your
  249. cloud server. When you click on the file in OwnCloud’s web
  250. interface, the server recognises the file and offers to import it
  251. into an existing calendar or into a new one. Select the option
  252. that best suits you.
  253. After you’ve imported the calendar, you can use
  254. OwnCloud to share it with other users. Click on the Share
  255. Calendar icon corresponding to the calendar you wish to
  256. share. This brings up a pull-down menu, which enables you to
  257. select the users or the group of users you wish to share the
  258. calendar with. Furthermore, just like address books,
  259. OwnCloud can also sync your calendars with desktop and
  260. mobile apps that can read this information from CalDAV links.
  261. To get the CalDAV link for your calendar, click on the Gears
  262. button and then on the Chain icon corresponding to the
  263. calendar you wish to sync. This displays the link that you can
  264. pass on to the clients to keep them in sync with the
  265. OwnCloud calendar.
  266. There’s a lot more you can do with OwnCloud. Follow the
  267. walkthrough opposite to flesh out the default installation with
  268. new apps to extend the functionality of your cloud.
  269. Universal access
  270. The real advantage of commercial cloud
  271. services such as Dropbox is that you can access
  272. data stored within them from any computer
  273. connected to the internet. However, by default, a
  274. self-hosted OwnCloud installation is only
  275. accessible from computers and devices within
  276. the local network,
  277. That’s not to say that you can’t access your
  278. private cloud from the internet, though. The
  279. trickier and expensive solution is to get a static
  280. IP address from your ISP and then poke holes in
  281. your router’s firewall. Or, you can set up Dynamic
  282. DNS in your router or local machine. The
  283. smarter way, however, is to use a tunnelling
  284. service, such as PageKite. The service uses a
  285. pay- what- you-want model. As a non- commercial
  286. user, you can use the service for free by filling
  287. out a form once a month, telling PageKite how
  288. you use the service. But it’s definitely worth
  289. more than the $3 per month minimum they
  290. request from individuals.
  291. First you need to install PageKite. Launch a
  292. terminal and enter:
  293. $ curl -s https://pagekite.net/pk/ | sudo bash
  294. When it’s done, make your local web server
  295. public with the following command:
  296. $ pagekite.py 80 mycloudserver.pagekite.me
  297. Remember to replace mycloudserver with
  298. the name you want for your OwnCloud server.
  299. Now you can access your own personal
  300. OwnCloud instance by heading over to
  301. http://mycloudserver.pagekite.me from any
  302. computer anywhere in the world. The first time
  303. you run this command, PageKite runs you
  304. through its brief sign-up process and asks for
  305. your email address.
  306. WorldMags.net
  307. WorldMags.net
  308. Projects
  309. Raspberry Pi Projects | 55
  310. 1 Enabled apps
  311. You can extend your default OwnCloud installation by adding (or
  312. removing) a bunch of apps. Bring up the pull-down menu in the top-left
  313. of the interface and click on Apps. By default, you are shown a list of
  314. apps that are already enabled on your installation. You can browse
  315. through this list and read their descriptions to understand them better.
  316. You can also disable any enabled app from this section.
  317. 2 Documents app
  318. Once you’ve browsed through this list, head to the Recommended
  319. section, which lists a number of apps that are recommended by the
  320. OwnCloud developers. These haven’t been enabled by default as they
  321. might not be of use on all OwnCloud deployments. The Documents
  322. app enables you to edit and collaborate on documents in various
  323. formats within OwnCloud itself, without the need for an external app.
  324. 3 Bookmarks app
  325. The other productivity app that you should enable is Bookmarks. This
  326. app lets you store and manage bookmarks in your OwnCloud server.
  327. You can add bookmarks by adding them directly, or by importing a
  328. bookmark file from your web browser. The app also has a bookmarklet
  329. that you can add to your browser’s bookmarks. Press the bookmarklet
  330. to add a website to OwnCloud’s list of bookmarks.
  331. 4 Calendar and Contacts
  332. Scroll down and click on the PIM tab on the left. This section lists two
  333. apps. You can enable either or both the Calendar and Contacts apps.
  334. Once enabled, the apps let you pull in your existing contacts and
  335. calendars, which you can sync with the PIM apps from your OwnCloud
  336. installation, as explained in the tutorial. Some OwnCloud apps also
  337. have the option to enable them for specific users.
  338. 5 More apps
  339. In addition to the apps listed in the Apps section on your OwnCloud
  340. installation, there are others that you can install from the OwnCloud
  341. website. Scroll down the Apps section and click on the More Apps…
  342. link. This takes you to the OwnCloud app store at http://apps.
  343. owncloud.com. You can download any app from here and extract it
  344. under the /var/www/owncloud/apps folder inside the Pi.
  345. 6 News and storage usage
  346. Two other useful apps are the News and Storage Usage apps. The
  347. former is an RSS reader and the latter visualises the storage space on
  348. your cloud with a variety of charts. Once you’ve downloaded them
  349. from the website and extracted them under the apps folder, head back
  350. to the Apps section in your OwnCloud installation. These and any
  351. other downloaded apps are listed under the Not Enabled section.
Add Comment
Please, Sign In to add comment