I originally followed these instructions for installing Dokuwiki. My server is the free tier Google Cloud (Ubuntu). I have a Go Daddy account and the main site points to a Weebly site. So I created an A name so that a subdomain points to the GCP instance's public IP address. In Virtual Host, I have the ServerName and ServerAlias as sub.domain.com (my subdomain for my website). So going to sub.domain.com brings up my Dokuwiki fine.
But now I want to have a farm so I can have an additional, separate wiki, and an additional, separate subdomain. I know there is a farm plugin, but it uses .htaccess, and besides me not understanding .htaccess at all, I am already using VirtualHost. So I decided to try and set things up manually, according to these instructions.
Since my main wiki directory is /var/www/html/dokuwiki
, I created a farm directory in /var/www/html/farm
. Since in the original tutorial (I used for setting up DokuWiki), I also did sudo chown -R www-data:www-data /var/www/html/farm/
and sudo chmod -R 755 /var/www/html/farm/
because it says, "That will be your farm directory and needs to be writeable by the web server."
Then I created a directory called inc
within farm
, and copied (and renamed) files over that I believe the instructions told me to:
cp /var/www/html/dokuwiki/inc/preload.php.dist /var/www/html/farm/inc/preload.php
cp /var/www/html/dokuwiki/inc/farm.php /var/www/html/farm/inc/farm.php
Then I uncommented two lines in /var/www/html/farm/inc/preload.php
and set them as follows:
// set this to your farm directory
if(!defined('/var/www/html/farm')) define('/var/www/html/farm', '/var/www/html/farm');
// include this after DOKU_FARMDIR if you want to use farms
include(fullpath(dirname(__FILE__)).'/farm.php');
I downloaded the animal template zip, extracted it, and renamed it to manual
(my "animal" in the "farm").
Then I edited my VirtualHost file at /etc/apache2/sites-available/dokuwiki.conf
and added this at the bottom:
<VirtualHost *:81>
ServerName 1.222.333.444:81
ServerAlias 1.222.333.444:81
DocumentRoot /var/www/html/farm/manual
</VirtualHost>
1.222.333.444 being my IP address for my GCP instance. I restarted the Apache2 engine with sudo systemctl restart apache2.service
and I cannot access my farm animal page at http://1.222.333.444:81.
I am sure I went wrong somewhere, but I was trying to set things up the best way I understood it telling me to. It complicates things since I'm pretty sure I would need to use another port other than 80 so that I can point another A name in GoDaddy to my GCP instance's IP address, but with a different port number. I haven't set up the A name for another sub domain (which would be manual.domain.com) yet because I want to get the farm animal up and running first.
I might be misunderstanding things, so if someone could please explain, I would greatly appreciate it!