After two days, we finally set up a complete LAMP Development Environment on CentOS6.0. There was a lot of trouble in the process, but we had to solve it a little bit. You have written this installation document for yourself and those who encounter problems during later installation. Give roses to others and leave remaining fragrance in your hands. I. Build the environment: 1. CentOS6.0 Virtual Machine (minimum installation) 2. putty3 and sshshe
After two days, we finally set up a complete LAMP Development Environment on CentOS 6.0. There was a lot of trouble in the process, but we had to solve it a little bit. You have written this installation document for yourself and those who encounter problems during later installation. Give roses to others and leave remaining fragrance in your hands.
1. Set up the environment:
1. CentOS 6.0 Virtual Machine (minimum installation)
2. putty
3. ssh shell
Ii. preparations:
1. source code package
2. Install the gcc and gcc-c ++ Compiler (yum installation)
EnterCommandYum install gccAndYum install gcc-c ++If the network cannot be connected, mount the centos CD image and modify the local source of yum so that the machine can be installed in yum mode.
3. Check whether mysql,Php, Apache, use the commandRpm-qa mysql. If yes, run the command rpm-e package's full name-nodeps Uninstall.
4. Disable selinux and clear firewall rules.
5. open ports 80, 3306, and 22
By default, ports 80, 3306, and 22 of the firewall are disabled. In this way, access to the web on the virtual machine from the client may fail. So enable it.
Service iptables stop
#/Sbin/iptables-I INPUT-p tCp-- Dport 80-j ACCEPT// It is an uppercase English letter I, not a number 1
#/Sbin/iptables-I INPUT-p tcp -- dport 22-j ACCEPT
#/Sbin/iptables-I INPUT-p tcp -- dport 3306-j ACCEPT
Then save:
#/Etc/rc. d/init. d/iptables save
Restart Firewall
Service iptables restart
6. Create a directory named lamp in linux to store the uploaded source code.
7. Use ssh shell to upload the 14 source code packages downloaded in windows to/lamp
8. Unpack
Because there are many packages, write a shell script/lamp/tar. sh to unpackage.
Tar. sh
- #! /Bin/sh
- Cd/Lamp
- Ls* .Tar.gz> ls. list
-
- For TAR in'CatLs. list'
- Do
- Tar-zxvf $ YAR
- Done
Run the script tar. sh to unpack the package.
9. Delete all source code packages * .tar.gz
Iii. Installation Process:
1. For ease of operation, write the installation script/lamp. sh for installation.
Lamp. sh
- Cd/lamp/libxml2-2.6.30
- ./Configure -- prefix =/usr/local/libxml2/
- Make
- Make install
-
- Cd/lamp/libMcRypt-2.5.8
- ./Configure -- prefix =/usr/local/libmcrypt/
- Make
- Make install
-
- Cd/lamp/libmcrypt-2.5.8/libltdl
- ./Configure --Enable-Ltdl-install
- Make
- Make install
-
- Cd/lamp/zlib-1.2.3
- ./Configure
- Make
- Make install
-
- Cd/lamp/libpng-1.2.31
- ./Configure -- prefix =/usr/local/libpng/
- Make
- Make install
-
- Mkdir/Usr/local/limit 6
- Mkdir/usr/local/partition 6/bin
- Mkdir/usr/local/IPv6/lib
- Mkdir/usr/local/IPv6/INcLude
- Mkdir-p/usr/local/users 6/man/man1
- Cd/lamp/jpeg-6b
- ./Configure -- prefix =/usr/local/defaults 6/-- enable-sharEd-- Enable-StatIc
- Make
- Make install
-
- Cd/lamp/FreeType-2.3.5
- ./Configure -- prefix =/usr/local/freetype/
- Make
- Make install
-
- Cd/lamp/autoconf-2.61
- ./Configure
- Make
- Make install
-
- Cd/lamp/gd-2.0.35
- ./Configure -- prefix =/usr/local/gd2/-- with-jpeg =/usr/local/versions 6/-- with-freetype =/usr/local/freetype/
- Make
- Make install
-
- Cd/lamp/Httpd-2.2.9
- . /Configure -- prefix =/usr/local/apache2/-- sysconfdir =/etc/httpd/-- with-included-apr -- disable-userdir -- enable-so -- enable-deflate = shared -- enable-ExPires = shared -- enable-reWrite= Shared -- enable-static-SuPport
- Make
- Make install
-
- /Usr/local/apache2/bin/ApachectlStart
- Echo "/usr/local/apache2/bin/apachectl start">/etc/rc. d/rc. sysinit
-
- Cd/lamp/ncurses-5.6
- ./Configure -- with-shared -- without-debug -- without-ada -- enable-overwrite
- Make
- Make install
-
- GroupaDdMysql
- Useradd-G mysql
- Cd/lamp/mysql-5.0.41
- ./Configure -- prefix =/usr/local/mysql/-- with-exTrA-charSetS = all
- Make
- Make install
-
- Cp support-FileMy-medium.cnf/etc/my. cnf
- /Usr/local/mysql/bin/mysql_install_db -- user = mysql
- Chown-R root/usr/local/mysql
- Chown-R mysql/usr/local/mysql/var
- Chgrp-R mysql/usr/local/mysql
-
- /Usr/local/mysql/bin/mysqld_safe -- user = mysql &
-
- Cp/lamp/mysql-5.0.41/support-files/mysql. server/etc/rc. d/init. d/mysqld
- Chown root. root/etc/rc. d/init. d/mysqld
- Chmod755/etc/rc. d/init. d/mysqld
- Chkconfig-- Add mysqld
- Chkconfig -- list mysqld
- Chkconfig -- levels 245 mysqld off
-
- Cd/lamp/php-5.2.6
- . /Configure -- prefix =/usr/local/php/-- with-config-file-path =/usr/local/php/etc/-- with-apxs2 =/usr/local/apache2/ bin/retrial -- with-mysql =/usr/local/mysql/-- with-libxml-dir =/usr/local/libxml2/-- with-jpeg-dir =/usr/local /versions 6/-- with-freetype-dir =/usr/local/freetype/-- with-gd =/usr/local/gd2/-- with-mcrypt =/usr/local/libmcrypt /-- with-mysqli =/usr/local/mysql/bin/mysql_config -- enable-soap -- enable-mbstring = all -- enable-sockets
- Make
- Make install
-
- Cp php. ini-dist/usr/local/php/etc/php. ini
- Echo "Addtype application/x-httpd-php. php. phtml">/etc/httpd. conf
- /Usr/local/apache2/bin/apachectl restart
Execute the script and install it (for a long time, you can go to bed)