Sunday, March 24, 2013

Disabling services to free up resources for OwnCloud.

In the general interest of improving performance I decided to disable services that aren't needed:

I installed rcconf: 
sudo apt-get install rcconf

Started rcconf up:
sudo rcconf

Disabled the following:

  • alsa-utils
  • anacron
  • avahi-daemon
  • clamav-freshclam (virus scanning for me happens on my sonicwall gatewall)
  • gdm
  • cups (if you don't need print services)

Saturday, March 23, 2013

What am I using to run OwnCloud at my house?

Just in case your wondering, I'm running OwnCloud 5 on an HP dv9700 laptop.  The laptop has 4 gigs of ram and uses a dual core AMD 64 mobile processor.  The OS is CrunchBang linux.  The kernel is 2.6.32-5-amd64.  Seems to run just fine.  Wish I had a bit more horse power but I happy with the setup.

BTW, I currently have 18 Gig worth of data being stored in OwnCloud and the data is being accessed by four different devices within my home network.

Jeff


Friday, March 22, 2013

Enabling APC for performance improvement


APC (Alternative PHP Cache) is an opcode cache that can significantly speed up your PHP applications, by caching both PHP code and user variables. Adding APC to an application usually results in improved application response times, reduced server load and happier users.

Install dependencies:
apt-get install libpcre3-dev

Install apc (a current version):
pecl install apc

Note where apc.so is installed to:
find / -name apc.so 2>/dev/null

Find the php.ini file so you can update it:
find / -name php.ini 2>/dev/null

Edit php.ini with your favorite editor:
nano /pathTo/php.ini 

Somewhere in you php.ini file add please not that path may be different for you installation
extension="/usr/pathTO/php/modules/apc.so"
apc.enabled=1

Copy the shipped apc.php to see what is going on wit apc on your server
cp /usr/share/pear/apc.php /root_dir_of_your_web_app

Restart you ownCloud server:

sudo /etc/init.d/apache2 restart


Run through your ownCloud site using a browser.

Examine the performance of your cache via browser (confirms APC working):
http://hostname:port/owncloud/apc.php

To validate from the command line:
$ php --ri apc

apc

APC Support => enabled
Version => 3.1.13
APC Debugging => Disabled
MMAP Support => Enabled
MMAP File Mask =>  
Locking type => pthread read/write Locks
Serialization Support => php
Revision => $Revision: 327136 $
Build Date => Mar 22 2013 19:36:36

Directive => Local Value => Master Value
apc.enabled => On => On
apc.shm_segments => 1 => 1
apc.shm_size => 32M => 32M
apc.include_once_override => Off => Off
apc.num_files_hint => 1000 => 1000
apc.user_entries_hint => 4096 => 4096
apc.gc_ttl => 3600 => 3600
apc.ttl => 0 => 0
apc.user_ttl => 0 => 0
apc.mmap_file_mask => no value => no value
apc.filters => no value => no value
apc.cache_by_default => On => On
apc.file_update_protection => 2 => 2
apc.enable_cli => On => On
apc.max_file_size => 1M => 1M
apc.stat => On => On
apc.canonicalize => On => On
apc.stat_ctime => Off => Off
apc.write_lock => On => On
apc.slam_defense => On => On
apc.report_autofilter => Off => Off
apc.rfc1867 => Off => Off
apc.rfc1867_prefix => upload_ => upload_
apc.rfc1867_name => APC_UPLOAD_PROGRESS => APC_UPLOAD_PROGRESS
apc.rfc1867_freq => 0 => 0
apc.rfc1867_ttl => 3600 => 3600
apc.coredump_unmap => Off => Off
apc.preload_path => no value => no value
apc.file_md5 => Off => Off
apc.use_request_time => On => On
apc.lazy_functions => Off => Off
apc.lazy_classes => Off => Off
apc.serializer => default => default



Monday, March 18, 2013

Stopping OpenVPN

On my ownCloud server I had installed openVPN and was running it on port 443 so I shut it down before starting up my instance of Apache2.


sudo service openvpn stop
sudo /etc/init.d/apache2 restart

Sunday, March 17, 2013

Expanding your data storage to a different partition


I ran into space issues so here is what I did to deal with the situation:

Situation:
/var was running low and /home had lots of free space.

Stopped owncloud
sudo /etc/init.d/apache2 stop

cd /home

Create new directory in /home for my ownCloud's data:
mkdir mycloud

Moved my old data:
sudo mv /var/www/owncloud/data /home/mycloud/data


Created a symlink.  Linking to a new storage location:

sudo ln -s /home/mycloud/data /var/www/owncloud/data

Same as above for config directory:
sudo mv /var/www/owncloud/config /home/mycloud/config
sudo ln -s /home/mycloud/config  /var/www/owncloud/config

Set permissions:
sudo chown -R www-data:www-data data
sudo chown -R www-data:www-data config

Started owncloud:
sudo /etc/init.d/apache2 start