Today's Page Hits: 482
This page validates as XHTML 1.0, and will look much better in a browser that supports web standards, but it is accessible to any browser or Internet device. It was created using techniques detailed at glish.com/css/.
WikiMedia, PHP, MySQL, and Apache in Solaris 10
The following are notes on how to enable MediaWiki, PHP, MySQL, and Apache in Solaris 10. MediaWiki enables a Wiki using the same software as the WikiPedia encyclopedia that anyone can view and edit online.
MediaWiki requires a PHP-enabled webserver and MySQL. Stock Solaris 10 comes with Apache and MySQL. PHP is installed from the Solaris Software Companion CD. MediaWiki consists of downloaded PHP scripts that use MySQL. The following details each step.
# /usr/sfw/bin/mysql_install_db # groupadd mysql # useradd -g mysql -d /var/mysql mysql # chgrp -R mysql /var/mysql # chmod -R 770 /var/mysql # /usr/sfw/bin/mysqladmin -u root password pw # <--SET password (don't use root's) # Highly-recommended for security for local access (no DB or code changes required): # echo skip_networking >>/etc/mysql/my.cnf Start and test: # /usr/sfw/sbin/mysqld_safe --user=mysql & # cd /usr/sfw/mysql/mysql-test; ./mysql-test-run OpenSolaris or Solaris 10 Update automatic start: svcadm enable mysql Older Solaris 10 FCS automatic start and stop of mysql daemon at boot and shutdown: # ln /etc/sfw/mysql/mysql.server /etc/rc3.d/S99mysql # ln /etc/sfw/mysql/mysql.server /etc/rc1.d/K00mysql # ln /etc/sfw/mysql/mysql.server /etc/rc3.d/S99mysql # ln /etc/sfw/mysql/mysql.server /etc/rc0.d/K00mysql # ln /etc/sfw/mysql/mysql.server /etc/rc1.d/K00mysql # ln /etc/sfw/mysql/mysql.server /etc/rc2.d/K00mysql # ln /etc/sfw/mysql/mysql.server /etc/rcS.d/K00mysql
Solaris comes with both Apache. If you don't have Apache installed, install packages SUNWapachd, SUNWapchr, and SUNWapchu.
To enable Apache, copy /etc/apache/httpd.conf-php-example to /etc/apache/httpd.conf. Edit httpd.conf. At minimum you need to change the "ServerName" line. I also change the "User" and "Group" lines to "User apache" and "Group apache" after adding an apache group and apache user:
# groupadd apache # useradd -g apache -d /var/apacheThe web documents live in /var/apache/htdocs.
Start Apache the first time with "/etc/init.d/apache". See if the httpd process is running, check the error log at /etc/apache/logs/error_log, and access with your web browser. On subsequent reboots, Apache will restart automatically if httpd.conf is present.
Verify PHP is enabled by going to http://localhost/phpinfo.php where localhost is the hostname of your system.
# cd /var/apache/htdocs/wiki # chown -R apache:apache * # chmod -R o-rwx * # chmod -R g+rw configStart the web browser and install and configure from there: http://localhost/wiki/config/ I kept the defaults for the database and sysop and set the password. The sysop and database password may be the same, but don't use root's password (as it's saved in cleartext in LocalSettings.php). After filling out the form click INSTALL. If you are successfully connected to the database, then copy and save the local settings:
cd /var/apache/htdocs/wiki mv config/LocalSettings.php . cp LocalSettings.php LocalSettings.php.originalI made these customizations to LocalSettings.php after creating a logo:
$wgLogo = "$wgScriptPath/images/logo.jpg"; $wgEnableUploads = true; $wgUseImageResize = true; $wgUseImageMagick = true; $wgImageMagickConvertCommand = "/usr/sfw/bin/convert";Now test by going to the main wiki page: http://localhost/wiki/ (where localhost is your system's hostname)
After customizing, it's a good idea to backup your LocalSettings.php file and dump the database to a safe location:
cp /var/apache/htdocs/wiki/LocalSettings.php LocalSettings.php.backup /usr/sfw/bin/mysqldump --user=wikiuser --password=YOURPWHERE wikidb |gzip -9 >wiki-mysql-dump.txt.gz
As Apache and MediWiki is web-facing software, you should consider security, especially if it's on the public Internet. Keeping the software up-to-date is an important part of security. The following tips should help secure your site:
For more customizations and information see
Technorati Tags: mediawiki apache php mysql wiki solaris
Posted at 01:14PM Nov 04, 2005 by DanX in Solaris | Comments[2]
Posted by Brian Kim on December 06, 2005 at 05:06 PM PST #
Posted by Dan Anderson on October 31, 2006 at 10:51 AM PST #