| Author |
Virtual Named cgi-bin settings
|
|
| Daryl Hunt 2006-11-26, 7:29 am |
| I have been running around in circles trying to find info on using a virtual
named cgi-bin for the Virtual Servers. I know it can be done but it just
won't work the way I have been trying it. I won't go into what I have
tried since it's garbage anyway.
I am using Windows 2000 with Apache 2. What are the settings to allow the
cgi-bin to be placed at a different location than the default server
settings.
I know it's going to be simple and I will probably hit myself in the
forehead when it's explained. Please include the conf lines if you would.
| |
|
| "Daryl Hunt" <dhunt@celticommnospam.com> schreef in bericht
news:45696869$1@news.i70west.com...
>I have been running around in circles trying to find info on using a
>virtual named cgi-bin for the Virtual Servers. I know it can be done but
>it just won't work the way I have been trying it. I won't go into what I
>have tried since it's garbage anyway.
>
> I am using Windows 2000 with Apache 2. What are the settings to allow the
> cgi-bin to be placed at a different location than the default server
> settings.
>
> I know it's going to be simple and I will probably hit myself in the
> forehead when it's explained. Please include the conf lines if you would.
>
Many directives can be (re)appplied to virtualhosts, among them ScriptAlias,
CustomLog and ErrorLog:
NameVirtualHost 111.22.33.44
<VirtualHost 111.22.33.44>
ServerName www.domain.tld
DocumentRoot /web/domain/html
ScriptAlias /web/domain/cgi-bin
CustomLog /extra/www/domain/logs/access_log combined
ErrorLog /extra/www/domain/logs/error_log
</VirtualHost>
Don't use VirtualDocumentRoot and VirrtualScriptAlias, it has a history of
not pars the dynamic document_root [correctly] to scripts
http://httpd.apache.org/docs/2.0/mo...host_alias.html
HansH
| |
| Daryl Hunt 2006-11-26, 7:29 am |
|
"HansH" <hans@niet.op.het.net> wrote in message
news:456985df$0$324$e4fe514c@news.xs4all.nl...
> "Daryl Hunt" <dhunt@celticommnospam.com> schreef in bericht
> news:45696869$1@news.i70west.com...
> Many directives can be (re)appplied to virtualhosts, among them
> ScriptAlias, CustomLog and ErrorLog:
> NameVirtualHost 111.22.33.44
>
> <VirtualHost 111.22.33.44>
> ServerName www.domain.tld
> DocumentRoot /web/domain/html
> ScriptAlias /web/domain/cgi-bin
> CustomLog /extra/www/domain/logs/access_log combined
> ErrorLog /extra/www/domain/logs/error_log
> </VirtualHost>
>
> Don't use VirtualDocumentRoot and VirrtualScriptAlias, it has a history of
> not pars the dynamic document_root [correctly] to scripts
> http://httpd.apache.org/docs/2.0/mo...host_alias.html
>
> HansH
No go. I tried what you have here editing it to fit the system. The error
logs and access log wouldn't let the server start.
I tried the ScriptAlias as well. This has been done many times exactly as
you suggested. Even the www. is returning to the default server as well. I
would think there is some setting in the default server that may need to be
changed but it's beyond me where or what.
<VirtualHost *:80>
DocumentRoot /bigapache/apache/htdocs
ServerName celticomm.com
</VirtualHost>
#<VirtualHost 70.59.54.69:80>
#DocumentRoot /bigapache/apache/htdocs
#ServerName celticomm.com
#</VirtualHost>
<VirtualHost 70.59.54.69>
ServerName colwest.com
DocumentRoot /users/colwest
ScriptAlias /cgi-bin/ /users/colwest
</VirtualHost>
| |
|
| "Daryl Hunt" <dhunt@celticommnospam.com> schreef in bericht
news:45699082$1@news.i70west.com...
>
> "HansH" <hans@niet.op.het.net> wrote in message
> news:456985df$0$324$e4fe514c@news.xs4all.nl...
> No go. I tried what you have here editing it to fit the system. The
> error logs and access log wouldn't let the server start.
Duh, my|sample path is most likely not found at your system
> I tried the ScriptAlias as well. This has been done many times exactly as
> you suggested.
Your snippet below is NOT as suggested...
> Even the www. is returning to the default server as well.
In your snippets below there is no www. prefix to the servername.
If you want to use it too, try
ServerName colwest.com
ServerAlias www.colwest.com
If the requested hostname does not match any ServerName or ServerAlias,
Apache attempts to use the section <VirtualHost _default_> ...
</VirtualHost> or defaults to the first one defined.
http://httpd.apache.org/docs/2.0/vhosts/examples.html
> I would think there is some setting in the default server that may need to
> be changed but it's beyond me where or what.
Do you have a NameVirtualHost directive before any <VirtualHost ....>
NameVirtualHost *:80
> <VirtualHost *:80>
> DocumentRoot /bigapache/apache/htdocs
> ServerName celticomm.com
ServerAlias www.celticomm.com
> </VirtualHost>
>
> <VirtualHost 70.59.54.69>
Each has to match the only NameVirtualhost, so change to
<VirtualHost *:80>
> ServerName colwest.com
ServerAlias www.colwest.com
> DocumentRoot /users/colwest
Is this folder available on your system?
> ScriptAlias /cgi-bin/ /users/colwest
You SHOULD NOT [script]alias your document_root!
[script]alias is mapping a folder from outside your document_root tree into
that tree.
Create a folder html and cgi-bin and move your pages one folder downwards,
then try
DocumentRoot /users/colwest/html
ScriptAlias /cgi-bin/ /users/colwest/cgi-bin
> </VirtualHost>
'Till later
HansH
| |
| Daryl Hunt 2006-11-27, 7:24 am |
|
"HansH" <hans@niet.op.het.net> wrote in message
news:45699b99$0$337$e4fe514c@news.xs4all.nl...
> "Daryl Hunt" <dhunt@celticommnospam.com> schreef in bericht
> news:45699082$1@news.i70west.com...
> Duh, my|sample path is most likely not found at your system
>
> Your snippet below is NOT as suggested...
>
> In your snippets below there is no www. prefix to the servername.
> If you want to use it too, try
> ServerName colwest.com
> ServerAlias www.colwest.com
>
> If the requested hostname does not match any ServerName or ServerAlias,
> Apache attempts to use the section <VirtualHost _default_> ...
> </VirtualHost> or defaults to the first one defined.
> http://httpd.apache.org/docs/2.0/vhosts/examples.html
>
> Do you have a NameVirtualHost directive before any <VirtualHost ....>
> NameVirtualHost *:80
>
>
> ServerAlias www.celticomm.com
> Each has to match the only NameVirtualhost, so change to
> <VirtualHost *:80>
>
> ServerAlias www.colwest.com
>
> Is this folder available on your system?
>
> You SHOULD NOT [script]alias your document_root!
>
> [script]alias is mapping a folder from outside your document_root tree
> into that tree.
>
> Create a folder html and cgi-bin and move your pages one folder downwards,
> then try
> DocumentRoot /users/colwest/html
> ScriptAlias /cgi-bin/ /users/colwest/cgi-bin
>
>
> 'Till later
>
> HansH
After researching Apache, I have noted that it can do it all, yes. But it
requires external configs to do the things that I need. That's a bit more
than I need at this time. I have went to a Windows Server that does it much
easier. Too bad, it was fun for a bit but the fun wore off and the work
began.
Thanks for your assistance, I do appreciate it.
| |
| Daryl Hunt 2006-11-28, 1:19 pm |
| Here we go again. I tried the .htaccess file setup. No go. Here is my
most recent virtual host setup. Everything works except pl and cgi on the
virtualhost. Everything works just fine on the default though.
The error that comes back is that it just can't find the test.pl file
<VirtualHost 70.59.54.69:80>
ServerAdmin dhunt@celticomm.com
DocumentRoot /users/colwest/htdocs
ServerName colwest.com
ServerAlias www.colwest.com
AddHandler cgi-script .cgi .pl
ScriptAlias /cgi-bin/ c:/colwest/cgi-bin/
ErrorLog logs/error.txt
CustomLog logs/access.txt common
</VirtualHost>
| |
|
| "Daryl Hunt" <dhunt@celticommnospam.com> schreef in bericht
news:456c88d4@news.i70west.com...
> Here we go again. I tried the .htaccess file setup. No go. Here is my
> most recent virtual host setup. Everything works except pl and cgi on the
> virtualhost. Everything works just fine on the default though.
>
> The error that comes back is that it just can't find the test.pl file
What is the full path on disk to test.pl?
Please quote the error from logs/error.txt.
> <VirtualHost 70.59.54.69:80>
> ServerAdmin dhunt@celticomm.com
> DocumentRoot /users/colwest/htdocs
> ServerName colwest.com
> ServerAlias www.colwest.com
> AddHandler cgi-script .cgi .pl
> ScriptAlias /cgi-bin/ c:/colwest/cgi-bin/
Blind guess, try
ScriptAlias /cgi-bin/ /users/colwest/cgi-bin/
> ErrorLog logs/error.txt
> CustomLog logs/access.txt common
> </VirtualHost>
HansH
| |
| Daryl Hunt 2006-11-28, 7:28 pm |
|
"HansH" <hans@niet.op.het.net> wrote in message
news:456c9b40$0$324$e4fe514c@news.xs4all.nl...[vbcol=seagreen]
> "Daryl Hunt" <dhunt@celticommnospam.com> schreef in bericht
> news:456c88d4@news.i70west.com...
error.txt
-------
e Nov 28 13:46:43 2006] [error] [client 70.59.54.69] script not found or
unable to stat: C:/colwest
[Tue Nov 28 13:46:50 2006] [error] [client 70.59.54.69] script not found or
unable to stat:
C:/colwest
[Tue Nov 28 13:50:41 2006] [error] [client 70.59.54.69] script not found or
unable to stat:
C:/colwest
access.txt
--------
70.59.54.69 - - [28/Nov/2006:13:46:43 -0700] "GET /cgi-bin/test.pl HTTP/1.1"
404 1193
70.59.54.69 - - [28/Nov/2006:13:46:50 -0700] "GET /cgi-bin/test.pl HTTP/1.1"
404 1197
70.59.54.69 - - [28/Nov/2006:13:50:41 -0700] "GET /cgi-bin/test.pl HTTP/1.1"
404 1197
70.59.54.69 - - [28/Nov/2006:13:51:44 -0700] "GET /cgi-bin/test.pl HTTP/1.1"
404 1197
<VirtualHost 70.59.54.69:80>
ServerAdmin dhunt@celticomm.com
DocumentRoot c:/users/colwest/htdocs
ServerName colwest.com
ServerAlias www.colwest.com
AddHandler cgi-script .cgi .pl
ScriptAlias /cgi-bin/ c:/colwest/cgi-bin/
ErrorLog c:/users/colwest/logs/error.txt
CustomLog c:/users/colwest/logs/access.txt common
</VirtualHost>
I had to go with the full pathway to get the access and error logs to read.
This is Win2000 system and sometimes you have to do that.
| |
|
|
"Daryl Hunt" <dhunt@celticommnospam.com> schreef in bericht
news:456ca293$1@news.i70west.com...
> "HansH" <hans@niet.op.het.net> wrote in message
> news:456c9b40$0$324$e4fe514c@news.xs4all.nl...
> error.txt
> -------
> e Nov 28 13:46:43 2006] [error] [client 70.59.54.69] script not found or
> unable to stat: C:/colwest
IOW the folder c:/colwest DOES NOT EXIST
Most likely c:/users/colwest is a better chioce
> access.txt
> --------
> 70.59.54.69 - - [28/Nov/2006:13:46:43 -0700] "GET /cgi-bin/test.pl
> HTTP/1.1" 404 1193
>
> <VirtualHost 70.59.54.69:80>
> ServerAdmin dhunt@celticomm.com
> DocumentRoot c:/users/colwest/htdocs
> ServerName colwest.com
> ServerAlias www.colwest.com
> AddHandler cgi-script .cgi .pl
> ScriptAlias /cgi-bin/ c:/colwest/cgi-bin/
> ErrorLog c:/users/colwest/logs/error.txt
> CustomLog c:/users/colwest/logs/access.txt common
> </VirtualHost>
Why is
ScriptAlias /cgi-bin/ c:/colwest/cgi-bin/
_still_missing_ the folder 'users', used in all other pathes
Try
ScriptAlias /cgi-bin/ c:/users/colwest/cgi-bin/
HansH
| |
| Daryl Hunt 2006-11-28, 7:28 pm |
|
"HansH" <hans@niet.op.het.net> wrote in message
news:456ca527$0$332$e4fe514c@news.xs4all.nl...
>
> "Daryl Hunt" <dhunt@celticommnospam.com> schreef in bericht
> news:456ca293$1@news.i70west.com...
> IOW the folder c:/colwest DOES NOT EXIST
> Most likely c:/users/colwest is a better chioce
>
>
> Why is
> ScriptAlias /cgi-bin/ c:/colwest/cgi-bin/
> _still_missing_ the folder 'users', used in all other pathes
Because I need to take lessons from a Rock in Spellink to improve.
> Try
> ScriptAlias /cgi-bin/ c:/users/colwest/cgi-bin/
It worked like a charm. Stupid, Stupid (hitting my forehead with the
flat of my hand, contemplating using a hammer)
Thanks for the assistance. And I do appreciate it.
| |
|
| "Daryl Hunt" <dhunt@celticommnospam.com> schreef in bericht
news:456ca632$1@news.i70west.com...
> Because I need to take lessons from a Rock in Spellink to improve.
>
> It worked like a charm. Stupid, Stupid (hitting my forehead with
> the flat of my hand, contemplating using a hammer)
>
Method depreciated, broke my arm kind of that way very recently.
Need to join karate class to learn to shout _before_ impact ;-)
HansH
| |
| Daryl Hunt 2006-11-28, 7:28 pm |
|
"HansH" <hans@niet.op.het.net> wrote in message
news:456cad2d$0$338$e4fe514c@news.xs4all.nl...
> "Daryl Hunt" <dhunt@celticommnospam.com> schreef in bericht
> news:456ca632$1@news.i70west.com...
> Method depreciated, broke my arm kind of that way very recently.
> Need to join karate class to learn to shout _before_ impact ;-)
I did the skuuuling like that and liked to killed myself on one of my
misadventures.
Now for the second half. Making SSL work on virtuals. I will open another
string to discuss that.
And, again, thanks.
Daryl
| |
|
| "Daryl Hunt" <dhunt@celticommnospam.com> schreef in bericht
news:456cb354$1@news.i70west.com...
> Now for the second half. Making SSL work on virtuals. I will open
> another string to discuss that.
Just to get you started: change current
NameVirtualHost *
<VirtualHost *>
to
NameVirtualHost *:80
<VirtualHost *:80>
and add -do note the comments marked #-
# path and name of mod_ssl.so may vary!!
# most likely you only need to uncomment a line like
LoadModule ssl_module modules/mod_ssl.so
# conditional block of directives might be in your config already
<IfModule mod_ssl.c>
# may vary per version, distribution and platform
LoadFile bin/libssl32.dll
LoadFile bin/libeay32.dll
LoadFile bin/ssleay32.dll
# some ditribution come with a seperate config for ssl
# check yours and the speling of its path
Include conf/mods/ssl.conf
</IfModule>
# the lines below may be part of conf/mods/ssl.conf
Listen 443
# no need to define the embedded default
# <NameVirtualHost _default_:443>
<VirtualHost _default_:443>
# common set of directives
# reading start at http://httpd.apache.org/docs/2.0/ssl/ssl_howto.html
# SSL directives
</Virtualhost>
You cannot have multiple vhost on a single IP running HTTPS.
The setup above will respond to requests to any host resolving to its IP
HansH
|
|
|
|