Re: [OT] Re: Multiple Sites
(Though, it's always seemed to me that it might be a decent design to have *one* vhost dedicated to accepting payments for the other vhosts... so when the user is ready to close the deal they get kicked to payment.super_secure.com where they're asked for the credit card info to finish processing). i have seen it done this way before. just got to make sure you can identify the client since you will not get back a cookie for your vhost. you will probably have to reset the cookie for the domain of your isp, or pass as hidden data, or in the url. http://www.mydomain.com/buystuffnow.html https://www.isp.com/~mydomain.com/paymenow.html?sessionID=xyz987123456 -- ___cliff [EMAIL PROTECTED]http://www.genwax.com/
Re: [OT] Re: Multiple Sites
Joe Brenner wrote: Andy Sharp [EMAIL PROTECTED] wrote: As others have aluded to, if you're trying to serve multiple domains (or hostnames) off one IP, you use a system called software virtual hosting. HTTP/1.1 Supports the Host: field in the http header to resolve to the site domain. There's a limitation on virtual hosts though, if you want to do any kind of ecommerce stuff with SSL (which works via the IP number), it won't work if you try to do it with more than one of the vhosts. Yeah, I've scratched my head on that issue before. Eventually I gave up after reading the mod_ssl docs: http://www.modssl.org/docs/2.8/ssl_faq.html#vhosts The most common way to do it is to use IP aliasing to assign multiple IPs to your server, once for each SSL vhost. I just did a search through the apache-modssl mailing list, and you can actually do multiple unique SSL name-based vhosts on the same IP, _if_ use use separate ports for each. That might be acceptable as well... ie domain1.com is accessed via https://domain1.com:1000, domain2.com is https://domain2.com:1001, etc. http://marc.theaimsgroup.com/?l=apache-modsslw=2r=1s=ssl+virtual+host+name+basedq=b -- Regards, Wim Kerkhoff, Software Engineer Merilus, Inc. -|- http://www.merilus.com Email: [EMAIL PROTECTED]
[OT] Re: Multiple Sites
Andy Sharp [EMAIL PROTECTED] wrote: As others have aluded to, if you're trying to serve multiple domains (or hostnames) off one IP, you use a system called software virtual hosting. HTTP/1.1 Supports the Host: field in the http header to resolve to the site domain. There's a limitation on virtual hosts though, if you want to do any kind of ecommerce stuff with SSL (which works via the IP number), it won't work if you try to do it with more than one of the vhosts. So you're clients are going to be stuck using an external agency (like paypal?) if they want to take on-line payments. (Though, it's always seemed to me that it might be a decent design to have *one* vhost dedicated to accepting payments for the other vhosts... so when the user is ready to close the deal they get kicked to payment.super_secure.com where they're asked for the credit card info to finish processing).
Re: Multiple Sites
It rather sounds to me that you have a TransHandler that needs some polishing. The translation handler should inspect for the resolved path being a directory. If it is a directory and the requested uri is lacking a trailing forward slash then it needs to issue a redirect with the trailing slash as mod_dir would have done. If the resolved path is a directory and the uri includes the trailing forward slash, then you'll need to resolve the index file. It is possible, however, to run some preliminary translation on the uri -- pulling out and noting interesting things from the uri -- and then DECLINE the request to allow Apache's translations to finish resolving the request to a file. Here's an example of this: package My::Apache::TransHandler; use strict; use Apache::Constants qw(:response); sub handler { my $r = shift; # Assuming a pipe delimited list of virtual directories # set these in httpd.conf like this: # PerlSetVar VirtualDirectories dir1|dir2|dir3|dir4 my $virtual_dirs = $r-dir_config('VirtualDirectories'); if ( $r-uri =~ m!^/($virtual_dirs)$!o ) { # virtual directory only, no trailing slash $r-header_out( Location = $r-uri . / ); return REDIRECT; } # see if the uri contains the prefix if ( $r-uri =~ m!^/($virtual_dirs)/(.*)!o ) { # save the virtual path in $r-notes $r-notes('VIRTUAL_PATH' = $1); # reset the uri to everything following the virtual directory # you may want to change this in some other way $r-uri( /$2 ); } # if you want apache to finish resolving the uri to a file... return DECLINED; # otherwise, add code to resolve to the file } 1; NOTE: I've not tested the above code, so it could contain errors. Regards, Tim Tompkins -- Programmer http://www.arttoday.com/ http://www.rebelartist.com/ -- - Original Message - From: Purcell, Scott [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, December 03, 2001 11:12 AM Subject: Multiple Sites Hello, I have the need to create 10 web sites off my Apache web server. I do not want to use 10 IP addresses. So I am doing to cheeze and do a URL/directory/index.html foreach site. Then I would give each customer a URL of URL/directory and I would like the index.html or the default.html to come up. But it does not. I edited my conf file to this IfModule mod_dir.c #DirectoryIndex index.html DirectoryIndex default.htm /IfModule But but it does not work. But if I put in URL/directory and a forward slash/ eg. http://URL/directory/ then it shows the default.htm page. But I know my customers, and they will not put in the directory forward slash. How do I get around this issue? Thanks Scott Purcell
Multiple Sites
Hello, I have the need to create 10 web sites off my Apache web server. I do not want to use 10 IP addresses. So I am doing to cheeze and do a URL/directory/index.html foreach site. Then I would give each customer a URL of URL/directory and I would like the index.html or the default.html to come up. But it does not. I edited my conf file to this IfModule mod_dir.c #DirectoryIndex index.html DirectoryIndex default.htm /IfModule But but it does not work. But if I put in URL/directory and a forward slash/ eg. http://URL/directory/ then it shows the default.htm page. But I know my customers, and they will not put in the directory forward slash. How do I get around this issue? Thanks Scott Purcell
RE: Multiple Sites
:: But but it does not work. But if I put in URL/directory and a :: forward slash/ :: eg. http://URL/directory/ then it shows the default.htm page. :: But I know my :: customers, and they will not put in the directory forward slash. How do I :: get around this issue? Scott, The best solution is to use sub-domains, if you are able to effect changes to your DNS. That way your customers can't fail. e.g: http://cust1.yoursite.com/ http://cust2.yoursite.com/ etc. Jonathan M. Hollin - WYPUG Co-ordinator West Yorkshire Perl User Group http://wypug.pm.org/
Re: Multiple Sites
Try setting your directory index like this... DirectoryIndex default.htm index.htm default.html index.html this should catch any one of the four files as the index when you enter http://URL/directory. Also, make sure directory is in your http root path. See the httpd.conf file if you're not sure what your root directory is. Ron Purcell, Scott wrote: Hello, I have the need to create 10 web sites off my Apache web server. I do not want to use 10 IP addresses. So I am doing to cheeze and do a URL/directory/index.html foreach site. Then I would give each customer a URL of URL/directory and I would like the index.html or the default.html to come up. But it does not. I edited my conf file to this IfModule mod_dir.c #DirectoryIndex index.html DirectoryIndex default.htm /IfModule But but it does not work. But if I put in URL/directory and a forward slash/ eg. http://URL/directory/ then it shows the default.htm page. But I know my customers, and they will not put in the directory forward slash. How do I get around this issue? Thanks Scott Purcell
Re: Multiple Sites
Hello, SPBut if I put in URL/directory and a forward slash/ eg. SPhttp://URL/directory/ then it shows the default.htm page. But I know my SPcustomers, and they will not put in the directory forward slash. How do SPI get around this issue? RedirectMatch permanent ^/directory$ http://URL/directory/ Will do you what you want. Humbly, Andrew -- Andrew Ho http://www.tellme.com/ [EMAIL PROTECTED] Engineer [EMAIL PROTECTED] Voice 650-930-9062 Tellme Networks, Inc. 1-800-555-TELLFax 650-930-9101 --
Re: Multiple Sites
But but it does not work. But if I put in URL/directory and a forward slash/ eg. http://URL/directory/ then it shows the default.htm page. But I know my customers, and they will not put in the directory forward slash. How do I get around this issue? http://httpd.apache.org/docs-2.0/mod/mod_dir.html quote This module provides for trailing slash redirects and serving directory index files. /quote quote A trailing slash redirect is issued when the server receives a request for a URL http://servername/foo/dirname where dirname is a directory. Directories require a trailing slash, so mod_dir issues a redirect to http://servername/foo/dirname/. /quote
Re: Multiple Sites
If you only have one IP and want to have many web sites (ie URLs) for your customers, then why don't you use VirtualHost. Then your customers can either have www.customer1.xyz.com www.customer2.xyz.com or www.customer1.com www.customer2.com solve the problem at the root, not at the leaf... Looks like you are trying to do what Apache already does... Unless I missed your point On Tue, 4 Dec 2001, Mithun Bhattacharya wrote: But but it does not work. But if I put in URL/directory and a forward slash/ eg. http://URL/directory/ then it shows the default.htm page. But I know my customers, and they will not put in the directory forward slash. How do I get around this issue? http://httpd.apache.org/docs-2.0/mod/mod_dir.html quote This module provides for trailing slash redirects and serving directory index files. /quote quote A trailing slash redirect is issued when the server receives a request for a URL http://servername/foo/dirname where dirname is a directory. Directories require a trailing slash, so mod_dir issues a redirect to http://servername/foo/dirname/. /quote -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: Multiple Sites
Medi Montaseri wrote: If you only have one IP and want to have many web sites (ie URLs) for your customers, then why don't you use VirtualHost. Then your customers can either have www.customer1.xyz.com www.customer2.xyz.com or www.customer1.com www.customer2.com The originator of this thread didnt exactly say he had control over his DNS.
RE: Multiple Sites
From the start o' the thread: But if I put in URL/directory and a forward slash/ eg. http://URL/directory/ then it shows the default.htm page. But I know my customers, and they will not put in the directory forward slash. How do I get around this issue? This isn't really a mod_perl issue, it's common to all of apache. Even though this isn't in the scope of the list, here's your problem and answer. When you request a file from the apache web server. URL/something and something doesn't exist AND a directory exists under the same name, httpd sends the client a redirect to SERVER_NAME/something/ thus removing the need for people to type the trailing slash. (the server figured out if you need it, and adds it if neccesary, magic eh?) What you need to do is ensure that the ServerName directive in httpd.conf is indeed resolvable, because that's what the client's going to be looking for whenever httpd needs to redirect the client to itself. Sometimes people use the IP address (ugy imho), typically I use the domainname without the www, just because I hate typing. As others have aluded to, if you're trying to serve multiple domains (or hostnames) off one IP, you use a system called software virtual hosting. HTTP/1.1 Supports the Host: field in the http header to resolve to the site domain. Here's the config for the truly lazy (at least it worked for me) NameVirtualHost IP.address.goes.here VirtualHost IP.address.goes.here ServerAdmin DocumentRoot ServerName This is the part that's causing the redirect problem above ErrorLog CustomLog ... ErrorDocument ... ... Aliases ... ProxyPasses ... Any other config oddities ... /VirtualHost Of course all of this is in the httpd guide http://httpd.apache.org/docs/ Search @ http://search.apache.org/docs/ -A -Original Message- If you only have one IP and want to have many web sites (ie URLs) for your customers, then why don't you use VirtualHost. Then your customers can either have [snip] www.customer1.com www.customer2.com The originator of this thread didnt exactly say he had control over his DNS.
Re: Multiple Sites
DNS hosting is about $3/monthif your DNS admin does not allow that, simply move on to the next one... On Tue, 4 Dec 2001, Mithun Bhattacharya wrote: Medi Montaseri wrote: If you only have one IP and want to have many web sites (ie URLs) for your customers, then why don't you use VirtualHost. Then your customers can either have www.customer1.xyz.com www.customer2.xyz.com or www.customer1.com www.customer2.com The originator of this thread didnt exactly say he had control over his DNS. -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -