To install DokuWiki on Gentoo include “xml” in your USE flags and do
$> emerge --sync $> emerge -a dokuwiki
This will install dokuwiki in /var/www/localhost/htdocs/dokuwiki.
When having USE=“vhosts” set, use the webapp-config tool to install dokuwiki.
You should not forget to set up Apache (the web server) to support PHP. See http://gentoo-wiki.com/Apache_Modules_mod_php.