我安装一个apache,apche的cgi-bin在/usr/local/apache/cgi下,我又安装了一个程序,目录在/home/wmail,cgi-bin在/home/wmail/www/cgi-bin下。我设置apache的httpd.conf的虚拟主机:
<VirtualHost *:80>
SetEnv SQWEBMAIL_TEMPLATEDIR /home/wmail/html
ScriptAlias /cgi-bin/ "/home/wmail/www/cgi-bin/"
<Directory "/home/wmail/www">
AllowOverride All
Options +Includes
</Directory>
ServerAdmin a@a.net
DocumentRoot /home/wmail/www
ServerName mail.xxx.com
</VirtualHost>
这样设置以后可以访问/home/wmail/www/cgi-bin下的wmail了,但是现在不能访问apche目录下/usr/local/apache/cgi-bin下的cgi程序了,怎样才能实现我现在既能访问/home/wmail/www/cgi-bin下的程序,又能访问/usr/local/apache/cgi-bin下的程序呀?
谢谢各位帮忙,真是没有头绪呀!
peijun.jiang 回复于:2003-07-22 17:37:22问题已经解决,可以使用一下方法实现:
[code:1:d38cfc4441]
Port 80
ServerName www.mydomain.com
NameVirtualHost 192.168.0.1
<VirtualHost 192.168.0.1:80>
SetEnv SQWEBMAIL_TEMPLATEDIR /home/wmail/html
ScriptAlias /cgi-bin/ "/home/wmail/www/cgi-bin/"
<Directory "/home/wmail/www">
AllowOverride All
Options +Includes
</Directory>
ServerAdmin a@a.net
DocumentRoot /home/wmail/www
ServerName www.mydomain.com
</VirtualHost>
<VirtualHost 192.168.0.1:80>
ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"
<Directory "/usr/local/apache/htdocs">
AllowOverride All
Options +Includes
</Directory>
ServerAdmin a@a.net
DocumentRoot /usr/local/apache/htdocs
ServerName www1.mydowain.com
</VirtualHost>
这是基于同一个IP地址,不同域名的实现方法。
[/code:1:d38cfc4441]
郝君 回复于:2003-08-19 02:08:41倒是自问自答~~~~
artxing 回复于:2003-09-27 19:11:29不错.我正好用上