Wednesday 27 February 2013

Installing ownCloud on Debian GNU/Linux using Git

I have been watching an open source project for a while now with great interest.   The name of the project is ownCloud and it is a file synchronising server with a web interface that operates much the same as Dropbox, SkyDrive, iCloud and other cloud based storage solutions.
  
Now that ownCloud is feature rich and has a client for Android, iOS, Windows and OS X, I wanted to install it to move my cloud storage away from Dropbox and onto my own server. By doing this I will have control of my data without the need to pay for space and more flexibility as to how I access my data.

I am a fan of the GNU/Linux distribution called Debian so I installed a virtual machine running Debian Wheezy release candidate to host ownCloud. You can install ownCloud on Windows Server if you wish. The stable version of ownCloud on their website is at v4.5 which has issues using external storage on a Windows shared folder, so I needed to install the latest beta version.

To get the latest version of ownCloud I needed to install using the Git repository from GitHub. At the time of writing this article the ownCloud version on GitHub is at v5.0 beta 2.

To start off with I needed to install the prerequisites on Debian with this command;
apt-get -y install apache2 php5 php5-gd php5-json php-pear php-xml-parser php5-intl php5-sqlite curl libcurl3 libcurl3-dev php5-curl smbclient cifs-utils mp3info zip git

At this point, I changed the php.ini file to increase the upload_max_filesize value from the default 2M to 1024M;
vim /etc/php5/apache2/php.ini

I decided to install ownCloud into the root of the apache2 www folder;
cd /var/www

I removed the original apache2 index file;
rm index.html

To get the latest ownCloud version I needed to use Git to clone the core, 3rdparty and apps repositories into the root of the web server.   Note that the apps clone needs to be cloned into a new target apps2 directory to prevent conflicts with the core repositories apps folder. I will need to edit the config.php file later to include the apps2 folder, but it does not exist yet;
git clone https://github.com/owncloud/core ./
git clone https://github.com/owncloud/3rdparty
git clone https://github.com/owncloud/apps apps2

Now I need to give ownership of the ownCloud directories to www-data with;
chown -R www-data:www-data ./*
chown -R www-data:www-data /var/www

To improve the security of ownCloud I needed to enable .htaccess in the virtual host file;
vim /etc/apache2/sites-enabled/000-default

Now change the /var/www directory element so AllowOverride is set to 'All' as in this example;
<directory var="" www="">
  Options Indexes FollowSymLinks MultiViews
  AllowOverride All
  Order allow,deny
  allow from all
</directory>


I found when I first tested this install approach the Admin page reported a locale issue so I needed to install the en_US.UTF-8 locale for the system to work correctly with file names. My default locale is en_AU.UTF8. To install the US UTF8 locale run this command;
dpkg-reconfigure locales

Then select the US UTF-8 locale.
Check the installed locales with;
locale -a

Lastly enable the following modules and restart apache2;
a2enmod rewrite
a2enmod headers
service apache2 restart

I can now open a web browser and access my ownCloud instance (http://ServersIPAddress/) but there is an expected error.   When I first connect to ownCloud like this it will create a config.php file.


Now that I have an ownCloud config file I need to edit it to support the apps2 directory. If you read on the apps repository page here https://github.com/owncloud/apps (near the bottom) it states the need for this change. When you edit the config.php file using the instructions from the link above it states to leave the apps and apps2 directory as writable = false. This failed on my install and I needed to change writable to true on the apps2 directory for user downloaded apps;
vim /var/www/config/config.php

Here is my complete config.php file;
<?php
$CONFIG = array (
  'instanceid' => '512efd12eb6d8',
  'passwordsalt' => '5555c4f3a4fbeb1a527d376095555',
  'datadirectory' => '/var/www/data',
  'dbtype' => 'sqlite3',
  'version' => '4.94.10',
  'installed' => true,
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/var/www/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/www/apps2',
      'url' => '/apps2',
      'writable' => true,
    ),
  ),
);


I can now connect to my new ownCloud server and run through the setup wizard to create the SQLite database and admin user.

I now have a working cloud storage solution!

To update to the latest Git version I will need to run these commands;
cd /var/www
git pull
cd /var/www/3rdparty
git pull
cd /var/www/apps2
git pull

There is more to do such as enabling SSL and mapping to my external shared folder running on Windows but that is another story.

Here are the references I used to complete this task;
https://github.com/owncloud   (ownCloud github site)
http://doc.owncloud.org/server/5.0/admin_manual/installation.html   (v5.0 installation documents)
http://forum.owncloud.org/viewtopic.php?f=17&t=8012   (fixing the US UTF-8 issue)

To use port SSL use this reference to enable it on Apache2 with Debian;
http://wiki.debian.org/Self-Signed_Certificate




Monday 18 February 2013

Disable Adobe Reader Updates

If you need to disable Adobe Reader from automatically updating or asking to be updated on Windows you can do so by creating a REG_DWORD registry key named bUpdater.

Here is the location to create the key;
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Adobe\Acrobat Reader\10.0\FeatureLockDown

Notice the \10.0\ in the above address.   Replace this with the version you are trying to configure.
Inside the above address create this key;
REG_DWORD   bUpdater   0x00000000

Setting this value will disable the updater and remove the "Check for updates" option in the help menu.

Here is the reference from Adobe's website.

I used the following PowerShell script to search for all FeatureLockDown keys and disable the Updater regardless of the version of Adobe Reader that is installed.

"Disabling Adobe Acrobat Reader Updates."
$featureLockDownKeys = Get-ChildItem -Path HKLM:/SOFTWARE/Policies/Adobe -Recurse | Where-Object -Property Name -Match "FeatureLockDown$"

foreach ($fldk in $featureLockDownKeys)
{
New-ItemProperty -Path $fldk.PSPath -Name "bUpdater" -Value 0 -PropertyType DWORD -ErrorAction SilentlyContinue | Out-Null
New-ItemProperty -Path $fldk.PSPath -Name "iDisablePromptForUpgrade" -Value 0 -PropertyType DWORD -ErrorAction SilentlyContinue | Out-Null
}


Thursday 14 February 2013

SharePoint Server 2013 Installation Error

While installing SharePoint Server 2013 you may encounter an installation error.
The installation will seem to go well.   The prerequisites will install with no problem.   Then during the setup you will see the usual progress dialog box.


Near the end of the installation the error text "Microsoft SharePoint Server 2013 encountered an error during setup." will be displayed.



Searching the setup log files will not reveal much.


The cause of the error is a dependency for SharePoint Server 2013 to run on a machine with more than one processor.

Shutdown the virtual machine and bump the number of virtual processors up to anything more than one.

Now the installation will complete successfully.

Monday 11 February 2013

Create a bootable USB dirve for an existing WinPE wim file

I use this procedure to create a bootable USB disk for a WinPE image I use at work for setting up physical machines.
  1. Follow the steps on Technet to create the folder structure required;
    Create a Bootable Windows PE RAM Disk on a USB Flash Disk
  2. Copy your wim file into the \Boot\Sources folder and rename it to boot.wim.
Although the Technet link is for Windows 7 or Windows Server 2008 R2, it works fine with the Windows 8 ADK.