Build the company's wiki Server under Centos6

Source: Internet
Author: User
Tags mediawiki

Build the company's wiki Server under Centos6

CentOS 6.4 system and Root or sudo permissions, the system is connected to the network normally

Software used:

Apache, mysql-server, php, mediawiki, memcached

Installation of software packages

First, install related software packages such as apache, php, mysql-server, and mysql-client.

# Yum install httpd php-mysql php-gd php-xml mysql-server mysql libxml2memcached lrzsz

Set the root password of the MYSQL database.

UPDATE mysql. user SETpassword = PASSWORD ("newpwd") WHERE user = 'root ';

Start mysql service: # service mysqld start

Set mysql: # mysql_secure_installation (equivalent to initializing the mysql database./scripts/mysql_install_db -- datadir =/usr/local/mysql/data -- user = mysql)

Create a database for wiki and grant relevant Permissions

Mysql> create database wikidb;

Mysql> grant all privileges on wikidb. * to 'mediawiki '@ 'localhost' identified by '123 ';

Apache configuration

You need to modify the httpd. conf file first.

# Vim/etc/httpd/conf/httpd. conf

Remove # Before # ServerName 80

Change the Chinese character section in the figure to the domain name or IP address.

Modify the PHP configuration file:

# Vim/etc/php. ini

In the left-side navigation pane. If the PHP cache software is not modified and is not configured, an error is prompted when the web page is opened.

* Note: If you use PHP's cache software, such as Xcache, you can enable this option.

Restart the http service:

# Service httpd restart


Firewall Configuration

To open port 80 for external access, we need to configure the firewall accordingly.

# Vim/etc/sysconfig/iptables

Add a rule to the rule:

A input-m state-state NEW-m tcp-ptcp-dport 80-j ACCEPT

Then restart the firewall.

#/Etc/init. d/iptables restart

* Note: This parameter is not required. If no limitation is set, no modification is required.

Confirm that Apache and MySQL are started upon startup

# Chkconfig httpd on

# Chkconfig mysqld on

Install Mediawiki

Here, manually download the installation package:

# Wget

Decompress the package to the current directory.

# Tarxf mediawiki-1.23.6.tar.gz

Create a target folder to store the mediawiki web page content:

# Mkdir-p/var/www/html/wiki/

# Chmod 777/var/www/html/wiki

* For convenience, all the read and write permissions for the Directory are directly granted.

Go to the directory where the web content is stored and copy the file to the target directory.

# Cdmediawiki-1.23.6

# Cp */var/www/html/wiki/

Set in a browser

Enter http: // ip/wiki/index. php in the browser.

* Note: The above ip address can be accessed according to the settings in httpd. conf./wiki/is the directory created above.

After opening the page, you can configure relevant information on the WEB page. For example:

Click set up the wiki to set it.

You can select Chinese.

Check whether the current environment is normal.

The figure shows that the current PHP environment cannot fully normalize unicode, but it does not affect usage. to normalize it, you can install the PHP component.

Note: If the variables in/etc/php. ini are not modified, the following occurs:

Modify the cache field in/etc/php. ini, restart the httpd service, and open the page again to proceed to the next step.

Configure the database to be installed on this page:

The mysql database is used here:

The tutorial here uses a local database named wikidb, which is the same as the account and password mentioned in the previous tutorial. You can also use the root account, but this setting is not recommended; you can leave the database table empty without setting it.

Click "continue": select the database engine and character set. The settings are recommended:

The following content is set based on your actual situation:

After entering the preceding content, you can select the following options:

Here, you can set the cache for the web and the degree of openness.

Configure the email sending and plug-in:

Configure whether the upload information can be started:

Memcached is installed in the initial stage. The default port number of memcached is 11211: The system prompts that the connection is not available. Find the memcached configuration file in the/etc directory and modify the accessible address and port number, restart the memcached service.

The configuration is complete. Another step is required. At this time, the page will pop up a configuration file, which needs to be placed in the same directory as index. php:

First, save the file to your local computer, and then use the management tool to transfer the file to the corresponding directory of the CentOS system. If lrzsz is installed before, and the centos system is controlled by using ssh protocol, you can execute rz in the index. php directory to receive this file.

After saving, click my WIKI to go to normal use.

The database cannot be connected during system setup,

The analysis includes the following aspects:

1. It may be that the/usr/local/mysql/data/rekfan. pid file has no write permission.
Solution: grant permissions, execute "chown-R mysql: mysql/var/data" "chmod-R 755/usr/local/mysql/data", and then restart mysqld!

2. the mysql process may already exist in the process.
Solution: Run "ps-ef | grep mysqld" to check whether the mysqld process exists. If the "kill-9 process number" is used to kill the process and restart mysqld!

3. It may be the second time that mysql is installed on the machine. Residual data affects service startup.
Solution: Go to the mysql data DIRECTORY/data to see, if there is a mysql-bin.index, just remove it, it is the culprit. I am using the third solution! Http:// /? P = 186

4. mysql uses/etc/my when the configuration file is not specified at startup. cnf configuration file. Open this file to check whether the data directory (datadir) is specified in [mysqld ).
Solution: Set this line in [mysqld]: datadir =/usr/local/mysql/data

5. skip-federated Field Problems
Solution: Check whether the skip-federated field has been commented out in the/etc/my. cnf file. If so, comment out the field immediately.

6. The error log directory does not exist.
Solution: use the "chown" "chmod" command to grant the mysql owner and permissions.

7. selinux. If it is a centos system, selinux is enabled by default.
Solution: Close it, open/etc/selinux/config, change SELINUX = enforcing to SELINUX = disabled, and then save the disk and restart the machine.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.