This page was last modified 2007-02-20 12:17:34 by Puchu.Net user WebPuchu. Based on work by Puchu.Net user(s) Choco. (Show history)
I started out wanting to create a Linux environment where I can experiment with MediaWiki software. I have a RedHat 9 Linux machine, which means I needed to:
Another goal I had was to change the skin of my wiki. Monobook is used for most of the wiki's out there, and I wanted my site to look different. Since this is a personal web site, I will also need to lock down the number of contributors allowed to edit my site. Ultimately I want to move this work to a live system (what you are reading), this article outlines the steps I took to create such a sandbox environment and eventually move to production.
[edit] Compiling Apache 2 and PHPIf you download Apache from http://httpd.apache.org/download.cgi, in the archive there is an INSTALL file that describes the steps you need to perform. The important ones are, when running the configuration script you need to add Apache needs to be compiled and installed first, because one of the utilities from Apache is required to build PHP. After you install Apache, note that it is not in the same location as the default RH9 httpd. You can correct this any way you like, I just created symbolic links to point to new httpd. PHP from http://www.php.net/downloads.php also includes an INSTALL file that describes everything, includes the necessary flags for Apache 2. [edit] Installing MySQLYou can download generic RPM binaries or source code from http://dev.mysql.com/downloads/mysql/5.0.html. Check the start up scripts under If this is a new installation of MySQL server, you should create root password first. [edit] Configuring Web ServerAfter installing PHP, you need to copy PHP library to If you want error documents to be pointing at an article in your wiki, you can edit
For a list of error codes, see this page. [edit] Installing MediaWikiMediaWiki is installed in-place, you extract the directory structure into your WWW root, and point your web browser to location of MediaWiki directory. It will ask you to fill out forms that defines name of site, MySQL password and database connect information, copyright schemes, etc. Should you decide to delete MediaWiki, you just need to remove the tables created in your database (they have a prefix you defined during MediaWiki setup) and remove the directory containing all MediaWiki files. You may want to keep Once installation is complete, and you can access article Main_Page with the default skin, MediaWiki is running. [edit] Blocking Public User CreationThis is done by adding the following lines to
Once this is done, the "create new account" link will not be visible at the login page. As a logged in sysop (which you specified during MediaWiki setup), however, you can access Special:Userlogin and create new accounts, and later add the new users to the groups you designate. [edit] Shorter URLBy default, you can see Please see this bookmark, under Customizations for link to a site that shows the rewrite rules. You can add additional lines to avoid rewriting certain directories (such as the directory you use for uploads):
Without such exclusions, if your upload directory is under the rewrite root, the link will be re-written to point to (non-existing) articles instead of your files. [edit] Skin CustomizationI started by designing in HTML and CSS the layout site. This is done so that I could easily experiment with:
Know that once you try to integrate PHP components into your site template, the end result is not nearly as readable for debugging. A good way maybe to start with the Personally I felt that in order to distinguish the site completely, I needed to start fresh and not inherite too much design or code from For views and special links, the original To remove all other available skins so that user can only use
[edit] Color By CategoriesNavigation of this site is done mainly by the tabs at upper-right. Each tab defines the color theme of the pages under them. So for example, the majority of the pages under "home" section is green. In order to achieve this, most of the documents are tagged with a category like this:
And There may be better ways, but hey, I am new to this. [edit] Patching Up CSSOnce the basic site is up and running, I started to realize that my original CSS did not include all the new classes used to format various pages generated by MediaWiki, for example, the diff view in history, user preference, the portlet for views and navigation on the side. Looking at generated HTML it is easy to figure out what I missed, and I added the missing classes back into my CSS file. Finally, there are HTML segments generated by MediaWiki that are not necessary when you try to print the page. When designing the interface I already had separate CSS files for different media, so all I had to do is edit the CSS for print and change the unwanted classes to include [edit] Supporting LaTeXTo support adding mathematical formulas on Puchu.Net, I ended up using mimetex by John Forkosh as suggested from Mimetex alternative article. The reason for not using the built-in Compiling mimetex is easy, and there are a few options you can enable to make sure other people are not abusing your CGI resource ( [edit] JavaScript IntegrationIn addition to some JavaScripts used to help with the user interface or presentation of Puchu.Net, additional JavaScripts not authored by me have been integrated with some modifications:
These JavaScripts are small, easy to modify and they render on the client side, so they are a great way to introduce helpful features without complicated server-side codeing. [edit] Uploading FilesUploading files via HTTP POST is supported by MediaWiki, but you are restricted by the default limits of PHP. You can see what those limits are, by calling a built-in PHP If you are getting an error complainiing about files being bigger than server's configured limit, then you need to check with the following PHP parameters (I included the values I use also):
You can add these to [edit] Deploying SiteWhen I setup the directory structure and coding in my sandbox, the references were all relative, and all the passwords to connect to database server are the same. All I needed to do is FTP the files in place and initialize the database. I also installed extensions, such as DynamicPageList to automatically generate content for navigation. You can see it at work on the front page. All documents in Puchu.Net belong to at least one category, making this particular extension very useful to integrate. Certain extentions used together causes an error in the form of a message " The solution is to use a locally instantiated parser class, like what DynamicPageList did. But in the end, instead of changing NewestPagesBlog, I modified DynamicPageList myself to include the news text. To disable caching for extensions, I used this hack and disabled both server and client caching by adding to
This hurts server performance, but this is not a busy site. To set up default time zone for my site, the following code (from this page) is added to
Check PHP Manual on using the
|
|
||||