NLPedia:Einstellungen: Unterschied zwischen den Versionen

Aus NLPedia
Wechseln zu: Navigation, Suche
 
(→‎Time zone adjust)
 
(11 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
  
 +
== PHP Referenz ==
 
[http://www.php.net/manual/de/index.functions.php PHP Referenz]
 
[http://www.php.net/manual/de/index.functions.php PHP Referenz]
−
----
 
  
−
[http://nirlog.com/2006/03/16/wiki-installation-and-configuration/ nirlog.com] schreibt:
+
== Access Restriction to wiki ==
−
 
+
No anonymous view/edit/create. <br>
−
Our requirements for the wiki system
+
No self registration <br>
−
 
+
−
Should be accessible only from our office LAN.
+
−
No anonymous view/edit/create.  
+
−
No self registration.
+
 
Registered users have full right to view/edit/create pages.  
 
Registered users have full right to view/edit/create pages.  
−
Choosing the software
 
  
−
Initially I thought I’d try TWiki recommended by Thomas but once I visited their site I felt little awkward because the site doesn’t display properly in firefox. So, I Googled for a while and landed at How to Start a Wiki which then led me to Top Ten Wiki Engines. The first on the top ten list was Moin Moin (I’m sure it is in the first place for a reason but for me the name didn’t click). So, I choose the second one Media Wiki. The same software used by Wikipedia.
+
Add the following lines in LocalSettings.php after this line: require_once( "includes/DefaultSettings.php" ); Result of the configuration will be: users cannot create their own account and cannot read/edit documents without logging in to the system.
  
−
Installation and Configuration
+
$wgGroupPermissions[’*’ ][’createaccount’] = false; <br>
 +
$wgGroupPermissions[’*’ ][’edit’] = false; <br>
 +
<nowiki>$wgWhitelistRead = array( "Special:Userlogin" ); </nowiki><br>
 +
$wgGroupPermissions[’*’ ][’read’] = false;  <br>
  
−
MediaWiki requires Apache, MySQL and PHP. It can be installed both in Linux/Unix and windows. My installation was done in CentOS 3.x. They have a very good, detailed Installation Guide. Following are the actual steps necessary for installation:
+
To allow browsing only from particular ip address (e.g. office lan only) insert the following lines to .htaccess file:
  
−
Download MediaWiki
+
<Limit GET POST> <br>
−
Extract the tar in document root directory:
+
order deny,allow <br>
−
tar -xvzf mediawiki-*.tar.gz
+
deny from all <br>
−
Create MySQL database.
+
allow from "Office LAN IP" <br>
−
Change the config folder ownership:
+
</Limit>  <br>
−
chown apache
+
−
Browse the site url and follow instructions.
+
−
After the installation is complete move LocalSettings.php file from config to root directory and remove the config folder.
+
−
Configuration
+
  
−
Access Restriction to wiki
+
== Eliminating index.php from url ==
  
−
Add the following lines in LocalSettings.php after this line: require_once( "includes/DefaultSettings.php" ); Result of the configuration will be: users cannot create their own account and cannot read/edit documents without logging in to the system.
 
−
 
−
$wgGroupPermissions[’*’ ][’createaccount’] = false;
 
−
$wgGroupPermissions[’*’ ][’edit’] = false;
 
−
$wgWhitelistRead = array( "Special:Userlogin" );
 
−
$wgGroupPermissions[’*’ ][’read’] = false;
 
−
To allow browsing only from particular ip address (e.g. office lan only) insert the following lines to .htaccess file:
 
−
 
−
<Limit GET POST>
 
−
order deny,allow
 
−
deny from all
 
−
allow from "Office LAN IP"
 
−
</Limit>
 
 
Rewrite Rules to have nice urls (Eliminating index.php from url). e.g.
 
Rewrite Rules to have nice urls (Eliminating index.php from url). e.g.
  
Zeile 50: Zeile 31:
 
There are many ways to achieve this. I did it with .htaccess file:
 
There are many ways to achieve this. I did it with .htaccess file:
  
−
mediawiki was installed in the document root directory www.mysite.com/ (using the installer)  
+
mediawiki was installed in the document root directory www.mysite.com/ (using the installer) <br>
−
set $wgArticlePath = "/wiki/$1"; in LocalSettings.php  
+
set $wgArticlePath = "/wiki/$1"; in LocalSettings.php <br>
−
put a .htaccess file with the following content in the dir for www.mysite.com  
+
put a .htaccess file with the following content in the dir for www.mysite.com <br>
−
# not actually needed but probably a good idea anyway
+
# not actually needed but probably a good idea anyway <br>
−
php_flag register_globals off
+
php_flag register_globals off <br>
−
# first, enable the processing - Unless your ISP has it enabled
+
# first, enable the processing - Unless your ISP has it enabled <br>
−
# already. That might cause weird errors.
+
# already. That might cause weird errors. <br>
−
RewriteEngine on
+
RewriteEngine on <br>
−
# do the rewrite
+
# do the rewrite <br>
−
RewriteRule ^wiki/?(.*)$ /index.php?title=$1 [L,QSA]  
+
RewriteRule ^wiki/?(.*)$ /index.php?title=$1 [L,QSA] <br>
−
4. Make sure Apache loads the rewrite modules
+
4. Make sure Apache loads the rewrite modules <br>
  
−
LoadModule rewrite_module modules/mod_rewrite.so  
+
LoadModule rewrite_module modules/mod_rewrite.so <br>
 
Default Global Timezone
 
Default Global Timezone
  
−
To setup the the Hong Kong time insert the following lines to LocalSettings.php.
+
== File Uploads ==
−
 
+
−
$wgLocaltimezone = "Asia/Hong_Kong";
+
−
$oldtz = getenv("TZ");
+
−
putenv("TZ=$wgLocaltimezone");
+
−
$wgLocalTZoffset = date("Z") / 3600;
+
−
putenv("TZ=$oldtz");
+
−
For other Timezones just change the first line e.g to set US, Los Angeles time the first line would be $wgLocaltimezone = "America/Los_Angeles";
+
−
 
+
−
File Uploads
+
  
 
File uploads are disabled by default so enable it in LocalSettings.php by:
 
File uploads are disabled by default so enable it in LocalSettings.php by:
  
 
$wgEnableUploads = true;  
 
$wgEnableUploads = true;  
 +
 +
 +
== Time zone adjust ==
 +
 +
If you want to set the default timezone offset according to local timezone and handle daylight savings time automatically, you can do this ugly trick. Edit LocalSettings.php and add the following code: <br>
 +
$wgLocaltimezone="Europe/Berlin";  <br>
 +
$oldtz = getenv("TZ");  <br>
 +
putenv("TZ=$wgLocaltimezone");  <br>
 +
$wgLocalTZoffset = date("Z") / 3600;  <br>
 +
putenv("TZ=$oldtz");  <br>
 +
 +
Actually, resetting it probably isn't necessary, I think that's leftover from before we switched to the proper time functions. This should do (untested):  <br>
 +
$wgLocaltimezone="Europe/Berlin";  <br>
 +
putenv("TZ=$wgLocaltimezone");  <br>
 +
$wgLocalTZoffset = date("Z") / 3600;  <br>
 +
 +
For that matter if your server is already in the local timezone you want, this might work:  <br>
 +
$wgLocalTZoffset = date("Z") / 3600;  <br>
 +
 +
Or (CEST): <br>
 +
$wgLocalTZoffset = 2;
 +
 +
 +
Note: This timezone will be used in:
 +
 +
<nowiki>~~~~ signatures  </nowiki><br>
 +
timestamps in recentchanges  <br>
 +
timestamps in history  <br>
 +
Note: Upload and deletion logs will probably still be listed in UTC <br>
 +
  
  
 
----
 
----

Aktuelle Version vom 3. April 2006, 23:20 Uhr

PHP Referenz

PHP Referenz

Access Restriction to wiki

No anonymous view/edit/create.
No self registration
Registered users have full right to view/edit/create pages.

Add the following lines in LocalSettings.php after this line: require_once( "includes/DefaultSettings.php" ); Result of the configuration will be: users cannot create their own account and cannot read/edit documents without logging in to the system.

$wgGroupPermissions[’*’ ][’createaccount’] = false;
$wgGroupPermissions[’*’ ][’edit’] = false;
$wgWhitelistRead = array( "Special:Userlogin" );
$wgGroupPermissions[’*’ ][’read’] = false;

To allow browsing only from particular ip address (e.g. office lan only) insert the following lines to .htaccess file:

<Limit GET POST>
order deny,allow
deny from all
allow from "Office LAN IP"
</Limit>

Eliminating index.php from url

Rewrite Rules to have nice urls (Eliminating index.php from url). e.g.

http://mywiki.site.tld/wiki/Article_name

There are many ways to achieve this. I did it with .htaccess file:

mediawiki was installed in the document root directory www.mysite.com/ (using the installer)
set $wgArticlePath = "/wiki/$1"; in LocalSettings.php
put a .htaccess file with the following content in the dir for www.mysite.com

  1. not actually needed but probably a good idea anyway

php_flag register_globals off

  1. first, enable the processing - Unless your ISP has it enabled
  2. already. That might cause weird errors.

RewriteEngine on

  1. do the rewrite

RewriteRule ^wiki/?(.*)$ /index.php?title=$1 [L,QSA]
4. Make sure Apache loads the rewrite modules

LoadModule rewrite_module modules/mod_rewrite.so
Default Global Timezone

File Uploads

File uploads are disabled by default so enable it in LocalSettings.php by:

$wgEnableUploads = true;


Time zone adjust

If you want to set the default timezone offset according to local timezone and handle daylight savings time automatically, you can do this ugly trick. Edit LocalSettings.php and add the following code:
$wgLocaltimezone="Europe/Berlin";
$oldtz = getenv("TZ");
putenv("TZ=$wgLocaltimezone");
$wgLocalTZoffset = date("Z") / 3600;
putenv("TZ=$oldtz");

Actually, resetting it probably isn't necessary, I think that's leftover from before we switched to the proper time functions. This should do (untested):
$wgLocaltimezone="Europe/Berlin";
putenv("TZ=$wgLocaltimezone");
$wgLocalTZoffset = date("Z") / 3600;

For that matter if your server is already in the local timezone you want, this might work:
$wgLocalTZoffset = date("Z") / 3600;

Or (CEST):
$wgLocalTZoffset = 2;


Note: This timezone will be used in:

~~~~ signatures
timestamps in recentchanges
timestamps in history
Note: Upload and deletion logs will probably still be listed in UTC