Author |
|
MiltSpain1
Joined: 04 Sep 2016 Posts: 38 Location: USA
|
Posted: Mon 26 Sep '16 18:27 Post subject: VHost Works With Apache 1.3 But Not With Apache 2.2 --Why? |
|
|
I have this Vhost configuration on Apache 2.2 loaded on Windows Server 2012.
<VirtualHost *:80>
DocumentRoot E:/pinnacle/minorityrecruiter/htdocs
ServerAdmin adm@diversitylink.com
ServerName minorityrecruiter.com
ServerAlias *.minorityrecruiter.com
ScriptAlias /cgi-bin/ "E:/pinnacle/minorityrecruiter/cgi-bin/"
<Directory "E:/pinnacle/minorityrecruiter/htdocs/">
Options Indexes FollowSymLinks MultiViews Includes
AllowOverride all
Order allow,deny
Allow from all
</Directory>
<Directory "E:/pinnacle/minorityrecruiter/cgi-bin/">
Options Indexes FollowSymLinks Multiviews Includes
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
The website name entered into a browser will yield a page which contains a link to a cgi program. When that link is clicked an error message shows stating the file cannot be found on this server. The path to the cgi program is E:/pinnacle/minorityrecruiter/cgi-bin/testcgi.pl.
I have the same Vhost config ,minus the second <Directory>, on a different machine (Microsoft Server 2003) with Apache 1.3 and the cgi program functions when called.
I have two questions:
1)Any idea as to why the config works on Apache 1.3 and not on Apache 2.2?
2)Can Apache 1.3 work with MS Server 2012? Any specific changes that have to be made?
I would much prefer to move on with Apache 2.2 but I can't get the configurations to work and I have to get on with life.
Any assistance will be greatly appreciated.
Thanks,
Milt |
|
Back to top |
|
admin Site Admin
Joined: 15 Oct 2005 Posts: 692
|
|
Back to top |
|
MiltSpain1
Joined: 04 Sep 2016 Posts: 38 Location: USA
|
Posted: Mon 26 Sep '16 23:24 Post subject: View newest post VHost Works With Apache 1.3 But Not With Ap |
|
|
I don't see quite the same issue. I got by the 'You Don't Have Permission' error. Now the system can't find the requested cgi file. My question is why not? The config and directory/file paths are the same as used with Apache 1.3 and everything works there.
I'd appreciate a suggested reason or place to look. I'm at a total loss. |
|
Back to top |
|
DnvrSysEngr
Joined: 15 Apr 2012 Posts: 226 Location: Denver, CO USA
|
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Tue 27 Sep '16 2:17 Post subject: |
|
|
First and foremost, this is NOT Apache 1.3 and stop assuming it should be the same, they're not. Not even in the same major version number, a complete rewrite.
The answer is simply because you have not activated cgi. I saw it earlier and was going to mention it but didn't want to hammer you with too much at one time.
Look 3/4 of the way down down and find the lines:
Code: | # To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
#AddHandler cgi-script .cgi |
Uncomment the AddHandler line and add anything else you may need.
For example only:
AddHandler cgi-script .cgi .exe .pl .vbs |
|
Back to top |
|
MiltSpain1
Joined: 04 Sep 2016 Posts: 38 Location: USA
|
Posted: Tue 27 Sep '16 19:06 Post subject: VHost Works With Apache 1.3 But Not With Apache 2.2 -- Why? |
|
|
I had actually done what GLSmith suggested and I still get an error when the cgi file is called, i.e. 'The System Cannot Find The Specified File'.
Here's what I have:
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
AddHandler cgi-script .cgi .pl
I have a question here. Which "Options" directive? In the HTTPD config or the Vhost or both?
The Vhost config is pictured in my previous posts. It is clear that the website docs are to be within the DocumentRoot while the cgi programs are to reside within the cgi-bin outside the DocumentRoot.
What else, within the Apache configuration, can be blocking the system from finding the cgi files. I can understand that they might not be executed if there is a problem with PERL but the error shouldn't be that the file can't be found. Clearly the file is present because it is found on my old server with the same VHost configuration and I can read the file via RDC and FTP on the new server. I have to believe the problem is within the Apache configuration or could it be with Windows? |
|
Back to top |
|
MiltSpain1
Joined: 04 Sep 2016 Posts: 38 Location: USA
|
Posted: Tue 27 Sep '16 19:35 Post subject: VHost Works With Apache 1.3 But Not With Apache 2.2 -- Why? |
|
|
The problem is not with access to the cgi-bin. Somehow it's with the file extension. I put the index.htm file inside the cgi-bin and addresses it with a browser and it popped up as expected. It is obvious, then, that the address to the cgi-bin is correct.
Next I changed the file extension on testcgi from .pl to .cgi and called it. Error - The requested URL /cgi-bin/testcgi not found on this server. It seems that neither the .pl or .cgi extensions are being recognized by Apache or is it Windows that is at fault? |
|
Back to top |
|
MiltSpain1
Joined: 04 Sep 2016 Posts: 38 Location: USA
|
Posted: Wed 28 Sep '16 0:31 Post subject: VHost Works With Apache 1.3 But Not With Apache 2.2 -- Why? |
|
|
Thanks for all the feedback from everyone. I think I have solved the problem.
On my previous server with Apache 1.3 and Windows Server 2003 Shebang lines weren't very important, even though they were on a prior Unix system where #! User/bin/Perl led to the default location of Perl. My Perl cgi files retained that Shebang line when they were migrated to Windows Server 2003 along with Apache 1.3. Everything continued to work.
There are tutorials on the Internet stating Windows will determine the location of the Perl.exe file regardless of the Shebang line but that doesn't appear to be the case, at least not with Apache 2.2 and Windows 2012. It doesn't work! Another Internet fix was to use #!Perl. Guess what! That didn't work either. It appears that a real and true path to the location of the Perl.exe file is required in the Shebang line. In my case the Perl.exe file is located on the C drive within the Perl/bin. Hence the Shebang line that allows my Perl cgi programs to be found and executed is #!C:/Perl/bin/Perl.
Again, I think the problem has been resolved and I want to thank everyone who has provided assistance.
Milt Spain |
|
Back to top |
|