Not logged in. · Lost password · Register
Forum: General Help and Support Installation and Configuration RSS
Install as Personal Wiki on LocalHost (Personal Computer)
bobaroo (Former member) #1
No profile available.
Link to this post
Subject: Install as Personal Wiki on LocalHost (Personal Computer)
I would like some assistance in how to install DokuWiki on a personal computer running Debian 9.  The installation wiki indicates to first install Apache and PHP, which I've done.  Some notes mentioned php-xml so I installed it too.  I now have Apache2 (Debian) and PHP 7.  Apache is running.

Next I downloaded the latest DokuWiki stable.  I unzipped it in my downloads directory.  Found the install.php file but found no way to run it in my browser.

I think the error is in Step 3: Unpack the distribution tarball and upload/copy the files to your webspace.  Where is my webspace?

Would appreciate some direction here.

Thanks.
Avatar
schplurtz (Moderator) #2
Member since Nov 2009 · 463 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
maybe the instructions in https://www.dokuwiki.org/install aren't so clear, or maybe too generic,  and https://www.dokuwiki.org/install:debian is a bit outdated...

Just before you continue, you may want to add a few packages :
sudo apt install php-mbstring php-gd php-xml php-intl php-mcrypt
sudo apt install php-sqlite3 # optional
sudo apt install imagemagick # optional

Where is my webspace?
On debian9,  webspace directory is /var/www/html. Either extract your files directly in there, and your wiki will appear at http://localhost/, or create a subdirectory, say mydoku where  you will extract the archive to have your wiki at http://localhost/mydoku.

When the files are in /var/www/html ... give them to the www-data user. in a terminal run :
sudo chown -hR www-data: /var/www/html

When done, point your browser to http://localhost/install.php (or http://localhost/mydoku/install.php), and complete the initial setup.
bobaroo (Former member) #3
No profile available.
Link to this post
Thank you for your help.

Okay, I saw no risk in the added programs, so I installed them as you suggested.  (Already had ImageMagick.)

So that leaves the question of an optional location.  I wish to use a partition on another drive.  It is mounted under /mnt.  As I am unfamiliar with the installation routine, will it give me a choice as to where to keep my data?  In other words, will running the install script in /var/www/html allow me to point to another data location?
Avatar
cziehr #4
Member since Jan 2011 · 591 posts · Location: 10119 Berlin
Group memberships: Members
Show profile · Link to this post
See this article on how to change the webroot of the apache webserver: https://www.digitalocean.com/community/tutorials/how-to-mo…

It is described for Ubuntu, but because Ubuntu is based on Debian, you can use the article too.
Avatar
schplurtz (Moderator) #5
Member since Nov 2009 · 463 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
In reply to post #3
This is possible. You first have to install the wiki in its standard place. Then, once you have a working wiki, you may manually move dokuwiki data folder to any location.

This is indeed recommended as it adds extra security. See security#move_directories_out_of_docroot for the full details.

If your questoin is about moving the whole wiki, engine and data, out of /var/www/html, then this is also possible but it requires more work as you need to reconfigure apache. See cziehr answer.
bobaroo (Former member) #6
No profile available.
Link to this post
Thank you very much guys.  That answers both sides of the question very well.  Much appreciated.
bobaroo (Former member) #7
No profile available.
Link to this post
Here's some more information for you all.

I found that I had to be very specific in moving files around.  DokuWiki comes in dokuwiki-stable.tgz, and that extracts to dokuwiki-2018-04-22b.  I had to take everything that was in the dokuwiki-2018-04-22b directory and place it in /var/www/html.

At that point I was able to go to my browser and open http://localhost/install.php and actually get a response without a 404 error.  However, it shows a pink box with:
DokuWiki Setup Error

The datadir ('pages') at ./data/pages is not found, isn't accessible or writable. You should check your config and permission settings. Or maybe you want to run the installer?

When I select to "run the installer", nothing changes.

What do you think?
Avatar
cziehr #8
Member since Jan 2011 · 591 posts · Location: 10119 Berlin
Group memberships: Members
Show profile · Link to this post
Open a terminal an type:

sudo chown -R www-data:www-data /var/www/html

With this command, you change the ownership of the files to the user which is used to run the apache webserver. This should fix the issue. Otherwise the webserver is not allowed to change files. Please notice that you will be asked to confirm with your admin password.
Avatar
schplurtz (Moderator) #9
Member since Nov 2009 · 463 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
In reply to post #7
What do you think?
https://forum.dokuwiki.org/post/65997
bobaroo (Former member) #10
No profile available.
Link to this post
Oh good heavens.  What a dope!  I can't believe I missed that.  And after you guys were so clear about it.  Well, duh.  (Hand strikes forehead.)

And of course it works fine now.

I'll try to be more careful.

Thanks again.
bobaroo (Former member) #11
No profile available.
Link to this post
Another important point not listed in https://www.dokuwiki.org/security#move_directories_out_of_… was to remember to run sudo chown -hR www-data: /mydrive/mywiki/ again to include the new location.

Once done, it looks like it is setup to try it out.  More later.

Thanks again.
Avatar
schplurtz (Moderator) #12
Member since Nov 2009 · 463 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
Another important point not listed in https://www.dokuwiki.org/security#move_directories_out_of_… was to remember to run sudo chown -hR www-data: /mydrive/mywiki/ again to include the new location.
Hum... sudo mv should have preserved ownership. Did you copy instead of move ? Anyway, you're right. There should be warning about the preservation of the files' security attributes. I just can't find a generic sentence to add right now. Need more coffee.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-08-23, 15:29:56 (UTC +02:00)