dokuwiki and the website directory is / … which is stored at /var/www/html/)
References:
The /bin/bash Theory -- Using Overlayfs With LXC
DigitalOcean -- How To Install DokuWiki with Nginx on an Ubuntu 12.04 VPS
$ sudo su # lxc-clone -o 14lts64-nginx -n dokuwiki -B overlayfs -s
which produced the below output
Created container dokuwiki as snapshot of 14lts64-nginx
# exit
$ sudo lxc-start -n dokuwiki -d $ sudo lxc-console -n dokuwiki
$ passwd
$ sudo mv /etc/nginx/sites-available/virtual /etc/nginx/sites-available/virtual.old $ sudo nano /etc/nginx/sites-available/virtual # put the following into this empty file
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
# Default server configuration
#
server {
listen 80 default_server;
listen [::]:80 default_server;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;
root /var/www/html;
# Add index.php to the list if you are using PHP
index doku.php;
server_name dokuwiki.lxc;
# nice URL rewrite
location @dokuwiki {
rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
rewrite ^/(.*) /doku.php?id=$1&$args last;
}
# Security Rules from www.dokuwiki.org/security#deny_directory_access_in_nginx
location ~ /(data|conf|bin|inc)/ {
deny all;
}
location / {
# First attempt to serve request as file, then
# as directory, then try the nice URL rewite.
try_files $uri $uri/ @dokuwiki;
}
location ~ /\.ht {
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
deny all;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
try_files $uri =404;
# # With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
dokuwiki, then edit the above server_name dokuwiki.lxc; line to use the .lxc version of the name for your container. (Mind the ending semicolon.)
$ sudo service nginx restart $ sudo service php5-fpm restart
$ wget http://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz
This produced the following output:
--2015-05-19 21:40:30-- http://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz Resolving download.dokuwiki.org (download.dokuwiki.org)... 46.4.55.201, 2a01:4f8:140:13e4::b00b Connecting to download.dokuwiki.org (download.dokuwiki.org)|46.4.55.201|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 3283317 (3.1M) [application/octet-stream] Saving to: ‘dokuwiki-stable.tgz’ 100%[===================================================>] 3,283,317 618KB/s in 6.5s 2015-05-19 21:40:39 (496 KB/s) - ‘dokuwiki-stable.tgz’ saved [3283317/3283317]
$ tar xzvf dokuwiki-stable.tgz
$ rm dokuwiki-stable.tgz
/var/www/html/ for the webserver root$ mv doku* html
mv command needs empty directory)$ sudo rm -R /var/www/html/*
dokuwiki.lxc$ sudo mv html /var/www/ $ sudo chown -R www-data:www-data /var/www/html
$ sudo rm /var/www/html/install.php