|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的小伙伴们!RPM装置httpd
#yum-yinstallhttpd
//装置httpd会主动装置一下依附包:
apr
apr-util
httpd-tools
mailcap
#rpm-qihttpd
Name:httpd
Version:2.4.6
Release:18.el7.centos
Architecture:x86_64
InstallDate:Mon11Aug201402:44:55PMCST
Group:SystemEnvironment/Daemons
Size:9793373
License:ASL2.0
Signature:RSA/SHA256,Wed23Jul201411:21:22PMCST,KeyID24c6a8a7f4a80eb5
SourceRPM:httpd-2.4.6-18.el7.centos.src.rpm
BuildDate:Wed23Jul201410:49:10PMCST
BuildHost:worker1.bsys.centos.org
Relocations:(notrelocatable)
Packager:CentOSBuildSystem<http://bugs.centos.org>
Vendor:CentOS
URL:http://httpd.apache.org/
Summary:ApacheHTTPServer
Description:
TheApacheHTTPServerisapowerful,efficient,andextensiblewebserver.
修正设置文件
#cd
/etc/httpd/conf
#ls
httpd.conf
magic
#cphttpd.confhttpd.conf.origin//将原有设置文件备份
#morehttpd.conf
//检察设置文件,我们注重到以一设置:
DocumentRoot"/var/www/html"
//出格是要注重这个设置
//这是Apache2.4的一个新的默许值,回绝一切的哀求!
<Directory/>
AllowOverridenone
Requirealldenied
</Directory>
//设置为主动启动
#systemctlenablehttpd.service
ln-s/usr/lib/systemd/system/httpd.service/etc/systemd/system/multi-user.target.wants/httpd.service
//在centos7中chkconfighttpdon被交换成systemctlenablehttpd
设置WEB站点(假定利用/wwwroot目次下的文档)
//创立两个网站的目次布局及测试用页面文件
#mkdir/wwwroot/www
#echo"www.ckuyun.com">/wwwroot/www/index.html
#mkdir/wwwroot/crm
#echo"crm.bigcloud.local">/wwwroot/crm/index.html
//设置假造机主机
#cd/etc/httpd/
#mkdirvhost-conf.d
#echo"Includevhost-conf.d/*.conf">>conf/httpd.conf
#vi/etc/httpd/vhost-conf.d/vhost-name.conf
//增加以下内容
<VirtualHost*:80>
ServerNamewww.ckuyun.com
DocumentRoot/wwwroot/www/
</VirtualHost>
<Directory/wwwroot/www/>
Requireallgranted
</Directory>
<VirtualHost*:80>
ServerNamecrm.bigcloud.local
DocumentRoot/wwwroot/crm/
</VirtualHost>
<Directory/wwwroot/crm/>
Requireip192.168.188.0/24//能够设置会见限定
</Directory>
欢迎大家来到仓酷云论坛! |
|