Subject: [Fwd: Problem of Virtual host]

From: [email-masked]
Date: Mon, 05 Aug 2002 12:11:57 +0800

Subject: Problem of Virtual host
From: [email-masked]
To: [email-masked]
Date: Mon, 05 Aug 2002 01:40:58 +0800

Hello,

This my setting of virtual-host :

<VirtualHost 192.168.200.1>
DocumentRoot "/home/domain1/html"
ServerName domain1.com
ServerAdmin root@@domain1.com
<Directory "/home/domain1/html">
 Options Indexes Includes FollowSymLinks MultiViews ExecCGI
 AllowOverride All
 Order allow,deny
 Allow from all
</Directory>
ErrorLog /var/log/httpd/domian1-error.log
CustomLog /var/log/httpd/domain1-access.log common
</VirtualHost>

<VirtualHost 192.168.200.1>
DocumentRoot "/home/domain1/html"
ServerName www.domain1.com
ServerAdmin [email-masked]
<Directory "/home/domain1/html">
 Options Indexes Includes FollowSymLinks MultiViews ExecCGI
 AllowOverride All
 Order allow,deny
 Allow from all
</Directory>
ErrorLog /var/log/httpd/domian1-error.log
CustomLog /var/log/httpd/domain1-access.log common
</VirtualHost>

# SSL :

<IfDefine SSL>
<VirtualHost 192.168.200.1>
DocumentRoot "/home/domain2/html"
ServerName domain2.com
ServerAdmin [email-masked]
<Directory "/home/domain2/html">
 Options Indexes Includes FollowSymLinks MultiViews ExecCGI
 AllowOverride All
 Order allow,deny
 Allow from all
</Directory>
ErrorLog /var/log/httpd/domian2-error.log
CustomLog /var/log/httpd/domain2-access.log common
SSLEngine on
SSLCipherSuite
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /usr/local/apache/conf/ssl.crt/server.crt
SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/server.key
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
    SSLOptions +StdEnvVars
</Files>
<Directory "/usr/local/apache/cgi-bin">
    SSLOptions +StdEnvVars
</Directory>
SetEnvIf User-Agent ".*MSIE.*" \
         nokeepalive ssl-unclean-shutdown \
         downgrade-1.0 force-response-1.0
CustomLog /usr/local/apache/logs/upp-ssl.log \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
</IfDefine>

<IfDefine SSL>
<VirtualHost 192.168.200.1>
DocumentRoot "/home/domain2/html"
ServerName www.domain2.com
ServerAdmin [email-masked]
<Directory "/home/domain2/html">
 Options Indexes Includes FollowSymLinks MultiViews ExecCGI
 AllowOverride All
 Order allow,deny
 Allow from all
</Directory>
ErrorLog /var/log/httpd/domian2-error.log
CustomLog /var/log/httpd/domain2-access.log common
SSLEngine on
SSLCipherSuite
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /usr/local/apache/conf/ssl.crt/server.crt
SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/server.key
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
    SSLOptions +StdEnvVars
</Files>
<Directory "/usr/local/apache/cgi-bin">
    SSLOptions +StdEnvVars
</Directory>
SetEnvIf User-Agent ".*MSIE.*" \
         nokeepalive ssl-unclean-shutdown \
         downgrade-1.0 force-response-1.0
CustomLog /usr/local/apache/logs/upp-ssl.log \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>

error_log file :

[Mon Aug  5 01:28:01 2002] [warn] VirtualHost 192.168.200.1:80 overlaps
with VirtualHost 192.168.200.1:80, the first has precedence, perhaps you
need a NameVirtualHost directive
[Mon Aug  5 01:28:01 2002] [warn] VirtualHost 192.168.200.1:80 overlaps
with VirtualHost 192.168.200.1:80, the first has precedence, perhaps you
need a NameVirtualHost directive
[Mon Aug  5 01:28:01 2002] [warn] VirtualHost 192.168.200.1:80 overlaps
with VirtualHost 192.168.200.1:80, the first has precedence, perhaps you
need a NameVirtualHost directive
[Mon Aug  5 01:28:01 2002] [crit] (98)Address already in use: make_sock:
could not bind to port 80

So, can you help me ?

Thanks,

Edward.

---

From: "Peter Viertel" <[email-masked]>
Date: Mon, 05 Aug 2002 09:23:43 +0100

a) put port numbers into your virtualhost headers eg:

<VirtualHost 192.168.200.1:80>
#for http vhosts

<VirtualHost 192.168.200.1:443>
#for ssl vhosts.

(and dont forget to add Listen directives for both ports 80 and 443... see example httpd.conf).

b) use a NameVirtualHost directive for the port 80 vhosts
NameVirtualHost 192.168.200.1:80
(or just have one vhost, in your example there is no difference between the two, so why not just have one?)

c) you cant really use namevirtualhost on SSL vhosts - well it will run, but you'll get issues with certificates - see the FAQ at http://www.modssl.org/

d) the errorlog says you cant start apache because there is another program already running which is listening on port 80 - or possibly its that you are not running apache as root (and therefore cannot bind to ports less than 1024).

[email-masked] wrote:

>
> ------------------------------------------------------------------------
>
> Subject:
> Problem of Virtual host
> From:
> [email-masked]
> Date:

______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [email-masked]
Automated List Manager                            [email-masked]

---

From: Maurizio Marini <[email-masked]>
Date: Mon, 5 Aug 2002 10:24:34 +0200

On Monday 05 August 2002 06:11 am, [email-masked] wrote:

# SSL :

<IfDefine SSL>

try

-- maumar