httpd 2.4.9 + mysql-5.5.33 + php-5.4.26 Compile the installation process:
1 , installation httpd
Configure the Yum source Vim/etc/yum.repo/centos.repo, where the BaseURL is set based on the actual provisioned Yum warehouse
[DVD1]
Name=centos-dvd1
baseurl=http://172.16.0.1/cobbler/ks_mirror/centos-6.6-x86_64/
Enabled=1
Gpgcheck=0
[DVD2]
Name=centos-dvd2
baseurl=http://172.16.0.1/centos/6/extras/x86_64/
Enabled=1
Gpgcheck=0
[Epel]
Name=centos-epel
baseurl=http://172.16.0.1/fedora-epel/6/x86_64/
Enabled=1
Gpgcheck=0
[Base]
Name=centos-base
Baseurl=file:///media/cdrom
Enabled=1
Gpgcheck=0
Download the installation package: (here is my download path)
Lftp 172.16.0.1
CD pub/sources/sources/httpd/
Mget apr-1.5.0.tar.bz2apr-util-1.5.3.tar.bz2 httpd-2.4.9.tar.bz2
Bye
Compile and install httpd, in order to save trouble, I wrote a script vim install-httpd.sh
#!/bin/bash
#mount CDROM
Mkdir/media/cdrom
Mount/dev/cdrom/media/cdrom
Yum Clean All
Yum Repolist
#install GCC
Yum Groupinstall "Developmenttools" "Server Platform Development"-Y
#apr Install
Tar XF apr-1.5.0.tar.bz2
CD apr-1.5.0
./configure--PREFIX=/USR/LOCAL/APR
Make && make install
Cd
#apr-util Install
Tar XF apr-util-1.5.3.tar.bz2
CD apr-util-1.5.3
./configure--PREFIX=/USR/LOCAL/APR-UTIL--WITH-APR=/USR/LOCAL/APR
Make && make install
Cd
#httpd Install
Yum Install Pcre-devel-y
Tar XF httpd-2.4.9.tar.bz2
CD httpd-2.4.9
./configure--prefix=/usr/local/apache--sysconfdir=/etc/httpd24--enable-so--enable-ssl-- Enable-cgi--enable-rewrite--with-zlib--with-pcre--with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util-- Enable-modules=most--enable-mpms-shared=all--with-mpm=event
Make && make install
run this script bash install-httpd.sh
After running, go to the following steps:
Add environment variable vim/etc/profile.d/httpd.sh
join The export path=/usr/local/apache/bin: $PATH
reread the configuration file . /etc/profile.d/httpd.sh
Export Header file ln–sv/usr/local/apache/include//usr/include/httpd
Export man Handbook
Vim/etc/man.config
Join Manpath/usr/local/apache/man
compiling vim/etc/httpd24/httpd.conf
Add Pidfile "/var/run/httpd.pid"
Set Startup scripts
Cp/etc/init.d/httpd/etc/init.d/httpd24
Vim/etc/init.d/httpd24
Modify the following three items:
Apachectl=/usr/local/apache/bin/apachectl
HTTPD=${HTTPD-/USR/LOCAL/APACHE/BIN/HTTPD}
Pidfile=${pidfile-/var/run/httpd.pid}
Hash–r
Then give execute permission for this script:
chmod +x/etc/rc.d/init.d/httpd24
Join the Service list:
Chkconfig--add httpd
try to start the httpd service
2 , install MYSQL
Create a new logical volume FDISK/DEV/SDA
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/C0/wKioL1WGSySy3CyOAAG5kVYAyJY286.jpg "title=" 1.png " alt= "Wkiol1wgsysy3cyoaag5kvyayjy286.jpg"/>
perform 2-3 partx–a/dev/sda forced load
Create Lvm
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/C4/wKiom1WGSXug_jtHAAElw9il3k8722.jpg "title=" 2.png " alt= "Wkiom1wgsxug_jthaaelw9il3k8722.jpg"/>
Formatting Mke2fs/dev/myvg/mydata
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/C0/wKioL1WGSz3BtbcBAAFyAYTZEmw625.jpg "title=" 3.png " alt= "Wkiol1wgsz3btbcbaafyaytzemw625.jpg"/>
Create mydata directory mkdir MyData
Mount The MyData to the MyData directory vim/etc/fstab
Add last line
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/C4/wKiom1WGSZqBZL9TAAFck-0VzKM602.jpg "title=" 4.png " alt= "Wkiom1wgszqbzl9taafck-0vzkm602.jpg"/>
automatic Mount mount–a; Mount
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/C0/wKioL1WGS1yRBN0pAADcwfnPz4E684.jpg "title=" 5.png " alt= "Wkiol1wgs1yrbn0paadcwfnpz4e684.jpg"/>
Download mariadb-5.5.43-linux-x86_64.tar.gz
next in the root directory made a script vim install-mysql.sh, execution can be
#!/bin/bash
Mkdir/mydata/data-pv
#useradd
Groupadd-r MySQL
Useradd-g mysql-r-s/sbin/nologin-m-d/mydata/data MySQL
Chown-r Mysql:mysql/mydata/data
#initialize
Tar XF mariadb-5.5.43-linux-x86_64.tar.gz-c/usr/local
cd/usr/local/
LN-SV mariadb-5.5.43-linux-x86_64 MySQL
CD MySQL
Chown-r Mysql:mysql.
scripts/mysql_install_db--user=mysql--datadir=/mydata/data
Chown-r Root.
Cd/usr/local/mysql
CP SUPPORT-FILES/MY-LARGE.CNF/ETC/MY.CNF
Modify the configuration vim/etc/my.cnf in my.cnf:
Thread_concurrency = 8
added:datadir =/mydata/data
Innodb_file_per_table = On
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/C4/wKiom1WGSbmTvCDJAAAu1vxzPqo978.jpg "title=" 6.png " alt= "Wkiom1wgsbmtvcdjaaau1vxzpqo978.jpg"/>
provide sysv service script for MySQL:
Cd/usr/local/mysql
CP Support-files/mysql.server/etc/rc.d/init.d/mysqld
chmod +x/etc/rc.d/init.d/mysqld
Add to Service list:
Chkconfig--add mysqld
Chkconfig mysqld on
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/C0/wKioL1WGS4CjR_4qAABqESty3GQ949.jpg "title=" 7.png " alt= "Wkiol1wgs4cjr_4qaabqesty3gq949.jpg"/>
Test start:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/C4/wKiom1WGSdrD_boHAABQrlEku7E966.jpg "title=" 8.png " alt= "Wkiom1wgsdrd_bohaabqrleku7e966.jpg"/>
in order to use the MySQL installation to conform to the system usage specification and export its development components to the system, the following steps are required:
output The mysql man manual to The find path of the man command:
Vim/etc/man.config, add the following line:
Manpath/usr/local/mysql/man
output MySQL header file to the System header file path /usr/include:
Ln-sv/usr/local/mysql/include/usr/include/mysql
output the MySQL library file to the system library to find the path:
Echo '/usr/local/mysql/lib ' >/etc/ld.so.conf.d/mysql.conf
The system is then re-loaded into the system library:
Ldconfig
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/C4/wKiom1WGSeXw-QdRAACOBqzroEc807.jpg "title=" 9.png " alt= "Wkiom1wgsexw-qdraacobqzroec807.jpg"/>
modifying environment variables
vim/etc/profile.d/mysql.sh
Add export path=/usr/local/mysql/bin: $PATH
3 , install PHP
Download php-5.4.26.tar.bz2
Mount/dev/cdrom/media/cdrom
Yum-y groupinstall "Desktop platformdevelopment"
Yum-y Install bzip2-devel libmcrypt-devellibmcrypt mhash mhash-devel
# Tar XF php-5.4.26.tar.bz2
# CD php-5.4.26
#./configure--prefix=/usr/local/php--with-mysql=/usr/local/mysql--with-openssl--with-mysqli=/usr/local/mysql/ Bin/mysql_config--enable-mbstring--with-freetype-dir--with-jpeg-dir--with-png-dir--with-zlib--with-libxml-dir= /usr--enable-xml--enable-sockets--enable-fpm--with-mcrypt--with-config-file-path=/ ETC--WITH-CONFIG-FILE-SCAN-DIR=/ETC/PHP.D--with-bz2
Description: If you use PHP5.3 and above, in order to link the MySQL database, you can specify mysqlnd, so that you do not need to install the MySQL or MySQL development package in this machine first . Mysqlnd is available from PHP 5.3 and can be bound to it at compile time (instead of relying on the specific MySQL client library bindings), but it is the default setting starting with PHP 5.4.
#./configure--with-mysql=mysqlnd--with-pdo-mysql=mysqlnd--with-mysqli=mysqlnd
Make && make install
Provide a configuration file for PHP
CP Php.ini-production/etc/php.ini
provide the SysV init script for php-fpm and add it to the list of services:
# CP SAPI/FPM/INIT.D.PHP-FPM/ETC/RC.D/INIT.D/PHP-FPM
# chmod +X/ETC/RC.D/INIT.D/PHP-FPM
# chkconfig--add php-fpm
# Chkconfig PHP-FPM on
Cp/usr/local/php/etc/php-fpm.conf.default/usr/local/php/etc/php-fpm.conf
to edit a php-fpm configuration file:
# vim/usr/local/php/etc/php-fpm.conf
Change PID File Location
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/C0/wKioL1WGS6zAkyzBAAAZB77w37U741.jpg "title=" 10.png "alt=" Wkiol1wgs6zakyzbaaazb77w37u741.jpg "/>
Start error log
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/C0/wKioL1WGS7_hRlJPAAAT7q43Mlk888.jpg "title=" 11.png "alt=" Wkiol1wgs7_hrljpaaat7q43mlk888.jpg "/>
All of these also need to be changed according to the actual situation
Pm.max_children = 50
Pm.start_servers = 5
Pm.min_spare_servers = 2
Pm.max_spare_servers = 8
Start service php-fpm start
Configure httpd-2.4.9
To start the fastcgi module:
LoadModule proxy_modulemodules/mod_proxy.so
LoadModule proxy_fcgi_modulemodules/mod_proxy_fcgi.so
Configure the host to support fcgiand add the following to the host or virtual host:
Proxyrequests OFF
Proxypassmatch ^/(. *\.php) $fcgi://127.0.0.1:9000/usr/local/apache/htdocs/$1
rewrite DirectoryIndex index.php index.html
Save Close
Establish index.php in /usr/local/apache/htdocs/ and write function tests
Restart hpptd24 service
Enter address access in the browser, the PHP welcome page appears as a success.
The installation process, such as missing components, follow the prompts to download and install, change the pass.
The above process of a teacher said gradually completed, all stages are tested without problems, if there are flaws, look.
It is recommended to take a snapshot every time a package is installed, so it is easy to practice repeatedly.
Lamp Build Process Method II (FPM)