https://wiki.archlinux.org/api.php?action=feedcontributions&user=Brendyn&feedformat=atomArchWiki - User contributions [en]2024-03-29T05:26:00ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=MediaWiki&diff=218477MediaWiki2012-08-18T07:05:06Z<p>Brendyn: missing trailing ;</p>
<hr />
<div>[[Category:Web Server]]<br />
{{Note| If you are using xampp, there are different steps you need to take after installing. More info [https://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_XAMPP#381 here] }}<br />
== Installation ==<br />
[[pacman|Install]] {{pkg|php-apache}}, {{pkg|php-intl}}, {{pkg|imagemagick}}, {{pkg|mysql}} (or {{pkg|postgresql}} and {{pkg|php-pgsql}}, see [[Postgresql]] for more details) and {{pkg|mediawiki}}, all available from the [[official repositories]].<br />
<br />
Instead of {{pkg|imagemagick}} you can install {{pkg|php-gd}}. Also instead of {{pkg|mysql}} you can install {{pkg|sqlite3}} or {{pkg|postgresql}}.<br />
<br />
==Configuration==<br />
<br />
Create {{ic|/etc/webapps/mediawiki/httpd-mediawiki.conf}} from the provided example.<br />
<br />
*Add following lines to {{ic|/etc/httpd/conf/httpd.conf}}<br />
LoadModule php5_module modules/libphp5.so<br />
Include conf/extra/php5_module.conf<br />
Include /etc/webapps/mediawiki/httpd-mediawiki.conf<br />
*Add the following in the directory section {{ic|/etc/httpd/conf/httpd.conf}}<br />
<Directory "/usr/share/webapps/mediawiki"><br />
AllowOverride All<br />
Options FollowSymlinks<br />
Order allow,deny<br />
Allow from all<br />
</Directory><br />
* Adjust the open_basedir to include the webapps directory<br />
open_basedir "/usr/share/webapps/:/temp/:/usr/bin"<br />
<br />
Adjust permissions in {{ic|/usr/share/webapps/mediawiki/.htaccess}}<br />
<br />
Restart apache with:<br />
# rc.d restart httpd<br />
<br />
== Nginx ==<br />
To get MediaWiki working with Nginx, create the following file at {{ic|/etc/nginx/mediawiki.conf}}:<br />
<br />
location / {<br />
index index.php;<br />
try_files $uri @mediawiki;<br />
}<br />
location @mediawiki {<br />
rewrite ^/([^?]*)(?:\?(.*))? /index.php?title=$1$2 last;<br />
}<br />
location ~ \.php?$ {<br />
include fastcgi.conf;<br />
fastcgi_pass php;<br />
}<br />
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {<br />
try_files $uri /index.php;<br />
expires max;<br />
log_not_found off;<br />
}<br />
location ^~ /maintenance/ {<br />
return 403;<br />
}<br />
location ^~ /cache/ {<br />
deny all;<br />
}<br />
<br />
Ensure that {{ic|php-fpm}} is installed, and in your {{ic|/etc/nginx/nginx.conf}} file, ensure that you have an {{ic|upstream}} directive named {{ic|php}}, similar to this one:<br />
<br />
upstream php {<br />
server unix:/var/run/php-fpm/php-fpm.sock;<br />
}<br />
<br />
Include a server directive, similar to this, in your {{ic|/etc/nginx/nginx.conf}} file:<br />
<br />
server {<br />
listen 80;<br />
server_name mediawiki;<br />
root /usr/share/webapps/mediawiki;<br />
index index.php;<br />
include mediawiki.conf;<br />
}<br />
<br />
Finally, ensure that the {{ic|open_basedir}} directive in {{ic|/etc/php/php.ini}} includes {{ic|/usr/share/webapps}} and {{ic|/etc/webapps}}, or you might get "File not found" or "No input file specified" errors.<br />
<br />
== Tips ==<br />
=== Mathematics (texvc) ===<br />
<br />
Usually installing texvc package and enabling it in config are enough:<br />
$wgUseTeX = true;<br />
<br />
If you get problems, try to increase limits for shell commands:<br />
$wgMaxShellMemory = 8000000;<br />
$wgMaxShellFileSize = 1000000;<br />
$wgMaxShellTime = 300;<br />
<br />
=== Unicode ===<br />
<br />
Check that php, apache and mysql uses UTF-8. Otherwise you may face strange bugs because of encoding mismatch.</div>Brendyn