Follow the [[LAMP|LAMP]] guide. Then [[pacman|Install]] {{pkg|php-gd}} and uncomment {{ic|1=;extension=gd.so}} in {{ic|php.ini}}, same for {{pkg|php-intl}} (needs icu) and {{pkg|php-xcache}} (here add {{ic|1=extension=xcache.so}}) and finally install {{pkg|mediawiki}}, all available from the [[official repositories]].

+

Follow the [[LAMP]] guide. Then [[pacman|Install]] {{pkg|php-gd}} and uncomment {{ic|1=;extension=gd.so}} in {{ic|php.ini}}, same for {{pkg|php-intl}} (needs icu) and {{pkg|php-xcache}} (here add {{ic|1=extension=xcache.so}}) and finally install {{pkg|mediawiki}}, all available from the [[official repositories]].

Instead of {{pkg|mysql}} you can install {{pkg|sqlite3}} or {{pkg|postgresql}}.

Instead of {{pkg|mysql}} you can install {{pkg|sqlite3}} or {{pkg|postgresql}}.

==Configuration==

==Configuration==

−

+

=== Apache ===

Create {{ic|/etc/webapps/mediawiki/httpd-mediawiki.conf}} from the provided example {{ic|apache.example.conf}} in the same directory. Edit it to remove the {{ic|open_basedir}} line, which is already in {{ic|php.ini}}.

Create {{ic|/etc/webapps/mediawiki/httpd-mediawiki.conf}} from the provided example {{ic|apache.example.conf}} in the same directory. Edit it to remove the {{ic|open_basedir}} line, which is already in {{ic|php.ini}}.

*Add the following lines to {{ic|/etc/httpd/conf/httpd.conf}}

*Add the following lines to {{ic|/etc/httpd/conf/httpd.conf}}

−

LoadModule php5_module modules/libphp5.so

+

{{bc|

−

Include conf/extra/php5_module.conf

+

LoadModule php5_module modules/libphp5.so

−

Include /etc/webapps/mediawiki/httpd-mediawiki.conf

+

Include conf/extra/php5_module.conf

−

* Adjust the open_basedir in {{ic|/etc/php/php.ini}} to include the webapps directory (allows update.php to be run from the command line):

Open the wiki in a browser and do the initial setup to create {{ic|/usr/share/webapps/mediawiki/LocalSettings.php}}.

+

Open the wiki in a browser and do the initial setup to create {{ic|LocalSettings.php}}. Then save it to {{ic|/usr/share/webapps/mediawiki/LocalSettings.php}}.

−

== Nginx ==

+

=== Nginx ===

−

To get MediaWiki working with Nginx, create the following file at {{ic|/etc/nginx/mediawiki.conf}}:

+

To get MediaWiki working with Nginx, create the following file:

−

location / {

+

{{hc|/etc/nginx/mediawiki.conf|<nowiki>

+

+

location / {

index index.php;

index index.php;

try_files $uri @mediawiki;

try_files $uri @mediawiki;

−

}

+

}

−

location @mediawiki {

+

location @mediawiki {

rewrite ^/([^?]*)(?:\?(.*))? /index.php?title=$1$2 last;

rewrite ^/([^?]*)(?:\?(.*))? /index.php?title=$1$2 last;

−

}

+

}

−

location ~ \.php?$ {

+

location ~ \.php?$ {

include fastcgi.conf;

include fastcgi.conf;

fastcgi_pass php;

fastcgi_pass php;

−

}

+

}

−

location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {

+

location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {

try_files $uri /index.php;

try_files $uri /index.php;

expires max;

expires max;

log_not_found off;

log_not_found off;

−

}

+

}

−

location ^~ /maintenance/ {

+

location ^~ /maintenance/ {

return 403;

return 403;

−

}

+

}

−

location ^~ /cache/ {

+

location ^~ /cache/ {

deny all;

deny all;

−

}

+

}

−

+

</nowiki>}}

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:

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:

−

upstream php {

+

{{hc|/etc/nginx/nginx.conf|<nowiki>

+

upstream php {

server unix:/var/run/php-fpm/php-fpm.sock;

server unix:/var/run/php-fpm/php-fpm.sock;

−

}

+

}

+

</nowiki>}}

−

Include a server directive, similar to this, in your {{ic|/etc/nginx/nginx.conf}} file:

+

Include a server directive, similar to this

−

−

server {

−

listen 80;

−

server_name mediawiki;

−

root /usr/share/webapps/mediawiki;

−

index index.php;

−

include mediawiki.conf;

−

}

+

{{hc|/etc/nginx/nginx.conf|

+

server {

+

listen 80;

+

server_name mediawiki;

+

root /usr/share/webapps/mediawiki;

+

index index.php;

+

include mediawiki.conf;

+

}

+

}}

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.

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.

−

== Tips ==

+

== Tips and tricks ==

=== Mathematics (texvc) ===

=== Mathematics (texvc) ===

Revision as of 16:31, 11 January 2013

Note: If you are using xampp, there are different steps you need to take after installing. More info here