Tried several times from scratch. I can only get it to work without the SSL which is pointless IMO.
I challenge someone to do this from scratch: Setup Nginx with PHP and install Dokuwiki Attach a commericial SSL Domain to it. Then explain to me what wizardry you used to get it to work, in detail.
I don’t think it can be done, hours of guides have not helped.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hello,
I’ve tested this and it worked well. I will try to cover the whole process assuming that you already have the commercial SSL certificate in PEM format on hand.
Note that you would need the following files: the SSL Certificate, the Private Key, and the CA Bundle in PEM format.
Install LEMP
The first thing that you would need to do is install PHP and Nginx, you could do that by following the steps here:
https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-ubuntu-18-04
Or deploy it with 1-Click by using this image here:
https://marketplace.digitalocean.com/apps/lemp
Once you have that in place, the next thing that you need to do is to SSH to the Droplet and install Dokuwiki.
Install Dokuwiki
Once you SSH to your LEMP Droplet, download the Dokuwiki files:
Move the file to the
/var/www
folder:Extract the archive:
Rename the folder to match either your domain name or set it to
dokuwiki
:Finally, change the ownership of the files:
With that, the Dokuwiki files should all be sorted. Next, we need to focus on the Nginx configuration.
Prepare your SSL certificate files
Let’s start by adding the SSL certificate to your server. With your favorite text editor open the following file:
And in there add your SSL certificate followed by the certificate bundle (the CA) right after that. This file basically should include the full chain.
Right after that, save the file and exit.
Then do the same for your private key. Again with your favorite text editor open the following file:
And in there add the content of your private key. Save the file and exit.
Configure Nginx and install SSL
First create a new config file for your Nginx server block:
And add the following content:
After that enable that server block:
For more information on Nginx server blocks, check out this tutorial here:
https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04
Then once you’ve added the new configuration, run an Nginx config test:
And finally, if you get
Syntax OK
restart Nginx:Complete Dokuwiki install
Then with that then you are ready to complete the installation by visiting:
If you get the following error:
Make sure to install the PHP XML extension:
And then refresh the page in your browser again and finish the installation.
After completing the installation delete the
install.php
from the/var/www/dokuwiki
directory.Conclusion
Enjoy your Wiki secured with a commercial SSL!
Hope that this helps! Best, Bobby