I am at one of those crossroads. I have a website I want to experiment with on a development server but after one more more I still can not install a Drupal / CiviCRM server onto anything.
For those that do not know, I became the “webmaster” of a charity website when it launched 15 months ago. I use the term loosely as I took over the role because I knew the most about the website when we had professional developers build it; I have known for a long time though that I have struggled to really understand a lot of it.
So what I wanted to do was take a copy of my Drupal website and put them on a locally stored server, which only I have access to. It is a far safer prospect than hosting a copy on web-hosting somewhere and even after wiping the database of users, having our systems somewhere.
So what have I tried to do?
- Install a XXAMP server on Windows
- Install a WAMP server on Windows
- Install on VirtualBox
- Install on a cobbled together Linux box
None of them have really worked. The closest I ever got was with VirtualBox, which will be great fun for you to decipher and probably laugh at if it is something obvious!
Why Not Install Drupal on the Cloud?
There are some very good reasons why I do not want to install it on the cloud and access it remotely:
- When I signed up for a programming course (on Udemy) I got a years free hosting, I then upgraded the course and got a second year. The problem is that I can not verify the integrity of the hosting, there is no indication where in the world the servers are based and with a substantial amount of database and website I doubt the hosting was designed as a dev space for something so large.
- I would pay out for a dev space somewhere but I am completely clueless how to go about it. I installed some test folders on the web-hosting for the Golden Blog and did what I thought was protecting them, but I could still access them from the outside, not worth the risk. To go one step further and pay out for hosting that is then exposed to the outside world is not thinkable.
- I also have to consider the cost. I am a volunteer for a charity and I don’t want to be costing them more money than they can afford. They spent a lot of money on this new website that we really should make good use of, but I have not got the skills to get this far, so how can I ask for more expenses?
Installing to a VirtualBox
VirtualBox is really good in that you can install it on a Windows 10 computer, install Linux on it and then access the “computer” from your computer. I tried this the most as I have a reasonably powerful gaming laptop (an MSI GS70-2PC if you are interested) but I can never get it working right.
So setting up an installation is easy, you define the sizes and it creates a space. You then install Linux (in this case the Ubuntu 14.04LTS 32 Bit) from an image you download from your Linux provider of choice. I can easily afford it 4GB of RAM and 100GB of HDD while doing this sort of thing so it has a good system to install on. Installing Linux is actually very similar to installing Windows so it is nothing too taxing, but that is where the ease ends.
I can’t find the source again that I originally read this on, but it made sense that I needed a file server, the Linux, Apache2, MySQL and PHP (LAMP) server and SSH so that I could upload everything as a Superuser. Okay, so I probably don’t need SSH as it is installed on a local machine.
I am happy to learn the Linux command line, I can be a bit of a script monkey at times so it is not that difficult to understand things one I have seen them a few times. The thing I have to make sure I do though is limit the connection to to VirtualBox installation to host-only rather than give it access to the internet.
sudo apt-get update && sudo apt-get upgrade
Importantly, I at least know how to update everything. I am learning how to run things from the command line as I go here! Thankfully I also have a free Udemy course to get through although to be honest some of it is already familiar.
I also had to then install phpmyadmin because…. well…. I forgot.
Importing the Database
Amazingly, for the first time, while I have restarted from scratch so I can document the process; the two databases have both created as they should and I have managed to import them using phpmyadmin.
I have been getting a number of errors, the easiest of those to fix has been where I needed to increase the file upload and post size in /etc/php5/apache2/php.ini
Importing the Drupal Files
So the next thing on my list is to move the files into the Linux virtual machine. Firstly I have made sure that I have ownership of the /var/www/html directory rather than root, using
sudo chown -R username:username /var/www
and then copying the files from the extracted backup using FileZilla.
Making it All Work
to try and make it all work I needed to make a few changes that I know of, namely in the Drupal settings.php and civicrm.settings.php files to use the root access for my SQL install – …. yes I know…. it’s dangerous, but it is a local machine, I am going to have no personal information on there and my laptop and VM is password protected and encrypted.
So in settings.php I changed:
- The username and password for the db array
- Note: I used the same db names as on the production install
and in civicrm.settings.php I changed:
- The username and passwords in
- define( ‘CIVICRM_UF_DSN’
- define( ‘CIVICRM_DSN’
- The absolute paths for
- global $civicrm_root;
- Changed define( ‘CIVICRM_UF_BASEURL’ to the IP of the VM (on host-only)
So in theory when I go to the IP of the virtual machine I should be able to see a copy of the website back-up; but it simply directs to the Apache2 “welcome screen” and so I know I can see my server, but not my website.
Thanks also go to a Drupal specialist from the Netherlands who pointed out:
@GoldenBlock Check the virtualhost settings of the webserver and the mapping in sites.php.
— Marc van Gend (@marcvangend) May 30, 2016
and prompted me to check my sites.php
So I know that I can now see something. I think that the install is having difficulty seeing settings.php or something because I am now getting prompted to install Drupal. A quick search of the Drupal manual made me realise that for some reason sites/default had not copied across, so doing so, changing all the various settings above again in sites/default/settings.php and civicrm.settings.php (and a few clicks later when I realised I had put in the new db username) and I get…..
Installing on a Linux box
I have lots of computer parts that are simply lying around the house. So I assembled the best that I had spare to create something that I could at least install a minimal Linux installation on, knowing that it would certainly be much slower than VirtualBox, but accessible on my home LAN network.
The problem is… well it was not powerful enough for Ubuntu:
Core2Duo 1.86Ghz Processor
An old video card
Ubuntu apparently now needs a minimum of 2Ghz CPU in order to even install from a USB, let alone run. So I tried installing Ubuntu MATE, which is apparently a stripped down version. I managed to do a few things to get it running but I realised I was on a losing battle when I tried to remove the GUI – I don’t need it if I am running it as a server – and it simply stopped booting.
Once I re-installed Ubuntu Mate though it should be good enough for the wife to do some surfing from the lounge TV and stream media from the web.
So Drupal at the Moment
I am still no closer to what I should be seeing. I made a monumental mistake somewhere with the changes I made when I re-uploaded sites/default and that is where I am heading next. For now though, I am going to work; this voluntary webmaster business is good for the brain taxing, but doesn’t earn any pennies!