1. 访问ftp报错
解决方法:
关闭selinux
vi /etc/selinux/config
内容修改为: selinux=disable
之后输入reboot重启。
2.依赖软件查询
http://rpmfind.net
一.安装gcc
gcc
cloog-ppl
ppl(libppl.so.7/libppl_c.so.2)
cpp
mpfr(libmpfr.so.1)
gcc-c++
libstdc++-devel
mpfr-2.4.1-6.el6.i686.rpm和ppl-0.10.2-11.el6.i686.rpm
二.安装zlib压缩库
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
三.安装apache
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
看到不同的网站内容,虚拟主机创建完毕