Difference between revisions of "How to Set Up a MediaWiki 1.23 Server on CentOS 6"
From steamWiki
| Line 23: | Line 23: | ||
####hit ''y'' and enter to remove the test database | ####hit ''y'' and enter to remove the test database | ||
####hit ''y'' and enter to reload the privilege table | ####hit ''y'' and enter to reload the privilege table | ||
| + | ####run ''mysql -u root -p'' to log into MySQL monitor | ||
| + | #####run ''CREATE USER <nowiki>'</nowiki>wiki<nowiki>'</nowiki>@<nowiki>'</nowiki>localhost<nowiki>'</nowiki> IDENTIFIED BY <nowiki>'</nowiki><Your_Secure_Password><nowiki>'</nowiki>;'' to create the wiki user | ||
| + | #####run ''CREATE DATABASE wikidb;'' to create the wiki database | ||
| + | #####runQQQQQQQQQQQQQQQQQ ''GRANT ALL PRIVILEGES ON wikidb.* TO <nowiki>'</nowiki>wiki<nowiki>'</nowiki>@<nowiki>'</nowiki>localhost<nowiki>'</nowiki> IDENTIFIED BY <nowiki>'</nowiki><Your_Secure_Password><nowiki>'</nowiki> WITH GRANT OPTION;'' to give the ''wiki'' user correct access to ''wikidb'' | ||
##Install [https://php.net/ PHP] | ##Install [https://php.net/ PHP] | ||
| − | ###run ''sudo yum install php php-mysql'' to install php | + | ###run ''sudo yum install php php-mysql php-gd php-xml'' to install required php components dependencies |
###run ''sudo vi /var/www/html/info.php'' to create and edit a new webpage & populate the file with the following: | ###run ''sudo vi /var/www/html/info.php'' to create and edit a new webpage & populate the file with the following: | ||
###*<?php | ###*<?php | ||
| Line 36: | Line 40: | ||
###If you don't already have it, install wget via ''sudo yum install wget'' | ###If you don't already have it, install wget via ''sudo yum install wget'' | ||
###Visit the [http://www.mediawiki.org/wiki/Download MediaWiki Download] page to find the latest version. Substitute the path to the latest version in the next command if necessary | ###Visit the [http://www.mediawiki.org/wiki/Download MediaWiki Download] page to find the latest version. Substitute the path to the latest version in the next command if necessary | ||
| + | ###run ''cd ~'' to navigate to your home directory | ||
###run ''wget https://releases.wikimedia.org/mediawiki/1.23/mediawiki-1.23.1.tar.gz'' to download the latest version of MediaWiki | ###run ''wget https://releases.wikimedia.org/mediawiki/1.23/mediawiki-1.23.1.tar.gz'' to download the latest version of MediaWiki | ||
###run ''tar xvzf mediawiki-1.23.1.tar.gz'' to unpack the downloaded file | ###run ''tar xvzf mediawiki-1.23.1.tar.gz'' to unpack the downloaded file | ||
| + | ###run ''sudo mv ~/mediawiki-1.23.1 /etc/mediawiki'' to move the mediawiki directory to a non-version specific general location | ||
| + | |||
==References== | ==References== | ||
*https://www.digitalocean.com/community/tutorials/how-to-install-mediawiki-on-centos-6-4 | *https://www.digitalocean.com/community/tutorials/how-to-install-mediawiki-on-centos-6-4 | ||
*https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-centos-6 | *https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-centos-6 | ||
| + | *https://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Red_Hat_Linux | ||
Revision as of 10:52, 20 July 2014
- Setting up the Linux OS
- Follow my guide for Setting Up a Secure CentOS 6 Server
- Installing MediaWiki
- Install Apache
- run sudo yum install httpd to install apache and its dependencies
- run sudo chkconfig httpd on to make sure apache starts on boot
- Add the following lines to your /etc/sysconfig/iptables file to allow web traffic
- # Accept web traffic.
- -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
- restart to ensure the iptables are reloaded and check that apache is correctly started at boot
- Visit the ip address of your server, preferably from a different computer, to ensure everything is working properly. You should see something like this.
- Install MySQL
- run sudo yum install mysql-server to install the mysql server and its dependencies
- run sudo chkconfig mysqld on to make sure that mysql starts on boot
- run sudo service mysqld start to start the mysql server
- run sudo mysql_secure_installation
- just hit enter for 'none' at the 1st password prompt
- hit y and enter to set a root password
- type in your new root-password and hit enter (twice)
- hit y and enter to remove the anonymous account
- hit y and enter to ensure that root can only login at the physical keyboard
- hit y and enter to remove the test database
- hit y and enter to reload the privilege table
- run mysql -u root -p to log into MySQL monitor
- run CREATE USER 'wiki'@'localhost' IDENTIFIED BY '<Your_Secure_Password>'; to create the wiki user
- run CREATE DATABASE wikidb; to create the wiki database
- runQQQQQQQQQQQQQQQQQ GRANT ALL PRIVILEGES ON wikidb.* TO 'wiki'@'localhost' IDENTIFIED BY '<Your_Secure_Password>' WITH GRANT OPTION; to give the wiki user correct access to wikidb
- Install PHP
- run sudo yum install php php-mysql php-gd php-xml to install required php components dependencies
- run sudo vi /var/www/html/info.php to create and edit a new webpage & populate the file with the following:
- <?php
- phpinfo();
- ?>
- save & exit
- run sudo service httpd restart to reload the apache server
- visit your server ip/info.php (ie: http://192.168.1.100/info.php) and it should look something like this:
- Install Mediawiki
- If you don't already have it, install wget via sudo yum install wget
- Visit the MediaWiki Download page to find the latest version. Substitute the path to the latest version in the next command if necessary
- run cd ~ to navigate to your home directory
- run wget https://releases.wikimedia.org/mediawiki/1.23/mediawiki-1.23.1.tar.gz to download the latest version of MediaWiki
- run tar xvzf mediawiki-1.23.1.tar.gz to unpack the downloaded file
- run sudo mv ~/mediawiki-1.23.1 /etc/mediawiki to move the mediawiki directory to a non-version specific general location
- Install Apache