http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html installing MySQL
Rpm-qa | grep mysql//This command will check if the MySQL database is already installed on the operating system
RPM-E--nodeps MySQL//brute force Delete mode, if you use the above command to delete, prompted to have other dependent files, then use this command can be strongly deleted
Yum install-y mysql-server MySQL Mysql-deve
Service mysqld Start
Service mysqld Restart
Mysqladmin-u root password ' root '//Use this command to set the root account password to root
At this point we can log in to our MySQL database via the mysql-u root-p command.
Two-mount Apache
Yum install-y gcc gcc-c++
wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz
wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz
wget Http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip
2. Compile and install: Yum remove apr-util-devel Apr apr-util-mysql apr-docs apr-devel apr-util Apr-util-docs
The steps are as follows: A: Solving apr not found problem >>>>>>
[Email protected] test]# TAR-ZXF apr-1.4.5.tar.gz
[Email protected] test]# CD apr-1.4.5
[Email protected] apr-1.4.5]#/configure--PREFIX=/USR/LOCAL/APR
[[email protected] apr-1.4.5]# make && make install
B: Solve apr-util not found problem >>>>
[Email protected] test]# TAR-ZXF apr-util-1.3.12.tar.gz
[Email protected] test]# CD apr-util-1.3.12
[Email protected] apr-util-1.3.12]#/configure--prefix=/usr/local/apr-util-with-apr=/usr/local/apr/bin/ Apr-1-config
[[email protected] apr-util-1.3.12]# make && make install
C: Solve pcre problem >>>>>>>>>
[[email protected] test] #unzip-o pcre-8.10.zip
[[email protected] test] #cd pcre-8.10
[Email protected] pcre-8.10]#./configure--prefix=/usr/local/pcre
[[email protected] pcre-8.10] #make && make install
wget http://apache.fayea.com//httpd/httpd-2.4.10.tar.gz
Execute command TAR-ZXVF httpd-2.4.10.tar.gz, unzip will generate httpd-2.4.10 directory CD httpd-2.4.10 into httpd-2.4.10 directory, search for settings, execute:
./configure--prefix=/usr/local/apache--with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util--with-ssl-- Enable-ssl--enable-module=so--enable-rewrite--enable-cgid--enable-cgi
Make
Make install
/usr/local/apache/bin/apachectl Start Open
Modify port Number Listen 81
ServerName localhost:81
Three PHP
1:wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
TAR-ZXVF libiconv-1.13.1.tar.gz cd libiconv-1.13.1./configure--prefix=/usr/local/libiconv
Make
Make install
Configure error Xml2-config not found. Please check your LIBXML2 installation
Yum Install LIBXML2
Yum Install Libxml2-devel-y
[[email protected]/] # Find/-name "Xml2-config"
/usr/bin/xml2-config
If the installation succeeds, the bin, include, Lib, man, and share five directories will be generated under the/usr/local/libxml2/directory. When you install the configuration of the PHP5 source package later, you specify the location where the LIBXML2 library files are installed by adding the "--with-libxml-dir=/usr/local/libxml2" option in the options for the Configure command.
Undefined reference to ' libiconv_open cannot compile PHP libiconv
Workaround: #wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz #tar-zxvf libiconv-1.13.1.tar.gz #cd libiconv-1.13.1 #/configure--prefix=/usr/local/libiconv # make # Install
Add this sentence, please.
--with-iconv=/usr/local/libiconv
wget http://cn2.php.net/distributions/php-5.5.20.tar.gz
Tar zvxf php-5.5.20.tar.gz
CD php-5.5.20
./configure--prefix=/usr/local/php--disable-fileinfo--enable-maintainer-zts--with-apxs2=/usr/local/apache/ Bin/apxs--with-iconv=/usr/local/libiconv--with-config-file-path=/usr/local/php/etc
Make install
4. Reconfigure apache2 to let him support PHP
- Configure HTTPD.CONF to allow Apache to support PHP:
# vi/usr/local/apache/conf/httpd.conf
Locate AddType application/x-gzip. gz. tgz below to add the following
AddType application/x-httpd-php. PHP (with spaces in front)
AddType Application/x-httpd-php-source. PHPS (front with spaces)
In the LoadModule php5_module modules/libphp5.so line, add the following: AddType application/x-httpd-php. PHP (Note: PHP. php This dot is preceded by a space)
Found in:; Open_basedir =
Modified to: Open_basedir =.:/ tmp/#防止php木马跨站
Found:;d Ate.timezone =
Modified to: Date.timezone = PRC
- Then cpopy the PHP configuration file
CP Php-5.3.8/php.ini.dist/usr/local/php/etc/php.ini
(If there is no php.ini.dist, rename any one of the php.ini-development php.ini-production to Php.ini.dist.) )
Modify php.ini file Register_globals = On
4:nginx
Yum install libtool yum install zlib zlib-devel
Yum Install OpenSSL
Configure:error:You need a C + + compiler for C + + support. (Workaround: Yum install-y gcc gcc-c++)
http://chenzhou123520.iteye.com/blog/1817563 [Pcre] Installation
http://nginx.org/Download Nginx
wget http://nginx.org/download/nginx-1.0.1.tar.gz
Tar zxvf nginx-1.0.1.tar.gz
CD NGINX-1.0.1/
./configure--prefix=/usr/local/nginx--with-http_stub_status_module--with-pcre= Here is the source code directory for Pcre, not the installation directory
Make && make install
The Nginx startup command is:
/usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.conf
#/usr/local/nginx/sbin/nginx-s Reload
Nginx has been restarted successfully
Configuration:
Location/{
Root/usr/local/apache/htdocs;
Index index.html index.htm;
}
Location ~ \.php$ {
Proxy_set_header Host $http _host;
Proxy_set_header X-real-ip $remote _addr;
Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;
Proxy_pass http://127.0.0.1:81;
}
Location ~.*\. (jpg|jepg|png) $ {
Root/usr/local/apache/htdocs;
Access_log off;
Expires 3d;
}
Location ~.*\. (JS|CSS) $ {
Root/usr/local/apache/htdocs;
Access_log off;
Expires 3d;
}
Php+mysql+apache+nginx