Lamp -- Build the source MySQL cluster version
Environment: rhel6.1 x86
The software is as follows:
#Ls
Apr-1.4.6.tar.g memcached-1.4.13.tar.gz pcre-7.9.tar.gz
Apr-iconv-1.2.1.tar.gz libevent-2.0.18-stable.tar.gz mysql-cluster-gpl-7.0.5.tar.gz
Apr-util-1.4.1.tar.gz libiconv-1.13.tar.gz httpd-2.2.22.tar.gz
Mysql-cluster-gpl-7.2.5.tar.gz jdk-6u18-ea-bin-b02-linux-i586-09_sep_2009.bin
1.Uninstall the built-in JAVA
#Yum remove Java-y
2.Install Java
#/Jdk-6u18-ea-bin-b02-linux-i586-09_sep_2009.bin
#MV jdk1.6.0 _ 18 // usr/Java
#Vim/etc/profile
------------------- Add the following content to/etc/profile ---------------------
Java_home =/usr/Java
Class_path =/usr/Java/JRE:/usr/Java/lib
Path = $ path:/usr/Java/bin/
---------------------------------------------------------------------------------
3.Environment to take effect
#Source/etc/profile
4. libevent
Libevent-2.0.18-stable.tar.gz --> extract
#./Configure
#Make & make instalL
#Echo/usr/local/lib>/etc/lD. So. conf. d/lamp. conf
#Ldconfig // execute ldconfig to make the library take effect
5 compile memcached
Memcached-1.4.13.tar.gz-->Extract
#./Configure -- enable-sasl-pwdb -- With-libevent =/usr/local
#Make & make install
6. Install mysql-cluster <ensure that there are mysql users in the system, uid = 27 gid = 27>
Mysql-cluster-gpl-7.2.5.tar.gz
If MySQL has been installed before, perform the following operations A and B:
A. Stop MySQL database stop
B. rm-RF/usr/local/MySQL Delete the MySQL installation directory
#Cmake-dcmake_install_prefix: Path =/usr/local/MySQL-dmysql_datadir: Path =/database-dmemcached_home: Path =/usr/local-dwith_classpath: String =/usr/Java-Example: string = All-dwith_innobase_storage_engine: bool = on-dwith_ndbcluster_storage_engine: bool = on-dwith_partition_storage_engine: bool = On-Demand: bool = on
#Make & make install
C. Start the script
#CP/usr/src/lamp/mysql-cluster-gpl-7.2.5/support-files/MySQL. Server/etc/rc. d/init. d/mysql5
D. Configuration File
#Mkdir/usr/local/MySQL/etc
# Vim/Usr/local/MySQL/etc/My. CNF
# Cat/usr/local/MySQL/etc
[Mysqld]
User = MySQL
Basedir =/usr/local/MySQL
Datadir =/Database
Socket =/var/run/mysqld/mysql5.socket
PID-file =/var/run/mysqld/mysql5.pid
General-Log
General-log-file =/var/log/mysqld/mysql5-access.log
Log-error =/var/log/mysqld/mysql5-error.log
Port = 3306
E. startup
Install Apache and related software
// Delete the previously installed Apache directory
#Rm-RF/usr/local/apache2
#Yum install-y OpenSSL * nss-develbzip2-devel libzip-* net-snmp -*
// Some software required after Yum Installation
Apr-1.4.6.tar.gz-->Extract
#./Configure -- disable-ipv6 -- enable-threads
#Make & make install
......
Libraries have been installed in:
/Usr/local/APR/lib
......
#Echo/usr/local/APR/lib>/etc/lD. So. conf. d/lamp. conf
//Add/usr/local/APR/lib to the shared library directory, and execute the ldconfig command to take effect.
Libiconv-1.13.tar.gz-->Extract
#./Configure -- enable-static
#Make & make install
Apr-iconv-1.2.1.tar.gz-->Extract
#./Configure -- With-Apr =/usr/local/APR/bin/apr-1-config
#Make & make install
Apr-util-1.4.1.tar.gz-->Extract
#Ln-S/usr/src/lamp/apr-iconv-1.2.1/usr/src/lamp/apr-util-1.4.1/APR-iconv
#. /Configure -- With-Apr =/usr/local/APR/bin/apr-1-config -- With-Apr-iconv =. /ARP-iconv -- With-OpenSSL =/usr -- With-nss =/usr -- With-mysql =/usr/local/MySQL -- With-iconv =/usr/local
#Make & make install
Pcre-7.9.tar.gz-->Extract
#./Configure -- enable-rebuild-chartables -- enable-utf8 -- enable-newline-is-any -- enable-pcregrep-libz -- enable-pcregrep-libbz2
#Make & make install
Httpd-2.2.22.tar.gz-->Extract
#. /Configure -- enable-modules = all -- enable-mod-shared = all -- enable-file-Cache -- enable-disk-Cache -- enable-Mem-Cache -- enable -dumpio -- enable-echo -- enable-example -- enable-logio -- enable-mime-magic -- enable-expires -- enable-headers -- enable-unique-id -- enable-proxy -- enable -proxy-balancer -- enable-proxy-HTTP -- enable-proxy-AJP -- enable-proxy-connect -- enable-SSL -- enable-static-AB -- enable-HTTP -- enable-Info -- enable-CGI -- enable-vhost-alias -- enable-so -- enable-Rewrite -- With-Apr =/usr/local/APR/bin/apr-1-config -- With-Apr-util = /usr/local/APR/bin/apu-1-config -- With-PCRE =/usr/local -- With-SSL =/usr -- With-MPM = prefork
# Make & make install
Related Configuration:
######################################## ######################################## ###############################
1. Chinese
/Usr/local/apache2/CONF/httpd. conf
/Usr/local/apache2/CONF/extra/httpd-languages.conf
Httpd-languages.conf
Defaultlanguage ZH-CN
Languagepriority ZH-CN... # modify the Chinese priority
2. VM
/Usr/local // apache2/conf // httpd. conf
Includeconf/extra/httpd-vhosts.conf
Namevirtualhost *: 80
<Virtualhost *: 80>
Docuementroot/WWW
Servername teacher.cluster.com
Customlog/var/log/httpd/teacher-access.log combined
Errorlog/var/log/httpd/teacher-error.log
</Virtualhost>
3.404
/Usr/local // apache2/conf // httpd. conf
Errordocument404/404.html
4. Allow access
Order deny, allow
Deny from all
5. Index
Directoryindex index.html index. php
6. Monitoring
/Usr/local // apache2/conf // httpd. conf
Includeconf/extra/httpd-info.conf
<Location/Server-status>
Sethandlerserver-status
Order deny, allow
Deny from all
Allow from10.1.1.0/255.255.255.0
</Location>
Extendedstatus on
######################################## ######################################## ###############################
Freetype-2.4.9.tar.gz-->Extract
#./Configure
#Make & make install
Libpng-1.5.9.tar.gz-->Extract
#./Configure -- With-zlib-Prefix =/usr -- With-pkgconfigdir =/usr/lib/pkgconfig/
#Make & make install
Jpegsrc.v8.tar.gz-->Extract
#./Configure & make install
# Yum install-y imake
Xpm-3.4k.tar.gz-->Extract
#Xmkmf-
#Make
#Make install. Man
Gd-2.0.36RC1.tar.gz-->Extract
#. /Configure -- With-libiconv-Prefix =/usr/local -- With-PNG =/usr/local -- With-FreeType =/usr/local -- With-fontconfig =/usr -- -JPEG =/usr/local -- With-XPM =/usr/local
#Make & make install
Libmcrypt-2.5.8.tar.bz2-->Extract
#./Configure -- enable-static
# Make & make install
Mhash-0.9.9.9.tar.bz2-->Extract
#./Configure
#Make & make install
Mcrypt-2.6.6.tar.gz-->Extract
#./Configure -- With-libiconv-Prefix =/usr/local -- With-libmcrypt-Prefix =/usr/local
#Make & make install
#Yum install-y libxml2 libcurl-devel
Php-5.3.10.tar.gz-->Extract
#. /Configure -- with-apxs2 =/usr/local/apache2/bin/apxs -- disable-ipv6 -- With-libxml-Dir =/usr -- With-OpenSSL =/usr -- With-PCRE-RegEx = /usr/local -- With-zlib =/usr -- with-bz2 =/usr -- enable-calendar -- With-curl =/usr -- With-PCRE-Dir =/usr/local
-- Enable-FTP -- With-OpenSSL-Dir =/usr -- With-Gd =/usr/local -- With-JPEG-Dir =/usr/local -- With-PNG-Dir = /usr/local -- With-zlib-Dir =/usr/local -- With-XPM-Dir =/usr -- With-FreeType-Dir =/usr/local -- enable-Gd- native-TTF -- enable-Gd-JIS-Conv -- With-mhash =/usr/local -- enable-mbstring
-- With-mcrypt =/usr/local -- With-mysql =/usr/local/MySQL -- With-mysql-Sock =/var/run/myqld/mysql5.socket -- With-mysqli = /usr/local/MySQL/bin/mysql_config -- With-SNMP =/usr -- enable-sockets -- enable-zip
#Make & make install
Note: Once PHP compilation fails, delete the source code and recompile it !!!
PHP configuration
######################################## ######################################## ###############################
A.CP/usr/src/lamp/php-5.3.10/PHP. ini-production/usr/local/lib/PHP. ini
PHP. ini
1. Session
Session. save_path = "/tmp/session" <-the session directory must be created and the attribute must be changed to the Apache owner)
2. Support MySQL
MySQL. default_socket =/var/run/mysqld/mysql5.socket
Mysqli. default_socket =/var/run/mysqld/mysql5.socket
3.Upload File limit
Upload_max_filesize = 2 m # webpage upload restrictions
B./Usr/local/apache2/CONF/httpd. conf
Loadmodule php5_module modules/libphp5.so
# Confirm that you do not need to add it again. After installation, it is automatically added to the Apache configuration file.
Addtype application/X-httpd-PHP. php. phtml
Addtype application/X-httpd-PHP-source. PHPs
# Manually add the above two rows
C.Restart Apache (restart Apache to take effect)
D.Add php patch<Add extension after PHP compilation is complete>
For example, join:Bcmath extension module
CD to the bcmath directory (PhP extensions are included in the ext directory of the source code directory). perform the following operations:
# Phpize //Generate the compilation environment and configure file
#./Configure
# Make install
# Vi/usr/local/lib/PHP. ini // manually add the following content to the PHP. ini configuration file.
Extension_dir = "/usr/local/lib/PHP/extensions/no-debug-non-zts-20090626 /"
Extension = "bcmath. So"
######################################## ######################################## ###############################