PDA

View Full Version : Fedora 7 MediaWiki Beginner



tsangcn
2nd July 2007, 05:41 AM
Hi,

I have installed mediawiki, httpd, php, mysql-server and mysql in Fedora 7. When I used Firefox to the URL http://localhost/wiki, It always respond when page not found. But I found that mediawiki is installed in /usr/share/mediawiki with working directory in /var/www/wiki

Can anyone help how to get it work?

Thanks
C. N.

tsangcn
2nd July 2007, 08:38 AM
Hi,

I try the following command and can get the first mediawiki page to generate the LocalSettings.php file

# cd /var/www/html
# ln -s ../wiki

Is this the correct method? Are there some other better method?

Then I move the LocalSettings.php from /var/www/wiki/conf to /var/www/wiki

But I get another problem. I use the URL http://localhost/wiki/ and the Main Page is displayed. But the page is displayed without any style (it seems that CSS is not in effect). When I displayed the html source of the Main Page, it seems that it is using the default skin Monobook and I can display the default css http://localhost/wiki/skins/monobook/main.css.

Can anyone help me to solve the problem? Thanks a lot.


Are there any documents on Mediawikik in Fedora?


Thanks
C. N.

eXDee
2nd July 2007, 01:38 PM
I'm not on fedora right now, but somewhere in httpd.conf in /etc/httpd/ there is a reference to /var/www/cgi-bin to link it to /var/www/html/cgi-bin/ effectively. Try and copy what has been done here but replace cgi-bin with wiki.

As far as i know httpd's working directory is the /var/www/html/ directory, so this should work. As i said, im not on fedora, so perhaps someone else can give you a better response.

Cole
2nd July 2007, 01:46 PM
I haven't used MediaWiki myself but I've installed other PHP software successfully on Fedora. Have you tried installing the application directly in a directory under /var/www/html (i.e. put all the php files there) and setting the permissions so that apache can write to that directory?

tsangcn
2nd July 2007, 04:22 PM
Hi,

Actually, the PHP is OK, and the MediaWiki is functioning OK. I can browse the wiki, I can create new article. The problem is that the page is ugly because the default CSS it used (skin Monobook) is not functioning. I am using Firefox which can display pages from http://en.wikipedia.org/wiki/ with no problem.

Thanks
C. N.

tsangcn
5th July 2007, 07:44 AM
I found that the problem is Firefox. Konqueror can display no problem.

In Firefox, I try to save my http://localhost/wiki/index.php/Main_Page as "Web page, complete" and found that main.css is missing. It seems that Firefox cannot handle this line

<style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "/wiki/skins/monobook/main.css?42b"; /*]]>*/</style>
and thus the main.css is not loaded.
But I found that although http://en.wikipedia.org and http://mediawiki.org has a similar line

<style type="text/css" media="screen,projection">/*<![CDATA[*/
@import "/skins-1.5/common/shared.css?80";
@import "/skins-1.5/monobook/main.css?80";
/*]]>*/</style>

my Firefox can display them with no problem.

So I am very frustrated. Hope anyone can help.

Thanks
C. N.

JackDrake
12th July 2007, 05:44 PM
I was having the same problem with my clean install of Fedora 7 and all of the related parts. Here's what fixed my install:

All of the files for MediaWiki are in a /usr/share folder and there is a symbolic link to the index.php folder in /var/html/wiki. In order to make my install work, I backed up all of the files in the wiki directory and then copied all of the files from the /usr/share/mediawiki folder into the one I am using for production. I also deleted the symbolic link to index.php and put an actual copy of the file in the production directory.

Once that was done, all I had to do was edit the LocalSettings.php file and change the default for $IP to the location of my production directory.

Hope this helps
--JD

tsangcn
18th July 2007, 09:13 AM
The problem is solved. Please refer to this topic http://forums.fedoraforum.org/forum/showthread.php?t=160482

In order that others would not have the same problem again, I post the installation steps needed for MediaWiki in Fedora 7. If anyone knows there is a better document, please post the link.

(1) Install MediaWiki (the example given here is done by login as root and type the command in terminal mode)

# yum install mediawiki

Normally, yum would also install php-mysql, php-pgsql, php, httpd because they are dependencies.

(2) Apache (httpd) needs the file /etc/mime.types which is provided by the package mailcap. But when install httpd, yum does not know that httpd needs mailcap, so you have to install mailcap manually.

# yum install mailcap

(3) MediaWiki requires a database server. Since the database server can be MySQL or PostgreSQL, and it does not have to be on the same computer, the database server is not defined as a dependency for mediawiki.

If you want to use MySQL

# yum install mysql-server mysql

If you want to use PostgreSQL

# yum install postgresql-server postgresql

(4) Start database server (if using MySQL) and web server

# service mysql start
# service httpd start

If you want to automatically start them every time you reboot the system, type the following commands

# chkconfig mysql on
# chkconfig httpd on

(5) MediaWiki is installed in /usr/share/mediawiki with files specific to a site installed in /var/www/wiki which contains the following directories and files

config/
config/index.php
images/
index.php -> /usr/share/mediawiki/index.php

The files in /var/www/wiki is used as a template. Without making any customizations in Apache (httpd.conf), Apache can only access /var/www/html. So copy the MediaWiki template directory to /var/www/html

# cp -a /var/www/wiki /var/www/html

Now the files for your wiki is in /var/www/html/wiki and your wiki pages are stored in database server (to be installed later)

(6) The files which define the skins for the wiki (images, css, js) is installed in /usr/share/mediawiki/skins which is not accessible by web server. You have to make them accessible by one of the following ways.

If you would not make any customization to the skins, create a soft link to the skins directory

# ln -s /usr/share/mediawiki/skins /var/www/html/wiki/skins

If you would customize the skins, copy the skins directory

# cp -a /usr/share/mediawiki/skins /var/www/html/wiki

(7) Enter the following URL in your web browser (Firefox, or Konqueror, or any of your favourite)

http://localhost/wiki

(8) For first time access to MediaWiki, it would response with a page saying "Please set up the wiki first." Click on the link, which would browse to

http://localhost/wiki/config/index.php

(9) Fill in the options in the configuration page. Most of them just accept the default will be OK. Remember to choose either MySQL or PostreSQL as your database server. I suggest click on the "Use superuser account" checkbox, and enter the username of the database superuser account and password (For MySQL, the default superuser is root, for PostgreSQL, it is postgres), otherwise it may have problems in creating the database.

(10) Click the "Install MediaWiki" button at the bottom of the configuration page.

(11) If everything is OK, "MediaWiki installation successful" page is displayed.

(12) Move the config/LocalSettings.php file into the parent directory, e.g. in terminal command mode,

# mv /var/www/html/wiki/config/LocalSettings.php /var/www/html/wiki

(13) Remove the config directory for security reason

# rm -fr /var/www/html/wiki/config

(14) Type the following URL in your web browser, firefox or konquerer, or any others

http://localhost/wiki

(15) The MediaWiki main page should be displayed.


Hope this can help. Further enhancements are welcome.

Thanks
C. N.

gmchenry
27th May 2008, 07:56 AM
I am running Fedora 8 and came across the same problem with the binary package, but when I installed the tarball, monobook was perfect.

After reading CN's thread, I realised it was one thing I had to do twice - 2 symbolic links.

Link from /var/www/html/wiki to /var/www/wiki, and

from /var/www/wiki/skins to /usr/share/mediawiki/skins.

Job done for me.
G.

BLooDMaN
9th September 2008, 10:39 AM
tsangcn, you have perfectly described everything, thanks a lot!
Nowadays yum installs many of features you have told to install manually, everything else was useful!
Article should be published as "How to install mediawiki on Fedora" ;)

patman
3rd December 2008, 07:59 PM
Thanks for the tips, I used these on fedora 9, and got it working.

Here are some issues with your post:


The problem is solved. Please refer to this topic http://forums.fedoraforum.org/forum/showthread.php?t=160482

The link above is bad.




(4) Start database server (if using MySQL) and web server

# service mysql start
# service httpd start

If you want to automatically start them every time you reboot the system, type the following commands

# chkconfig mysql on
# chkconfig httpd on


Typo - use mysqld not mysql.




(5) MediaWiki is installed in /usr/share/mediawiki with files specific to a site installed in /var/www/wiki which contains the following directories and files

config/
config/index.php
images/
index.php -> /usr/share/mediawiki/index.php

The files in /var/www/wiki is used as a template. Without making any customizations in Apache (httpd.conf), Apache can only access /var/www/html. So copy the MediaWiki template directory to /var/www/html

# cp -a /var/www/wiki /var/www/html



I used symlinks, not copy. Why did you use cp here?





Hope this can help. Further enhancements are welcome.

Thanks
C. N.

Yes, that helped thanks!

-- Patrick