gccphp
cloog-pplhtml
ppl(libppl.so.7/libppl_c.so.2)mysql
cppc++
mpfr(libmpfr.so.1)web
gcc-c++sql
libstdc++-develshell
mpfr-2.4.1-6.el6.i686.rpm和ppl-0.10.2-11.el6.i686.rpmapache
快捷键rz sz:windows
rz、sz命令没找到?浏览器
安装lrzsz便可:
shell># yum -y install lrzsz
shell>## cd /home/jinnan/tar
shell># tar –zxvf zlib-1.2.5.tar.gz
shell># cd zlib-1.2.5
shell># ./configure //这个配置编译命令不要加目录参数
shell># make && make install
shell># cd /home/jinnan/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-mods-shared=all \
--enable-so
shell># make && make install
启动Apache
shell># /usr/local/http2/bin/apachectl start/stop/restart
#测试apache
浏览器打开: http://虚拟机IP
看到 "it works!",即为成功
配置虚拟主机
1)配置host文件
打开C:/windows/system32/drivers/etc/hosts 文件
增长域名记录
如:
192.168.9.38 www.ec1.com
192.168.9.38 www.ec2.com
2) 增长虚拟主机
vi /usr/local/http2/conf/httpd.conf
取消# Include conf/extra/httpd-vhosts.conf
这一行前面的#号
保存退出
vi /usr/local/http2/conf/extra/httpd-vhosts.conf
增长虚拟主机记录
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
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 webmaster@dummy-host2.example.com
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>
<VirtualHost *:80>
DocumentRoot "/var/www/shop"
ServerName www.ec1.com
</VirtualHost>
注意:/var/www/shop 以上三个目录var www shop 的其余用户必须有x可执行权限
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)重启apache
/usr/local/http2/bin/apachectl restart
5)浏览器打开www.ec1.com,和www.ec2.com
看到不一样的网站内容,虚拟主机建立完毕!
安装图形库,为编译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
shell># cd /home/jinnan/tar
shell># tar zxvf libxml2-2.7.2.tar.gz
shell># cd libxml2-2.7.2
shell>#./configure --prefix=/usr/local/libxml2 \
--without-zlib
shell># make && make install
shell># cd /home/jinnan/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
--enable-shared 把jpeg须要的函数库程序都编译到该软件里边
优势:函数调用速度快
缺点:软件自己比较大
--enable-static 静态方式函数处理,须要什么函数,立刻include来
优势:软件自己比较小
缺点:函数调用速度慢
shell># cd /home/jinnan/tar
shell># tar zxvf libpng-1.4.3.tar.gz
shell># cd libpng-1.4.3
shell>#./configure #和zlib同样不要带参数,让它默认安装到相应目录
shell># make && make install
shell># cd /home/jinnan/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
shell># cd /home/jinnan/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
shell># cd /home/jinnan/tar
shell># tar -jxvf php-5.3.6.tar.bz2
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
复制php.ini配置文件到指定目录
shell># cp php.ini-development /usr/local/php/lib/php.ini
配置Apache使其支持php
vi /usr/local/http2/conf/httpd.conf
1) 在httpd.conf(Apache主配置文件)中增长:
AddType application/x-httpd-php .php
2) 找到下面这段话:
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
在index.html 前面添加index.php
3) 创建php测试网页
vi /usr/local/apache2/htdocs/index.php
输入以下内容:
<?php
phpinfo();
?>
4) 重启apache
shell># /usr/local/http2/bin/apachectl restart
5) 再次浏览器查看http://虚拟机IP
若是看到php信息,工做就完成了!