So in my last post I setup and configured EHCP onto a Raspberry Pi. I thought this would be a good and easy way to run a web server from home. The installation was fairly straight forward and it all seemed like it was good except I remembered that I work in IT and I really need to do it all manually to keep my skills up. So I wiped the pi and started from scratch.

After I had installed Raspberrian, I then went and installed the LAMP stack (Check out my great post on how to here)

Once that is all done I performed the following steps

  1. Installed CURL
sudo apt-get install php5-curl

Created the Configuration file for Apache

#Create the configuration with an order and the domain name
sudo vi /etc/apache2/sites-available/010-cloud.nbird.com.au-ssl.conf

##I then created the SSL configuration file
<IfModule mod_ssl.c>
        <VirtualHost _default_:443>
                ServerName cloud.nbird.com.au
                ServerAdmin webmaster@email

                DocumentRoot /var/www/cloud.nbird.com.au-ssl

                ErrorLog ${APACHE_LOG_DIR}/error.log
                CustomLog ${APACHE_LOG_DIR}/access.log combined

                #   SSL Engine Switch:
                #   Enable/Disable SSL for this virtual host.
                SSLEngine on

                SSLCertificateFile      /etc/apache2/ssl/ssl.crt
                SSLCertificateKeyFile   /etc/apache2/ssl/ssl-key.key

                SSLCertificateChainFile /etc/apache2/ssl/CABundle.crt

        </VirtualHost>
</IfModule>

##Then Enable the site
sudo a2ensite 010-cloud.nbird.com.au-ssl

##Restart Apache
sudo service apache2 restart

Change the PHP configuration to allow large uploads

##Edit PHP.ini
sudo vi /etc/php5/apache2/php.ini

Edit the following
#Max Post Size
post_max_size = 60M

#File Upload
upload_max_filesize = 50M

##Save the file

##Reload Apache
sudo service apache2 reload

Set the directory permissions

##Create a directory outside of the Website Root for the fiels
sudo mkdir /var/owncloud

##Set Permissions
sudo chown -R www-data:www-data /var/owncloud

Next we upload the setup-owncloud.php file into the directory and run it to get started. While this was taking place I did the following

  • Created a database ready
  • Added the user and set the permissions on the database
  • Ran “watch ls -la” from the directory to see it downloading and extracting the files into the directory.

The last thing to do was to run through the wizard filling in the information that we setup above (file directory, database details) and set the cron job to be run as a cron job

# crontab -u www-data -e
*/15  *  *  *  * php -f /var/www/cloud-nbird.com.au-ssl/cron.php

That is it. After that you should have your very own owncloud installation.