Installing the web server

After messing around with trying to get a NGINX server running with ownCloud, I came to the conclusion its just not worth the hassle. This site explains in detail what needs to be done, and while NGINX supposedly is better at large scale site I doubt I will ever see a difference. I have therefore decided to go with the more traditional LAMP server.

I also encountered a small error when booting up the fresh install of Debian. Something had happened when installing the language-files resulting in the following error.

After a lot of troubleshooting and googling I figured out a solution:

Edit the file

Add the lines

Then run

and add whatever languages is missing. For me it was missing the en_us.utf-8 files. Rebooted the server and it was all good

LAMP

Linux, Apache, MySQL and PHP. All what is needed for running a web server. The ownCloud site got a short guide on how to install everything needed, and for simplicity I will follow that.

This will install the apache web server, mariaDB and PHP. I assume this is all needed for running the ownCloud site, so I won’t dig any deeper regarding what it all does. That will have to be a project for another day.

A new snapshot of the Virtual machine is taken after every major change. Here the LAMP install is completed.
A new snapshot of the Virtual machine is taken after every major change. Here the LAMP install is completed.

 

ownCloud

The rest of the installation of ownCloud is about following the instructions on the ownCloud website. I download the whole thing using the wget command.

This downloads the ownCloud archive to your current directory. I just downloaded directly to the /var/www/-folder. Because of the spartan installation of Debian I also need to install zip and unzip.

This will install everything needed to both compress and uncompress zip archives. Unzipping the ownCloud archive is simple.

Now there is a few things we need to do before the thing is working. Edit the file

and add the following

Run the commands

And open the ownCloud directory with you favourite browser. Create your username and password, and the database-password you made during the installation.

The ownCloud service is installed and working. Now for making it all secure.
The ownCloud service is installed and working. Now to make it all secure.

Securing the server

A good backup system is of no use if anyone can get into it and do whatever they want. Lucky for me the ownCloud installation guide got guidelines for what to do to make it more secure.

Most importantly is setting the right permissions for files and folders, and ownCloud supplies a automated script for this. After messing around trying to make this script run I managed to do something very weird (or stupid), and I was no longer able to do anything through the SSH, nor on the virtual machine itself. I couldn’t log in at all.

Not the reply you want from your server. Not being able to log in as the only user is no joke! This is why a virtual machine is gold for testing!
Not the reply you want from your server. Not being able to log in as the only user is no joke! This is why a virtual machine is gold for testing!

Restarting the server didn’t help at all.

This came up when restarting the VM. Does it need time? Does it even work? Did I screw it all up? It doesn't really matter. Reverting to an older VM snapshot lets me try again.
This came up when restarting the VM. Does it need time? Does it even work? Did I screw it all up? It doesn’t really matter. Reverting to an older VM snapshot lets me try again.

An extra life

Now this is exactly the situation that has happened in the past which made me kind of give up and remote any Linux install I had going. But not this time! With the virtual machine snapshots I am able to revert back to a clean LAMP server. I just need to download and install ownCloud again. I know everything up until the securing part worked, so on the next try I will take another snapshot at that point.

The process of going back to a previous snapshot takes mere seconds, and can save you from any critical errors from mistakes done.
The process of going back to a previous snapshot takes mere seconds, and can save you from any critical errors from mistakes done.
A few seconds later I have booted the working snapshot, and the server is once again ready for use (and abuse).
A few seconds later I have booted the working snapshot, and the server is once again ready for use (and abuse).

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *