(i) Installation of GCC
Gcc
Glibc-devel
Glibc-headers
Kernel-headers
Libgomp
Gcc-c++
Libstdc++-devel
(ii) installation of zlib compression Library
Zlib-1.2.5.tar.gz
shell> Cd/home/shuhua/tar
shell> TAR–ZXVF zlib-1.2.5.tar.gz
shell> CD zlib-1.2.5
shell> ./configure//This configuration compile command do not add directory parameters
shell>make && make install
(iii) installation of Apache
shell> Cd/home/shuhua/tar
shell> TAR-JXVF httpd-2.2.19.tar.bz2
shell> CD httpd-2.2.19
shell>./configure--PREFIX=/USR/LOCAL/HTTP2 \
--enable-modules=all \
--enable-rewrite \
--enable-mods-shared=all \
--enable-so
shell> make && make install
#启动Apache
shell> /usr/local/http2/bin/apachectl start
#测试apache
Browser Open:/HTTP/virtual machine IP
See "It works!", which is the success
Configuring a virtual Host
1) Configuring the host File
Open c:/windows/system32/drivers/etc/hosts File
Add a domain name record
Such as:
192.168.1.246 www.ec1.com
192.168.1.246 www.ec2.com
2) Add Virtual Host
Vi/usr/local/http2/conf/httpd.conf
Cancel # include conf/extra/httpd-vhosts.conf
The # number in front of this line
Save exit
Vi/usr/local/http2/conf/extra/httpd-vhosts.conf
Increase the virtual host record
<virtualhost *:80>
ServerAdmin [email protected]
DocumentRoot "/USR/LOCAL/HTTP2/HTDOCS/EC1"
ServerName www.ec1.com
Serveralias www.dummy-host.example.com
Errorlog "Logs/dummy-host.example.com-error_log"
Customlog "Logs/dummy-host.example.com-access_log" common
</VirtualHost>
<virtualhost *:80>
ServerAdmin [email protected]
DocumentRoot "/USR/LOCAL/HTTP2/HTDOCS/EC2"
ServerName www.ec2.com
Errorlog "Logs/dummy-host2.example.com-error_log"
Customlog "Logs/dummy-host2.example.com-access_log" common
</VirtualHost>
3)
Shell> Cd/usr/local/http2/htdocs
shell> mkdir EC1 EC2
Shell> echo This is ec1.com > ec1/index.html
Shell> echo This is ec2.com > ec2/index.html
4) Restart Apache
/usr/local/http2/bin/apachectl restart
5) Browser opens www.ec1.com, and www.ec2.com
See different site content, virtual host created!
Install the graphics library and prepare for compiling PHP
Libxml2-2.7.2.tar.gz
Jpegsrc.v8b.tar.gz
Libpng-1.4.3.tar.gz
Freetype-2.4.1.tar.gz
Gd-2.0.35.tar.gz
(iv) Installation of LIBXML2
shell> Cd/home/shuhua/tar
shell> Tar zxvf libxml2-2.7.2.tar.gz
shell> CD libxml2-2.7.2
shell>./configure--PREFIX=/USR/LOCAL/LIBXML2
shell> make && make install
(v) Installation of Jpeg8
shell> Cd/home/shuhua/tar
shell> TAR-ZXVF jpegsrc.v8b.tar.gz
shell> CD jpeg-8b
shell>./configure--prefix=/usr/local/jpeg \
--enable-shared--enable-static
shell> make && make install
(vi) Installation of libpng
shell> Cd/home/shuhua/tar
shell> Tar zxvf libpng-1.4.3.tar.gz
shell> CD libpng-1.4.3
shell>./configure #和zlib一样不要带参数, let it install to the appropriate directory by default
shell> make && make install
(vii) Installation of FreeType
shell> Cd/home/shuhua/tar
shell> Tar zxvf freetype-2.4.1.tar.gz
shell> CD freetype-2.4.1
shell>./configure--prefix=/usr/local/freetype
shell> make && make install
(eight) Install GD library
shell> Cd/home/shuhua/tar
shell> tar-zvxf gd-2.0.35.tar.gz
shell> mkdir-p/usr/local/gd
shell> CD gd-2.0.35
shell>./configure--prefix=/usr/local/gd \
--with-jpeg=/usr/local/jpeg/\
--with-png--with-zlib \
--with-freetype=/usr/local/freetype
shell> make && make install
(ix) Installation of PHP5
shell> Cd/home/shuhua/tar
shell> TAR-JXVF php-5.3.6.tar.bz
shell> CD php-5.3.6
shell>./configure--prefix=/usr/local/php \
--WITH-APXS2=/USR/LOCAL/HTTP2/BIN/APXS \
--WITH-MYSQL=MYSQLND \
--WITH-PDO-MYSQL=MYSQLND \
--WITH-MYSQLI=MYSQLND \
--with-freetype-dir=/usr/local/freetype \
--WITH-GD=/USR/LOCAL/GD \
--with-zlib--WITH-LIBXML-DIR=/USR/LOCAL/LIBXML2 \
--with-jpeg-dir=/usr/local/jpeg \
--with-png-dir \
--enable-mbstring=all \
--enable-mbregex \
--enable-shared
shell> make && make install
shell> CP Php.ini-development/usr/local/php/lib/php.ini
Configure Apache to support PHP
Vi/usr/local/http2/conf/httpd.conf
1) in httpd.conf (Apache Master config file), add:
AddType application/x-httpd-php. php
2) Find the following passage:
<ifmodule dir_module>
DirectoryIndex index.html
</IfModule>
Add index.php in front of index.html
3) Build PHP test page
vi/usr/local/apache2/htdocs/index.php
Enter the following content:
<?php
Phpinfo ();
?>
4) Restart Apache
shell>/usr/local/http2/bin/apachectl Restart
5) Again Browser view HTTP//virtual machine IP
If you see PHP information, the work is done!
(10) Installing MySQL
1) Compile and install MySQL
shell> Cd/home/shuhua/tar
shell> TAR-XZVF mysql-5.1.30.tar.gz
shell> CD mysql-5.1.58
shell> ./configure--prefix=/usr/local/mysql \
--with-charset=utf8 \
--with-extra-charsets=gbk,gb2312,binary
Shell> mount ..... Mounting discs
shell>rpm-ivh libtermcap-devel-2.0.8-46 ....
shell> make && make install
2) Configure and initialize MySQL
shell> groupadd MySQL
shell> useradd-g mysql MySQL
shell> CP support-files/my-medium.cnf/etc/my.cnf
shell> Cd/usr/local/mysql
shell> chown-r mysql.mysql.
shell> bin/mysql_install_db--user=mysql \
--datadir=/usr/local/mysql/var
shell> chown-r root.
shell> Chown-r mysql var
shell> bin/mysqld_safe--user=mysql &
3) Test Database
Shell>bin/mysql–uroot
Mysql> showdatabases;
4) Next step, modify the MySQL password (do not do this step, default no password)
Mysql>updateuser SET
Password=password (' New_password ')
whereuser= ' root ';
mysql>flushprivileges;
Linux-"Lamp environment configuration Installation Note installation Steps" 9