• No results found

How to build a synchronization server and keep your data where you want it

In document Scalable, Maintainable WEB APPS (Page 74-77)

MIKE DIEHL

WWW.LINUXJOURNAL.COM / SEPTEMBER 2014 / 75

L

ike most families these days, our family is extremely busy.

We have four boys who have activities and appointments. My wife and I both have our own businesses as well as outside activities. For years, we’ve been using eGroupware to help coordinate our schedules and manage contacts. The eGroupware system has served us well for a long time. However, it is starting to show its age. As a Web-based groupware system, it’s pretty well polished, but it doesn’t hold a candle to Kontact or Thunderbird. Also, my wife finds that she needs to access her calendar from her Android phone, and

eGroupware just isn’t very mobile-friendly. Sure, we can set up calendar synchronization, but eGroupware seems to have added synchronization as an afterthought, and it really

doesn’t work as well as we’d like.

So, I started looking for a new

groupware system that would allow us to access our calendars and contacts seamlessly from our smartphones, a Web browser or our favorite desktop PIM. Sure, we simply could have uploaded all of our information to a Google server. However, I may be paranoid, but I just don’t want an outside corporation having personal information like who my friends are, my wife’s recipe for cornbread or what

I’m doing next Tuesday at 3:00pm; it’s just none of their business. By hosting my own groupware server, I maintain my privacy and don’t have to worry about arbitrary changes in service.

The ownCloud system has a calendar, address book, task

manager, bookmark manager and file manager, among other features.

These services can be accessed from any Web browser. However, ownCloud also supports the calDAV, cardDAV and webDAV standards, so synchronization with other clients should be pretty straightforward.

In practice, there was a slight learning curve, but synchronization works very well. The ownCloud system also allows you to integrate

third-party modules (apps) in order to add features. Apps are available that provide music and video streaming, file encryption, e-mail and feature enhancements for existing functions.

In order to install ownCloud, you need PHP, a Web server and a database server. The installation documentation walks you through configuring the Apache, Lighttpd, Nginx, Yaws or Hiawatha Web servers for use with ownCloud. For a database server, you can choose FROM -Y31, 0OSTGRE31, OR 31,ITE

It’s pretty hard to have a system that doesn’t meet those requirements.

LJ245-Sep2014.indd 75 8/20/14 10:32 AM

FEATURE Synchronize Your Life with ownCloud

The installation process is well documented, so I won’t go into too much detail here. Essentially, you download and extract the tarball into a subdirectory under your Web server’s htdocs directory. Then you make the Web server configuration changes indicated in the manual and restart the Web server.

Basically, you’re setting permissions and enabling cgi execution. Once this is done, you point a Web browser at the new installation and follow the installation wizard. I purposely neglected to make some of the file permission changes, and the wizard notified me that the permissions

weren’t right. The installation is really pretty straightforward.

After all of the installation is complete, you won’t able to access your new ownCloud installation. To resolve this problem, you have to edit ./config/config.php and comment out the trusted_domains line. This is a security setting that determines which domains clients are able to connect from, and by default, limits access only to localhost. I happen to think the default values are a bit strict.

After the installation is complete, point a Web browser at your

ownCloud server and log in. You will be greeted with a page resembling what is shown in Figure 1. As you can see, the interface is simple. From here, you can access the calendar, contact manager, task list and so on. All of

Figure 1. ownCloud Web Interface

WWW.LINUXJOURNAL.COM / SEPTEMBER 2014 / 77

the tools are intuitive to use, but not polished enough that you’d want to use them every day. The intent is that you’d point your favorite PIM at the server and use it as an interface to your shared information.

The initial configuration should be done in a particular order. Since my initial intent was simply to test this system, I managed to do everything in the wrong order. If I had known I would be using the system as a permanent solution, I would have

put more thought into its initial implementation. I still ended up with a usable system, but I’ve made things more complicated and harder to

manage than they should have been.

Let me share what I did wrong and how it could have been done better.

As soon as you get logged in as the administrator user, you should start creating users and groups. First, I would create the groups. You’ll want to create a group for every group of users who need unique access

capabilities. For example, I created a group for our family as a whole, and a separate group for each of our businesses. This way, when I create a calendar or address book, I can share it to just my company group, and my wife doesn’t have to look at it on her PIM. I initially made the mistake of simply creating a family group and sharing everything to it. But when I created a chore list for the kids, I discovered that they also were able to see my company’s calendar, which

isn’t what I wanted. The moral of the story is to spend the time and keep your groups as granular as possible, because users in the same group can see everything shared to it. Once you’ve got your groups created, you can create users and assign them to the appropriate group(s) from the pick list. In my case, I created the users first, then I had to go back and assign them to groups, which was tedious.

Next, you should start creating calendars. I thought I’d be clever

The moral of the story is to spend the

In document Scalable, Maintainable WEB APPS (Page 74-77)