LinuxMEDIAWIKIAPACHEPHP: redhatenterpriselinuxserverrelease6.3ip: me (mysql depends on this) me
Linux MEDIAWIKIAPACHEPHP architecture Wikipedia Build Environment: Linux Red HatEnterprise Linux Server release 6.3 IP: 10.0.20 I. Installation Package preparation httpd-2.2.4.tar.gz libxml2-2.6.32.tar.gz php-5.6.2.tar.gz mysql-5.5.9.tar.gz cmake-2.8.4.tar.gz (mysql depends on this) me
Zookeeper
Linux MEDIAWIKI + APACHE + PHPArchitecture wiki website construction
Environment: Linux Red HatEnterprise Linux Server release 6.3
IP: 10.0.20
I. Installation Package preparation
-
Httpd-2.2.4.tar.gz
-
Libxml2-2.6.32.tar.gz
-
Php-5.6.2.tar.gz
-
Mysql-5.5.9.tar.gz
-
Cmake-2.8.4.tar.gz (mysql depends on this)
-
Mediawiki-1.20.3.tar.gz
Ii. Installation process and related configuration
1. Install httpd-2.2.4.tar.gz
# Tar -zvxfhttpd-2.2.4.tar.gz
# Cd httpd-2.2.4
#. /Configure -- prefix =/usr/local/apache -- with-apr =/usr/local/apr/bin/apr-1-config -- with-apr-util =/usr/local/apr/ bin/apu-1-config -- enable-modules = so -- enable-dav -- enable-maintainer-mode -- enable-rewrite
# Make & make install
Start apache after installation
#/Usr/local/apache/bin/apachectl-k start
Check http: // 10.0.20/in the browser. If you get it works, apache is configured successfully.
2.libxml2-2.6.32.tar.gz Installation
# Tar-zxvf libxml2-2.6.32.tar.gz (Note: Depending on this when installing php, configure parameter -- with-libxml-dir =/usr/local/libxml)
# Cd libxml2-2.6.32
#./Configure-prefix =/usr/local/libxml
# Make & make install
2. Installation of cmake-2.8.4.tar.gz
# Tar-zxvf cmake-2.8.4.tar.gz
# Cd cmake-2.8.4
#./Configure
# Make & make install
4. Install mysql
# Tar-xzvf mysql-5.5.9.tar.gz
# Mkdir/usr/local/mysql
# Mkdir/usr/local/mysql/data
# Cd mysql-5.5.9
# Cmake .\
-DCMAKE_INSTALL_PREFIX =/usr/local/mysql \
-DINSTALL_DATADIR =/usr/local/mysql/data \
-DDEFAULT_CHARSET = utf8 \
-DDEFAULT_COLLATION = utf8_general_ci \
-DEXTRA_CHARSETS = all \
-DENABLED_LOCAL_INFILE = 1
Parameter description:
-DCMAKE_INSTALL_PREFIX =/usr/local/mysql // installation directory
-DINSTALL_DATADIR =/usr/local/mysql/data // database storage directory
-DDEFAULT_CHARSET = utf8 // use the utf8 character
-DDEFAULT_COLLATION = utf8_general_ci // check the character
-DEXTRA_CHARSETS = all // install all extended character sets
-DENABLED_LOCAL_INFILE = 1 // allow local data import
# Make
# Make install
Note:
During re-compilation, you need to clear the old object file and cache information.
# Make clean
# Rm-f CMakeCache.txt
# Rm-rf/etc/my. cnf
4) Set Directory Permissions
# Cd/usr/local/mysql
# Chown-R mysql: mysql data
5) configuration file
# Cp support-files/my-medium.cnf/etc/my. cnf // This configuration is only suitable for small memory systems (32 M-64 M)
Open the following comment::
Innodb_data_home_dir =/usr/local/mysql/data
Innodb_data_file_path = ibdata1: 10 M: autoextend
Innodb_log_group_home_dir =/usr/local/mysql/data
Innodb_buffer_pool_size = 16 M
Innodb_additional_mem_pool_size = 2 M
Innodb_log_file_size = 5 M
Innodb_log_buffer_size = 8 M
Innodb_flush_log_at_trx_commit = 1
Innodb_lock_wait_timeout = 50
Cp/home/mysql-5.1.36/support-files/mysql. server/etc/init. d/mysqld
Cp/usr/local/mysql/support-files/mysql. server/etc/init. d/mysqld
Chmod 755/etc/init. d/mysqld
Chkconfig -- addmysqld
Initialize the table of the system database
# Cd/usr/local/mysql
#/Usr/local/mysql/scripts/mysql_install_db -- user = mysql
Set Environment Variables:
# Vi/root/. bash_profile
Add the following parameter in PATH = $ PATH: $ HOME/bin:
PATH = $ PATH: $ HOME/bin:/usr/local/mysql/lib
# Source/root/. bash_profile
Start mysql: service mysqld start
Test whether lsof-I: 3306 is enabled
[Root @ localhostwiki] # service mysqld status
MySQL running (37081) [OK]
6. Create users and databases and Set permissions
Mysql-uroot-p directly press enter to enter the mysql Command Line
Create user wikiidentified by '20140901'
Create database mediawiki;
Grant allprivieges on *. * to wiki;
Use the mysql client tool Navicat Premium to connect to the database.
Connection error: 1042-Can't get hostname for your address Error
Modify/etc/my. cnf and add the following two lines to solve the connection failure problem.
Skip-name-resolve
# Ignore host name access
Lower_case_table_names = 1
# Ignore case sensitivity of database tables
7、install php-5.6.2.tar.gz
The other installation steps are omitted, focusing on the configure step. The special instructions are as follows:
. /Configure -- prefix =/usr/local/php -- with-mysql =/usr/local/mysql -- with-apxs =/usr/local/apache/bin/apxs --- libxml-dir =/usr/local/libxml -- with-config-file-path =/usr/local/lib
Because your system contains Apache2, the following part of the parameter: -- with-apxs =/usr/local/apache/bin/apxs should be changed: -- with-apxs2 =/usr/local/apache/bin/apxs
Otherwise, Apache 1.3 support while your server is Apache 2. Pleaseuse the appropriate
8. Enable Apache to process php pages
Add the following red configuration to the apache configuration file httpd. conf:
DirectoryIndex index.html index. php
Add two more lines: AddType application/x-httpd-php. php
AddType application/x-httpd-php-source. phps
Save and exit. Restart apache to take effect.
Iii. InstallationMediawiki-1.20.3.tar.gz
#Tar -zxvfmediawi1_1.20.3.tar.gz
# Cp mediawiki-1.20.3/usr/local/apache/htdocs
When you access the wiki homepage for formal installation, the following error occurs: "Parse error: syntax error, unexpected T, expecting T_STRING in/usr/local/www/apache2.
Solution: 1.Go to line 46, change the following from: class Namespace {
To:
Class MWNamespace {
Save the file.
2. Now, let's create a script: nano wikifix. sh
Copy and paste the following:
For fl in *. php; do
Mv $ fl. old
Sed's/Namespace:/MWNamespace:/G' $ fl. old> $ fl
Done
3. Save the file.
4. Change the file to executable by: chmod u + xwikifix. sh
5. Search the keyword Namespace: and replace it byMWNamespace :::
6./wikifix. sh
Access http: // 10.0.0.20/mediawiki-1.20.3/mw-config/index again. php installation. After installation is complete, LocalSettings is automatically generated. php under/usr/local/apache/htdocs/mediawiki-1.20.3/mw-config, the file cp to the upper-level directory cp LocalSettings. php .. /Then through http: // 10.0.0.20/mediawiki-1.20.3/index. php visits the wiki site
After installation, the page may generate a lot of Warnings: warning, find the warning line prompted by this file according to the warning content, comment out the corresponding php page code line, that is, normal
Now the mediawiki + apache + php wiki site has been created!