Saturday, March 17, 2012

dokuwiki setup


----------------------------------------------------------------------------------

  1 AliasMatch ^/dokuwiki/sites/[^/]+$      /usr/share/dokuwiki/
  2 AliasMatch ^/dokuwiki/sites/[^/]+/(.*)$ /usr/share/dokuwiki/$1
  3 #Alias      /dokuwiki                    /usr/share/dokuwiki/              //<- Read Reference
  4 Alias      /dokuwiki                    /usr/share/dokuwiki
  5
  6 <Directory /usr/share/dokuwiki/>
  7 Options +FollowSymLinks
  8 AllowOverride All
  9 order allow,deny
 10 #   Allow from localhost 127.0.0.1 ::1
 11     Allow from all                                          //<- Solution of access from external ip
 12
 13         <IfModule mod_rewrite.c>
 14
 15                 # Uncomment to implement server-side URL rewriting
 16                 # (cf. <http://www.dokuwiki.org/config:userewrite>).
 17                         # Do *not* mix that with multisite!
 18                 #RewriteEngine on
 19                 #RewriteBase /dokuwiki
 20                 #RewriteRule ^lib                      - [L]
 21                 #RewriteRule ^doku.php                 - [L]
 22                 #RewriteRule ^feed.php                 - [L]
 23                 #RewriteRule ^_media/(.*)              lib/exe/fetch.php?media=$1  [QSA,L]
 24                 #RewriteRule ^_detail/(.*)             lib/exe/detail.php?media=$1 [QSA,L]
 25                 #RewriteRule ^_export/([^/]+)/(.*)     doku.php?do=export_$1&id=$2 [QSA,L]
 26                 #RewriteRule ^$                        doku.php  [L]
 27                 #RewriteRule (.*)                      doku.php?id=$1  [QSA,L]
 28         </IfModule>
 29 </Directory>
 30
 31 <Directory /usr/share/dokuwiki/bin>
 32         Deny from all
 33 </Directory>
 34
 35 <Directory /var/lib/dokuwiki/data>
 36         Deny from all
 37 </Directory>

---------------------------------------------------------------------------


  • back-up
  • restore
----------------------------------------------------
service apache2 restart

//copy data
tar 20120125-dokuwiki-data.tar.gz 
cp dokuwiki/* /var/lib/dokuwiki -rdf
chown www-data:www-data /var/lib/dokuwiki -R
rm dokuwiki -rdf

tar 20120125-dokuwiki-etc.tar.gz
cp dokuwiki/* /usr/share/dokuwiki/ -rdf
chown www-data:www-data /usr/share/dokuwiki -R
rm dokuwiki -rdf

tar 20120125-dokuwiki-conf.tar.gz
cp dokuwiki/* /etc/dokuwiki/ -rdf
rm dokuwiki -rdf
----------------------------------------------------

Gitweb Setup



= Gitweb Configuration =
http://blog.phlegx.com/2010/03/07/install-and-setup-gitweb-in-ubuntu-9-10-on-apache/

* Install required packages
 sudo apt-get install  gitweb
 sudo apt-get install cgilib //<- cgi 관련

The following 2 items are not necessary for Ubuntu 12.04

* Link gitweb to apache
 sudo mkdir /var/www/gitweb
 cd /var/www/gitweb
 sudo ln -s /usr/share/gitweb/* .
* Edit /etc/apache2/apache.conf. Add the following
 ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
 <directory /var/www/gitweb>
 Options Indexes FollowSymlinks ExecCGI
 DirectoryIndex /cgi-bin/gitweb.cgi
 AllowOverride All
 </directory>

* Edit /etc/gitweb.conf
 # path to git projects (<project>.git)
 #$projectroot = "/var/cache/git";                  // <-default setting
 $projectroot = "/home/DriverTeam/Repositories";    // <-your git directory

* <font color="#ff0000">!!!!Confirm the repository directories's permission. Check Read/Exec permission for "others account"(gitweb).!!! </font>

* Restart apache
 sudo /etc/init.d/apache2 restart

* Visit http://host_addr/gitweb