Help:Running MediaWiki on Gentoo Linux: Difference between revisions

From Meta, a Wikimedia project coordination wiki
Content deleted Content added
m Running MediaWiki on Gentoo Linux moved to Help:Running MediaWiki on Gentoo Linux
Thehelpfulbot (talk | contribs)
m Adding {{languages}}
 
(42 intermediate revisions by 33 users not shown)
Line 1: Line 1:
{{MovedToMediaWiki|Manual:Running MediaWiki on Gentoo Linux}}
== Prerequisites ==
It is possible to have connection problems when you emerge something.


Imported with full page histories. [[User:Titoxd|Tito]][[:en:User:Titoxd|<font color="#008000">xd</font>]]<sup>([[:en:User talk:Titoxd|?!?]])</sup> 03:40, 4 May 2007 (UTC)
Try to add one line for mirror list into your /etc/make.conf like following:
{{languages}}
<nowiki>
GENTOO_MIRRORS="ftp://ftp.heanet.ie/pub/gentoo/ http://ftp.easynet.nl/mirror/gentoo/"
</nowiki>

You can get possible mirrors and test them by accessing
http://www.gentoo.org/main/en/mirrors.xml


* Optional, suggested
emerge sync
emerge ufed -uD
Note: ufed is the Gentoo Linux USE flags editor
ufed (check useflags, you'll need mod_php, plus gd if you want thumbnails)
the option -uD means update and check the dependence tree thoroughly.

* Needed for support of mathematical formulas

emerge imagemagick
(ImageMagick can also make thumbnails if you do not want to include gd [a library] support in php). If you have done this it is a good idea to add support for imagemagick in the USE flags.

To add LaTeX support do:
emerge tetex
After that you should see the programs ''latex'' and ''dvips'' available on the command line.

Finally do:
emerge dev-lang/ocaml

You can find additional info [http://edu.gbssg.ch/jkeel/mediawiki-1.3.2/math/ here] about installing support for mathematical formulas in mediawiki.

* Required packages...
Remember to -p them first! if you already have them, you probably don't need them again!. For example type 'emerge -p mysql' to see what would happen
emerge mysql -uD
emerge apache -uD
USE="session" emerge php -uD
Note: I encountered a problem when merge php, ERROR: media-video/nvidia-kernel-1.0.5336-r4 failed. I checked it out from http://forums.gentoo.org/ and found it is not a simple problem. I suggest to use 'USE="session" emerge php ' instead of 'USE="session" emerge php -uD'

(check useflags with ufed. php has many use flags options.. use emerge -pv php to see them all.)
NOTE!! by default, some (if not all) php ebuilds disable sessions, which will break logins. add sessions by appending 'session' to the mod_php USE line in /etc/portage/package.use)
(probably required) (so try the following)
USE="session" emerge mod_php -uD

Another NOTE: you can also add 'session' in the USE flags permanently with ufed. I have not encountered yet problems with this setting. Also make sure that mysql support in added in USE when emerging php (stating the obvious but it doesn't hurt :))

== Configure Apache ==
start web server by
apache2
Stop it by
apache2ctl stop

(get services going by default)
rc-update add apache2 default

(turn on services)
/etc/init.d/apache2 start
=== Add PHP Support ===
apache2 uses modules to dynamically load and unload extra functionalities. php support is one of them.
There is no mod_php module in apache server after the default installation. We need to add mod_php into apache.
Edit the configuration file of apache2
==== adding php support (step 1) ====
vi /etc/conf.d/apache2
<pre>
#APACHE2_OPTS="-D SSL"
APACHE2_OPTS="-D SSL -D PHP4"
</pre>
/etc/init.d/apache2 restart

Gentoo automatically installs <tt>/etc/apache2/modules.d/70_mod_php.conf</tt>
which contains the directives to load the module, as described in step 2.
The <tt>-D PHP4</tt> is necessary to pass the <tt>IfDefine PHP4</tt> which wraps
<tt>70_mod_php.conf</tt>.

(This is with <tt>net-www/apache-2.0.54-r5</tt>.)

==== adding php support (step 2) ====
vi /etc/apache2/conf/apache2.conf or vi /etc/apache2/httpd.conf
You will see module list in apache2.conf
<pre>
LoadModule access_module modules/mod_access.so
LoadModule auth_module modules/mod_auth.so
LoadModule auth_anon_module modules/mod_auth_anon.so
LoadModule auth_dbm_module modules/mod_auth_dbm.so
</pre>
or you can edit /etc/apache2/modules.d/*.conf, where *.conf is the name of the module ( ex: 70_mod_php.conf )

Add mod_php into it by one more line:
LoadModule php4_module extramodules/libphp4.so
Consequently add .php file name handling capability by adding
<pre>
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php-source .phps
</pre>
save apache2.conf and restart apache server
apache2ctl restart
or
/etc/init.d/apache2 restart
We now have an apache server with php support.

== Configure MySQL ==
Refer to
http://meta.wikimedia.org/wiki/MySQL_config
for details

Initialize the mysql database
ebuild /var/db/pkg/dev-db/mysql-VERSION/mysql-VERSION.ebuild config
Start the server
/etc/init.d/mysql start
Choose a password:
/usr/bin/mysqladmin -u root password 'PASSWORD'
Test it
mysqlshow -p

Let it run automatically each time your machine is powered up
rc-update add mysql default

= Get Mediawiki =
Run the following command to install mediawiki:

emerge mediawiki


== Unpack ==
cp -rf /usr/share/webapps/mediawiki/{version...}/htdocs /var/www/localhost
(you don't have put it into your webroot, alias the directory, conditional to php being operational)

== Set Permissions ==
user should be apache, group should be apache.

chown -R apache:apache <PATH_TO_MEDIAWIKI_DIRECTORY>

You should not give anybody access to this directory.. or at least LocalSettings.conf as it contains passwords! Just let user apache do it.

Mediawiki 1.3.2 needs to write config directory during initialization. Now, we use /var/www/localhost/htdocs/mediawiki
cd /var/www/localhost/htdocs/mediawiki
chmod a+w config

== Alias Directory ==
edit your /etc/apache2/conf ... commonapache2.conf? file
[[apache configuration]]

You do NOT want mediawiki in a world readable directory, when php isn't running, so this is useful:
(this is using apache2, so the php4 module is called sapi_apache2.c )
<pre>
<IfModule sapi_apache2.c>
Alias /mediawiki/ /var/www/localhost/mediawiki-1.3.3/
Alias /mediawiki /var/www/localhost/mediawiki-1.3.3
Alias /wiki_persistant/ /var/www/localhost/wiki_persistant/
Alias /wiki_persistant /var/www/localhost/wiki_persistant

<Directory /var/www/localhost/wiki_persistant/>
Order deny,allow
Allow from all
</Directory>

<Directory /var/www/localhost/mediawiki-1.3.3/>
Options +includes
Order deny,allow
Allow from all
# AllowOverride All
</Directory>
</IfModule>
</pre>

== Setup Rewrite Rules ==
I have no idea how to do these, see [[Rewrite Rules]]

This is what I used:

'''RewriteRule ^/mediawiki/ - [L]'''

== Restart apache ==
/etc/init.d/apache2 restart

= Run the Configuration Web Page =
yes, you have to config that directory manually...
(Now you can use a web-configuration page)

Note: If your ServerName isn't the same as the address being used to access the mediawiki, you may have problems (such as mediawiki not loading at all). Try setting ServerName in apache2.conf to be the same as your hostname+domainname.

= MediaWikis running on Gentoo =
* http://gentoo-wiki.com A little surprise for me when I found it. :-)
* http://escargot.icehouse.net/mediawiki (the page [[upgrade from 1.2 to 1.3]] was originally written with a Gentoo box) and this user is silly enough to be willing to provide _limited_ tech support if you bother to [[User:AaronPeterson]] (he prefers telephone, because he types too much!) !!! Link is not active now !!!
* http://lnx101.parl.clemson.edu
* http://www.securityforest.com SecurityForest.com is a collaboratively edited Forest consisting of Trees which anyone can contribute to. SecurityForest's trees are specific security repositories that any security professional should be interested in. SecurityForest.com is a collection of repositories for the community - by the community. In other words - the updating, modifying and improving can be done by anyone in the community.

= References =
http://www.doctaur.com/dtdocs/databases/mysql-manual/table-of-contents.html

http://dev.mysql.com/doc/mysql/en/index.html

Latest revision as of 22:50, 21 April 2012

Imported with full page histories. Titoxd(?!?) 03:40, 4 May 2007 (UTC) [reply]

Other languages: