Install Apache, PHP, MySQL, and MediaWiki
These can either be installed from binaries (using pkg_add) or from source via the ports tree under /usr/ports.
Install Apache24
cd /usr/ports/www/apache24
make install clean
Install PHP55
cd /usr/ports/lang/php55
make install clean
cd /usr/ports/www/mod_php55
make install clean
cd /usr/ports/lang/php55-extensions
make install clean
cd /usr/ports/databases/mysql56-server
make install clean
During the make config step above, enable the "APACHE" option in the menu.
Set up MySQL
The easiest method is to only set a root password and then let the MediaWiki installer script do the rest:
mysqladmin -u root password password history -c
Use
/usr/local/etc/rc.d/mysql-server onestart
to start MySQL. (Later we will edit rc.conf so MySQL gets started automatically during boot.)
Edit /usr/local/etc/apache24/httpd.conf
Make sure the following sections have been added to /usr/local/etc/apache22/httpd.conf:
LoadModule php5_module libexec/apache/libphp5.so
<IfModule php5_module> DirectoryIndex index.php index.html AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps </IfModule>
If you want to serve MediaWiki content exclusively, you can simply change the Apache document root to the MediaWiki installation directory:
DocumentRoot "/usr/local/www/mediawiki"
Also add an entry for the MediaWiki directory to httpd.conf:
<Directory "/usr/local/www/mediawiki"> Options Indexes FollowSymLinks DirectoryIndex index.php index.html AllowOverride None Require all granted </Directory>
Use
apachectl restart
to launch (or relaunch) Apache. Open http://localhost in your browser to see if Apache works.
Edit /etc/rc.conf[edit | edit source]
Make sure your hostname in rc.conf contains a domain name, and that Apache and MySQL are set to start automatically during boot:
hostname="mycomputer.example.com" apache24_enable="YES" mysql_enable="YES"
Run the MediaWiki web installer
Now open http://localhost/mediawiki/mw-config/index.php in your browser to start installation. Enter root and your MySQL root password in the superuser name and password fields. See Manual:Config script for more information on using the web installer.
After the installer has finished successfully, copy the resulting LocalSettings.php file to the MediaWiki root directory. For MediaWiki versions earlier than 1.17 this means:
cd /usr/local/www/mediawiki cp config/LocalSettings.php . chmod 700 config
Under MediaWiki 1.17 or later, just copy LocalSettings.php from where it was saved by your web browser to /usr/local/www/mediawiki.
Edit /usr/local/www/mediawiki/LocalSettings.php
This is the main configuration file for your MediaWiki installation. You will probably want to enable uploads and change the logo. The logo image should be 135 pixels square:
$wgEnableUploads = true; $wgLogo = "http://mycomputer.example.com/my_logo.png";
If you would like to use php maintenance/update.php to upgrade MediaWiki to the latest version, you should also add the database root password toLocalSettings.php:
$wgDBadminuser = "root"; $wgDBadminpassword = "password";
Tidak ada komentar:
Posting Komentar