(This is part of My ownCloud Adventure)
The Final Fron… Errrr… Wrong adventure.
In the end I have chosen to utilize Nginx to host my personal ownCloud… At least until I have a reason to change my mind, probably for an arbitrary or subjective reason.
Nginx is rather new to me, bug generally speaking, remembering how to pronounce its name was more difficult than getting things working.
Just like getting lighttpd working, I took advantage of Win32 Disk Imager to write an image to the SD card with all of the prep work covered by the Preface completed.
- sudo apt-get update
- sudo apt-get install nginx php5-cgi php5-fpm curl libcurl3 php5-curl php5-common php5-gd php-xml-serializer php5-mysql
- cd /etc/nginx/sites-available
- sudo nano siteName-ssl
- copy/paste the Nginx config from ownClouds docs
- “root /var/www/owncloud”
- Find: “location ~ ^/(data|config|\.ht|db_structure\.xml|README)”
- Change to (Thanks Dave!):
- “location ~ ^.*/?(data|config|\.ht|db_structure\.xml|README)”
- comment out: fastcgi_pass 127.0.0.1:9000;
- uncomment: fastcgi_pass unix:/var/run/php5-fpm.sock
- save and exit
- cd ../sites-enabled
- sudo rm default
- sudo ln -s ../sites-available/siteName-ssl
- sudo service nginx restart
At this point a choice needs to be made. One can continue installing the php-apc module, or one can go ahead and do the initial ownCloud configuration… Getting things to work and experiencing the load times as-is… Providing a great before-and-after comparison to fully appreciate what php-apc accomplishes.
Regardless of which choice is made, the php-apc module is a required addition… And a very quick install.
- sudo apt-get install php-apc
- sudo service php5-fpm restart
And it is now ready and working!
ownCloud Initial Configuration
The first time you bring up ownCloud, which with the above steps can be found at https://server.ip.or.fqdn/owncloud, you are presented with a pretty simple initial configuration page.
For anyone following this path, I believe its pretty self explanatory. It only needs a few sets of information…
- Initial username & password
- ownCloud’s data directory
- Database details
Some details may be hidden via an Advanced Options link.
The data directory configuration item is the one that may need the most consideration depending on circumstances. At this early point, with little experience, I did not have a need to divert from the default.
A Little Tuning
There are a couple of options that I would recommend doing.
So lets go into the ownCloud Admin section.
The most important configuration change to make with under the “Cron” section. While the default is set to “Ajax”, its recommended to use the “Cron” option.
Configuring the cron is not difficult, but should be done under the default webserver user. (ownCloud’s cron doc)
- sudo -u www-data crontab -e
- Add to the bottom: */15 * * * * php -f /var/www/owncloud/cron.php
- save and exit
Beyond the cron configuration, you can also check “Enforce HTTPS”. While the webserver should be doing this task, a little backup probably won’t hurt.
External storage support: Probably one of the most important available apps. This lets you connect to Dropbox, Google Drive or other accounts. It also lets you define local storage directories, such as NFS mounts.
ownCloud Dependencies Info: I do not believe this one is needed normally, but is a good tool out there to make check ensure you have the appropriate dependencies.
Unfortunately I had to disable the Pictures app at this time since it is not working properly for me. I hope it’ll be resolved in the future.
And with that… For now… Until next time… The End