Red Hat Enterprise Linux 6 or CentOS 6.4
Almost everything must be done as superuser.
First grab what we need
yum install httpd php php-mysql php-gd mysql-server php-xml mysql
Start MySQL and secure it
service mysqld start mysql_secure_installation
Create a new database and wiki user to avoid using the root user:
mysql -u root -p
CREATE DATABASE database name;
For example only:
CREATE DATABASE wikidatabase;
To view if it was created:
SHOW DATABASES;
Grant privileges:
GRANT ALL PRIVILEGES ON *.* TO 'wiki'@'localhost' IDENTIFIED BY 'THISpasswordSHOULDbeCHANGED' WITH GRANT OPTION; exit
For example only:
GRANT ALL PRIVILEGES ON wikidatabase.* TO 'wikiuser'@'localhost' IDENTIFIED BY 'Pippo123456?' WITH GRANT OPTION; exit
Remember the 'wiki' password for MySQL that you create here. You will need it when setting up the wiki database. You can test it with:
mysql -u wiki -p SHOW GRANTS;
Make sure Apache and MySQL starts on boot
chkconfig httpd on chkconfig mysqld on
You can install mediawiki directly from the mediawiki web site or you can install pre-built packages from the Fedora Project Extra Packages for Enterprise Linux (EPEL)repository. Many RHEL and CentOS users find EPEL is a good source for packages not included in the base system.
Download mediawiki directly (the current version as of this writing, may have changed since) in some directory of your choice. Here I put it in /root.
cd /root wget http://download.wikimedia.org/mediawiki/1.21/mediawiki-1.21.2.tar.gz
Also it works with:
wget http://dumps.wikimedia.org/mediawiki/1.21/mediawiki-1.21.2.tar.gz
Install. Use a symlink for easy upgrades.
cd /var/www tar -zxf /root/mediawiki-1.21.2.tar.gz ln -s mediawiki-1.21.2/ mediawiki
Instead of downloading and installing, you can use EPEL. If you haven't done so, add the EPEL repository as a source for your package manager. Then see what mediawiki packages are available
yum list 'mediawiki*'
or, if you want descriptions of each package
yum info 'mediawiki*'
Then install those that you choose with a command like
yum install 'mediawiki121'
Setting up Apache can be done in numerous ways according to your preferences. In this example I simply change Apache to look at /var/www by default, so the link to the wiki will be http://server/mediawiki. This is convenient for running more than one site on the server. If you only need mediawiki running on the server, change instances of /var/wwwbelow to /var/www/mediawiki (Also it works with: /var/www/mediawiki-1.21.1). Open /etc/httpd/conf/httpd.conf and search for and change these three lines:
DocumentRoot "/var/www" <Directory "/var/www"> <-- this is the SECOND "<Directory" entry, not the 'root' one DirectoryIndex index.html index.html.var index.php
Changing the /var/www to /var/www/mediawiki assumes you did the following:
cd /var/www ln -s mediawiki121/ mediawiki chown -R apache:apache /var/www/mediawiki-1.21.1
Also it works with:
chown -R apache:apache /var/www/mediawiki
Restart Apache
service httpd restart
You also want to open ports in your firewall using
system-config-firewall-tui
Enable both the https and http services (follow the instructions of the configuration interface). Finally, you can do some magic with selinux to change the context of the directories you installed, but I recommend you just go to /etc/selinux and modify conf making it either "permissive" or "disabled." I also had to create a link to /usr/share/mediawiki121/load.php in my /var/www/mediawiki directory and change the ownership on the /usr/share/mediawiki121 directory to apache.apache.
And you're good to go. Point a browser at http://yourserver/mediawiki and follow the instructions.
- ۰ نظر
- ۲۱ ارديبهشت ۹۳ ، ۱۴:۴۹