LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1789|回复: 3

帮忙~~ 我的linux 5版本的但是apache就是配不好 清高手指点一下

[复制链接]
发表于 2008-12-21 10:56:30 | 显示全部楼层 |阅读模式
下面是我的apache修改的地方:
Listen 80
ServerAdmin olj.company.com
Servername  olj.company.com:80
虚拟机配置为:
namevirtualhost 192.168.8.1
<VirtualHost>
    ServerAdmin olj.company.com
    DocumentRoot /var/www/html/olj
    ServerName olj.company.com
    ErrorLog /var/log/httpd/olj/error_log
    CustomLog /var/log/httpd/olj/access_log common
</VirtualHost>

<VirtualHost jmpbb.company.com>
    ServerAdmin olj.company.com
    DocumentRoot /var/www/html/jmpbb
    ServerName jmpbb.company.com
    ErrorLog /var/log/httpd/jmpbb/error_log
    CustomLog /var/log/httpd/jmpbb/access_log common
</VirtualHost>
是基于ip的  希望高手指点一下~~  谢谢~~
发表于 2009-1-9 17:37:50 | 显示全部楼层
配置如下:
[root@csmy ~]# ifconfig eth0 192.168.39.2 netmask 255.255.255.0 up//设置IP地址
[root@csmy named]# rpm -qa|grep httpd//查看apache安装状态
httpd-2.2.3-11.el5_1.3
httpd-manual-2.2.3-11.el5_1.3

[root@csmy ~]# vi /etc/httpd/conf/httpd.conf//编辑httpd.conf
修改内容如下:
Listen 192.168.39.2:80
ServerAdmin csmy@college.edu
ServerName csmywww.college.edu:80
添加虚拟主机:
NameVirtualHost 192.168.39.2:80
<VirtualHost csmywww.college.edu>
ServerAdmin csmy@college.edu
DocumentRoot /var/www/html/csmywww
ServerName csmywww.college.edu
ErrorLog /var/log/httpd/csmywww/error_log
CustomLog /var/log/httpd/csmywww/access_log common
</VirtualHost>

<VirtualHost research.college.edu>
ServerAdmin csmy@college.edu
DocumentRoot /var/www/html/research
ServerName research.college.edu
ErrorLog /var/log/httpd/research/error_log
CustomLog /var/log/httpd/research/access_log common
</VirtualHost>

<VirtualHost office.college.edu>
ServerAdmin csmy@college.edu
DocumentRoot /var/www/html/office
ServerName office.college.edu
ErrorLog /var/log/httpd/office/error_log
CustomLog /var/log/httpd/office/access_log common
</VirtualHost>

<VirtualHost teach.college.edu>
ServerAdmin csmy@college.edu
DocumentRoot /var/www/html/teach
ServerName teach.college.edu
ErrorLog /var/log/httpd/teach/error_log
CustomLog /var/log/httpd/teach/access_log common
</VirtualHost>


[root@csmy ~]# cd /var/www/html///建立网页主页文件夹
[root@csmy html]# ls
[root@csmy html]# mkdir csmywww
[root@csmy html]# mkdir office
[root@csmy html]# mkdir teach
[root@csmy html]# mkdir research
[root@csmy html]# cd csmywww/
[root@csmy csmywww]# vi index.html//编辑主页
[root@csmy csmywww]# cd ..
[root@csmy html]# cd office/
[root@csmy office]# vi index.html//编辑主页
[root@csmy office]# cd ..
[root@csmy html]# cd teach/
[root@csmy teach]# vi index.html//编辑主页
[root@csmy teach]# cd ..
[root@csmy html]# cd research/
[root@csmy research]# vi index.html//编辑主页
[root@csmy research]# cd /var/log/httpd///建立错误日志文件
[root@csmy httpd]# ls
access_log error_log ssl_access_log ssl_error_log.1
access_log.1 error_log.1 ssl_error_log ssl_request_log
[root@csmy httpd]# mkdir csmywww
[root@csmy httpd]# mkdir office
[root@csmy httpd]# mkdir teach
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-1-12 20:36:21 | 显示全部楼层
大哥~  这个就是我做的阿~!  呵呵 你在那里找到的阿~!?
回复 支持 反对

使用道具 举报

发表于 2009-1-24 23:27:01 | 显示全部楼层
Servername可以注释掉
NameVirtualHost *
<VirtualHost *>
DocumentRoot "/var/www/html/olj"
ServerName olj.company.com
ErrorLog "/var/log/httpd/olj/error_log"
CustomLog "/var/log/httpd/olj/access_log" common
</VirtualHost>
其余类似。。。
以上星号可换成ip地址以指定apache为特定的ip服务。一般情况下星号代表所有。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表