You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cli-users@httpd.apache.org by Gabriele Bianchini <g....@iol.it> on 2005/07/14 09:50:53 UTC
[cli-users] mod_aspdotnet and VirtualHost
Hello.
I'm trying to use mod_aspdotnet in conjunction with VirtualHost directive
but I cant get it to work.
I've a webserver on which I want to run multiple sites with name-based
virtual hosting, so in my httpd.conf I have the following instructions:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "C:/wwwroot"
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/wwwroot/test1"
ServerName test1.local
</VirtualHost>
# -----------------------------------------------------------
# Site 1
# -----------------------------------------------------------
<VirtualHost *:80>
ServerName www.site-one.it
ServerAlias site-one.it *.site-one.it
DocumentRoot "C:/wwwroot/site-one.it/v4.0"
AspNetMount / "C:/wwwroot/site-one.it/v4.0"
<Directory "C:/wwwroot/site-one.it/v4.0">
Options FollowSymlinks Indexes Includes ExecCGI
Order allow,deny
Allow from all
DirectoryIndex default.htm default.aspx
</Directory>
</VirtualHost>
# -----------------------------------------------------------
# Site 2
# -----------------------------------------------------------
<VirtualHost *:80>
ServerName www.site-two.it
ServerAlias site-two.it *.site-two.it
DocumentRoot "C:/wwwroot/site-two.it/v2.0"
AspNetMount / "C:/wwwroot/site-two.it/v2.0"
<Directory "C:/wwwroot/site-two.it/v2.0">
Options FollowSymlinks Indexes Includes ExecCGI
Order allow,deny
Allow from all
DirectoryIndex default.htm default.aspx
</Directory>
</VirtualHost>
I want site-one to be an ASP.NET application and site-two to be a separate
application. They are distinguished only by the host name the client uses to
access my server.
Aside that the docs states that AspNetMount can be placed only OUTSIDE a
VirtualHost directive (but in this way apache always give me error when
doing a request), this configuration seem to work. If I access site-one it's
working perfectly.
If I access site-two it's warking also (aspx pages are served correctly) BUT
it doesn't handle session correctly.
The same site under IIS is working correctly.
It seems to me that it's a problem with the AspNetMount directive but I
tried different combinations and I just cant get it.
Thanks
[cli-users] R: [cli-users] R: [cli-users] mod_aspdotnet and VirtualHost
Posted by Gabriele Bianchini <g....@iol.it>.
But since I have two ASP.NET apps on my server how do I write down the
config?
The problem is that the URI for the two sites are the same (/ - root
directory) and they map to two different dirs on the server.
So could you please show how you would write my config file?
Many thanks
Gabriele Bianchini
-----Messaggio originale-----
Da: William A. Rowe, Jr. [mailto:wrowe@rowe-clan.net]
Inviato: giovedì 21 luglio 2005 18.00
A: cli-users@httpd.apache.org
Oggetto: Re: [cli-users] R: [cli-users] mod_aspdotnet and VirtualHost
At 11:27 AM 7/21/2005, Gabriele Bianchini wrote:
>Hello and thanks.
>
>You say to drop the <Directory>...</Directory> directive out of the vhost
>section and this make sense to me.
>But if I drop the AspNetMount directive out of the vhost section how do I
>have to write it so that it maps each request to the correct site?
ASPNetMount creates an ASP application host object (mapped
to a URI for the benefit of .NET) but doesn't actually serve
that content. You need to point Apache at those files.
The DocumentRoot, or Alias rules point Apache httpd at specific
directories, or files. That's why your use of DocumentRoot in those
two different Virtual Hosts is all you needed to point each host
at a different ASP.NET application :)
Bill
---------------------------------------------------------------------
To unsubscribe, e-mail: cli-users-unsubscribe@httpd.apache.org
For additional commands, e-mail: cli-users-help@httpd.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: cli-users-unsubscribe@httpd.apache.org
For additional commands, e-mail: cli-users-help@httpd.apache.org
Re: [cli-users] R: [cli-users] mod_aspdotnet and VirtualHost
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
At 11:27 AM 7/21/2005, Gabriele Bianchini wrote:
>Hello and thanks.
>
>You say to drop the <Directory>...</Directory> directive out of the vhost
>section and this make sense to me.
>But if I drop the AspNetMount directive out of the vhost section how do I
>have to write it so that it maps each request to the correct site?
ASPNetMount creates an ASP application host object (mapped
to a URI for the benefit of .NET) but doesn't actually serve
that content. You need to point Apache at those files.
The DocumentRoot, or Alias rules point Apache httpd at specific
directories, or files. That's why your use of DocumentRoot in those
two different Virtual Hosts is all you needed to point each host
at a different ASP.NET application :)
Bill
---------------------------------------------------------------------
To unsubscribe, e-mail: cli-users-unsubscribe@httpd.apache.org
For additional commands, e-mail: cli-users-help@httpd.apache.org
[cli-users] R: [cli-users] mod_aspdotnet and VirtualHost
Posted by Gabriele Bianchini <g....@iol.it>.
Hello and thanks.
You say to drop the <Directory>...</Directory> directive out of the vhost
section and this make sense to me.
But if I drop the AspNetMount directive out of the vhost section how do I
have to write it so that it maps each request to the correct site?
Following your hint I should write:
<VirtualHost>
#Site 1 stuff
</VirtualHost>
<VirtualHost>
#Site 2 stuff
</VirtualHost>
AspNetMount ???what-the-hell-goes-here???? "C:/wwwroot/site-one.it/v4.0"
AspNetMount ???what-the-hell-goes-here???? "C:/wwwroot/site-two.it/v2.0"
I really can't get it...
-----Messaggio originale-----
Da: William A. Rowe, Jr. [mailto:wrowe@rowe-clan.net]
Inviato: venerdì 15 luglio 2005 23.54
A: cli-users@httpd.apache.org
Oggetto: Re: [cli-users] mod_aspdotnet and VirtualHost
Lets go through your config...
At 02:50 AM 7/14/2005, Gabriele Bianchini wrote:
>NameVirtualHost *:80
>
><VirtualHost *:80>
> DocumentRoot "C:/wwwroot"
></VirtualHost>
No servername, so this is the fallback.
> <VirtualHost *:80>
> DocumentRoot "C:/wwwroot/test1"
> ServerName test1.local
></VirtualHost>
>
># -----------------------------------------------------------
># Site 1
># -----------------------------------------------------------
><VirtualHost *:80>
> ServerName www.site-one.it
> ServerAlias site-one.it *.site-one.it
> DocumentRoot "C:/wwwroot/site-one.it/v4.0"
Ok so far...
> AspNetMount / "C:/wwwroot/site-one.it/v4.0"
>
> <Directory "C:/wwwroot/site-one.it/v4.0">
> Options FollowSymlinks Indexes Includes ExecCGI
> Order allow,deny
> Allow from all
> DirectoryIndex default.htm default.aspx
> </Directory>
None of this needs to be in a virtual server. Although I don't
know if it will help you to 'lift it out' of this context. The
DocumentRoot maps this server to this mounted app.
></VirtualHost>
>
># -----------------------------------------------------------
># Site 2
># -----------------------------------------------------------
><VirtualHost *:80>
> ServerName www.site-two.it
> ServerAlias site-two.it *.site-two.it
> DocumentRoot "C:/wwwroot/site-two.it/v2.0"
Ditto my comments above...
> AspNetMount / "C:/wwwroot/site-two.it/v2.0"
>
> <Directory "C:/wwwroot/site-two.it/v2.0">
> Options FollowSymlinks Indexes Includes ExecCGI
> Order allow,deny
> Allow from all
> DirectoryIndex default.htm default.aspx
> </Directory>
Go ahead and drop this out of the vhosts section.
></VirtualHost>
>
>
>I want site-one to be an ASP.NET application and site-two to be a separate
application. They are distinguished only by the host name the client uses to
access my server.
>Aside that the docs states that AspNetMount can be placed only OUTSIDE a
VirtualHost directive (but in this way apache always give me error when
doing a request)
... it shouldn't! what error?
>, this configuration seem to work. If I access site-one its working
perfectly.
>If I access site-two its warking also (aspx pages are served correctly)
BUT it doesnt handle session correctly.
>The same site under IIS is working correctly
>It seems to me that its a problem with the AspNetMount directive but I
tried different combinations and I just cant get it
Try reversing the two apps and hosts. Position/order issues
often just pop out at you, and we can narrow down the problem.
---------------------------------------------------------------------
To unsubscribe, e-mail: cli-users-unsubscribe@httpd.apache.org
For additional commands, e-mail: cli-users-help@httpd.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: cli-users-unsubscribe@httpd.apache.org
For additional commands, e-mail: cli-users-help@httpd.apache.org
Re: [cli-users] mod_aspdotnet and VirtualHost
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Lets go through your config...
At 02:50 AM 7/14/2005, Gabriele Bianchini wrote:
>NameVirtualHost *:80
>
><VirtualHost *:80>
> DocumentRoot "C:/wwwroot"
></VirtualHost>
No servername, so this is the fallback.
> <VirtualHost *:80>
> DocumentRoot "C:/wwwroot/test1"
> ServerName test1.local
></VirtualHost>
>
># -----------------------------------------------------------
># Site 1
># -----------------------------------------------------------
><VirtualHost *:80>
> ServerName www.site-one.it
> ServerAlias site-one.it *.site-one.it
> DocumentRoot "C:/wwwroot/site-one.it/v4.0"
Ok so far...
> AspNetMount / "C:/wwwroot/site-one.it/v4.0"
>
> <Directory "C:/wwwroot/site-one.it/v4.0">
> Options FollowSymlinks Indexes Includes ExecCGI
> Order allow,deny
> Allow from all
> DirectoryIndex default.htm default.aspx
> </Directory>
None of this needs to be in a virtual server. Although I don't
know if it will help you to 'lift it out' of this context. The
DocumentRoot maps this server to this mounted app.
></VirtualHost>
>
># -----------------------------------------------------------
># Site 2
># -----------------------------------------------------------
><VirtualHost *:80>
> ServerName www.site-two.it
> ServerAlias site-two.it *.site-two.it
> DocumentRoot "C:/wwwroot/site-two.it/v2.0"
Ditto my comments above...
> AspNetMount / "C:/wwwroot/site-two.it/v2.0"
>
> <Directory "C:/wwwroot/site-two.it/v2.0">
> Options FollowSymlinks Indexes Includes ExecCGI
> Order allow,deny
> Allow from all
> DirectoryIndex default.htm default.aspx
> </Directory>
Go ahead and drop this out of the vhosts section.
></VirtualHost>
>
>
>I want site-one to be an ASP.NET application and site-two to be a separate application. They are distinguished only by the host name the client uses to access my server.
>Aside that the docs states that AspNetMount can be placed only OUTSIDE a VirtualHost directive (but in this way apache always give me error when doing a request)
... it shouldn't! what error?
>, this configuration seem to work. If I access site-one its working perfectly.
>If I access site-two its warking also (aspx pages are served correctly) BUT it doesnt handle session correctly.
>The same site under IIS is working correctly
>It seems to me that its a problem with the AspNetMount directive but I tried different combinations and I just cant get it
Try reversing the two apps and hosts. Position/order issues
often just pop out at you, and we can narrow down the problem.
---------------------------------------------------------------------
To unsubscribe, e-mail: cli-users-unsubscribe@httpd.apache.org
For additional commands, e-mail: cli-users-help@httpd.apache.org
[cli-users] R: [cli-users] mod_aspdotnet and VirtualHost
Posted by Gabriele Bianchini <g....@iol.it>.
Excuse me if this mail has already been sent to you...
The problem with the session is this: in the second site I set a session
variable (Session("UserRecord") = myRecord) but, after a postback, the
session variable is lost.
I tried debugging my application and when I set the session the first time
it works fine but after the postback... puff... my session variable is set
to nothing.
Regards,
Gabriele Bianchini
-----Messaggio originale-----
Da: Todd L Hicks [mailto:electronjockey@hotmail.com]
Inviato: venerdì 15 luglio 2005 23.18
A: cli-users@httpd.apache.org
Oggetto: RE: [cli-users] mod_aspdotnet and VirtualHost
Gabrielle,
If I understand correctly, both of your virtual hosts are parsing asp.net
code correctly with the exception of some session problem.
What problem are you experiencing with sessions?
Can you attach some code that's demonstrates your error.
Regards,
Todd Hicks
-----Original Message-----
From: Gabriele Bianchini [mailto:g.bianchini@iol.it]
Sent: Thursday, July 14, 2005 3:51 AM
To: cli-users@httpd.apache.org
Subject: [cli-users] mod_aspdotnet and VirtualHost
Hello.
I'm trying to use mod_aspdotnet in conjunction with VirtualHost directive
but I cant get it to work.
I've a webserver on which I want to run multiple sites with name-based
virtual hosting, so in my httpd.conf I have the following instructions:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "C:/wwwroot"
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/wwwroot/test1"
ServerName test1.local
</VirtualHost>
# -----------------------------------------------------------
# Site 1
# -----------------------------------------------------------
<VirtualHost *:80>
ServerName www.site-one.it
ServerAlias site-one.it *.site-one.it
DocumentRoot "C:/wwwroot/site-one.it/v4.0"
AspNetMount / "C:/wwwroot/site-one.it/v4.0"
<Directory "C:/wwwroot/site-one.it/v4.0">
Options FollowSymlinks Indexes Includes ExecCGI
Order allow,deny
Allow from all
DirectoryIndex default.htm default.aspx
</Directory>
</VirtualHost>
# -----------------------------------------------------------
# Site 2
# -----------------------------------------------------------
<VirtualHost *:80>
ServerName www.site-two.it
ServerAlias site-two.it *.site-two.it
DocumentRoot "C:/wwwroot/site-two.it/v2.0"
AspNetMount / "C:/wwwroot/site-two.it/v2.0"
<Directory "C:/wwwroot/site-two.it/v2.0">
Options FollowSymlinks Indexes Includes ExecCGI
Order allow,deny
Allow from all
DirectoryIndex default.htm default.aspx
</Directory>
</VirtualHost>
I want site-one to be an ASP.NET application and site-two to be a separate
application. They are distinguished only by the host name the client uses to
access my server.
Aside that the docs states that AspNetMount can be placed only OUTSIDE a
VirtualHost directive (but in this way apache always give me error when
doing a request), this configuration seem to work. If I access site-one it's
working perfectly.
If I access site-two it's warking also (aspx pages are served correctly) BUT
it doesn't handle session correctly.
The same site under IIS is working correctly.
It seems to me that it's a problem with the AspNetMount directive but I
tried different combinations and I just cant get it.
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: cli-users-unsubscribe@httpd.apache.org
For additional commands, e-mail: cli-users-help@httpd.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: cli-users-unsubscribe@httpd.apache.org
For additional commands, e-mail: cli-users-help@httpd.apache.org
RE: [cli-users] mod_aspdotnet and VirtualHost
Posted by Todd L Hicks <el...@hotmail.com>.
Gabrielle,
If I understand correctly, both of your virtual hosts are parsing asp.net
code correctly with the exception of some session problem.
What problem are you experiencing with sessions?
Can you attach some code that's demonstrates your error.
Regards,
Todd Hicks
-----Original Message-----
From: Gabriele Bianchini [mailto:g.bianchini@iol.it]
Sent: Thursday, July 14, 2005 3:51 AM
To: cli-users@httpd.apache.org
Subject: [cli-users] mod_aspdotnet and VirtualHost
Hello.
I'm trying to use mod_aspdotnet in conjunction with VirtualHost directive
but I cant get it to work.
I've a webserver on which I want to run multiple sites with name-based
virtual hosting, so in my httpd.conf I have the following instructions:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "C:/wwwroot"
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/wwwroot/test1"
ServerName test1.local
</VirtualHost>
# -----------------------------------------------------------
# Site 1
# -----------------------------------------------------------
<VirtualHost *:80>
ServerName www.site-one.it
ServerAlias site-one.it *.site-one.it
DocumentRoot "C:/wwwroot/site-one.it/v4.0"
AspNetMount / "C:/wwwroot/site-one.it/v4.0"
<Directory "C:/wwwroot/site-one.it/v4.0">
Options FollowSymlinks Indexes Includes ExecCGI
Order allow,deny
Allow from all
DirectoryIndex default.htm default.aspx
</Directory>
</VirtualHost>
# -----------------------------------------------------------
# Site 2
# -----------------------------------------------------------
<VirtualHost *:80>
ServerName www.site-two.it
ServerAlias site-two.it *.site-two.it
DocumentRoot "C:/wwwroot/site-two.it/v2.0"
AspNetMount / "C:/wwwroot/site-two.it/v2.0"
<Directory "C:/wwwroot/site-two.it/v2.0">
Options FollowSymlinks Indexes Includes ExecCGI
Order allow,deny
Allow from all
DirectoryIndex default.htm default.aspx
</Directory>
</VirtualHost>
I want site-one to be an ASP.NET application and site-two to be a separate
application. They are distinguished only by the host name the client uses to
access my server.
Aside that the docs states that AspNetMount can be placed only OUTSIDE a
VirtualHost directive (but in this way apache always give me error when
doing a request), this configuration seem to work. If I access site-one it's
working perfectly.
If I access site-two it's warking also (aspx pages are served correctly) BUT
it doesn't handle session correctly.
The same site under IIS is working correctly.
It seems to me that it's a problem with the AspNetMount directive but I
tried different combinations and I just cant get it.
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: cli-users-unsubscribe@httpd.apache.org
For additional commands, e-mail: cli-users-help@httpd.apache.org