Does anyone know enough about this to help me?
DocRoot /path/to/your/website Place your HTML file inside that DocRoot directory. For CGI you probably have a ScriptAlias setting:
ScriptAlias /cgi-bin/ /path/to/your/cgi-bin/ place your cgi file in the /path/to/your/cgi-bin/. Make sure that the file is marked executable.
your URL to the HTML file would be:
[somedomain.com...] (or [127.0.0.1...] if you are running it locally and have not played with your hosts file).
For the cgi:
[somedomain.com...]
Scott Geiger
Scott Geiger
the HTML file (default.htm) is in C:/Apache, and the cgi file (homeFlites.cgi) is in C:/Apache/cgi-bin.
Of course you've probably done this, and/or this is absolutely the worst thing to do, but, hey, it worked for me!
First, set up your local directories to mirror just how your site is setup. If you website is store on your host in:
/home/foo/mysite
Then go to your C: drive and create that path and place all your website files in that directory just as they are stored on your hosts drive.
That will become your DocRoot as other described above.
That also means once you are into running cgi's you won't have to muck with changing any paths in those cgi's in order to upload them.
Lisa, to make sure perl is installed correctly and your webserver is configured correctly to associate perl cgi scripts with the perl executable, I'd suggest the following:
Copy and paste the following lines into a file (call it say test.pl)
#!/usr/bin/perl
print "Content-Type: text/HTML\n\n";
print "Hello, World<p>\n";
(don't worry that the path to perl on your windows machine is not /usr/bin/perl ...)
Store the file in your cgi-bin directory (e.g. C:/Apache/cgi-bin/ or whatever it lands up being after you have followed Brett's excellent suggestion)
Now run that file from a dos prompt as follows:
perl C:/Apache/cgi-bin/test.pl
You should get:
Content-Type: text/HTMLHello, World<p>
OK, good, so now you know perl is set up and working correctly. Now point your browser to [localhost...] Your browser should show:
Hello, World
Now you know that perl is set up correctly and your web server is set up correctly to serve perl cgi.
So any other problems are probably in your html files calling the cgi, not in your configuration. In particular, I think TheWhippinpost hit the nail on the head. C:/Apache/cgi-bin/homeFlites.cgi is just a file that your browser will fetch from your C: drive and display, and your web server won't get involved at all. However, [localhost...] will cause your webserver to send the script to perl for processing, and send your browser the result.
how do you make the cgi file executable when you're not using unix?...I'm using windows
Shawn
"Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, @@ServerAdmin@@ and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
--------------------------------------------------------------------------------
Apache/1.3.26 Server at localhost Port 80"
__________________________________________________________
But running the perl script using perl worked fine.
Look in Apache's error logs for clues.
Just guessing here, but perhaps your Apache doesn't know the path to perl. Make sure that you have the path to perl defined correctly, and that your windows file associations are correct. i.e:
-> Control Panel
-> Folder Options
-> File Types tab
-> Scroll down to PL
-> click 'advanced'
-> click 'open, then click Edit
-> you should something like ""C:\Perl\bin\perl.exe" "%1" %*
You should be able to configure it to correctly run perl even though the path to perl is not correctly specified in the!# line. The advantage of this is that your scripts are portable to linux servers. However, just to check if this is the problem, try changing the first line in the file to:
#!C:\PERL\5.00464\bin\MSWin32-x86\perl.exe
(or whatever the path to perl is)
Sorry I can't give anythign definitive.
Shawn
I'm working on getting Apache running also. I put the important(I think) directives below. I have tried port 80 as well. When installing, I read that Apache would not share a port if it was already in use by another service. That's the port my cable modem is using, I believe. I also changed DocRoot, as Brett said, to mirror my real host's server.
Anyhow, I would greatly appreciate any advice.
ServerRoot "C:/Program Files/Apache Group/Apache2"
Listen 8080
ServerName username.******01.md.comcast.net:8080
UseCanonicalName Off
DocumentRoot "C:/home/user/public_html"
<Directory "C:/home/user/public_html">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ "C:/home/user/public_html/cgi-bin/"
<Directory "C:/home/user/public_html/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
Typing "path" in DOS prompt give me this path:
C:\PERL\BIN\
I've tried every combination of uppercase-lowercase, forward-backward slashes and no ending slash.
Also, I can't find "Folder Options" in the control panel.
Sorry for hijacking your thread, Lisa :)
When I type path from the dos prompt, I get this information:
"PATH=c:\PROGRA~1\Borland\CBUILD~1\Bin;
C:\PROGRA~1\Borland\CBUILD~1\Projects\Bpl;
C:\WINDOWS\system32;
C:\WINDOWS;
C:\WINDOWS\System32\Wbem;
C:\Nortel\CALLPI~1\bin;
C:\Nortel\CALLPI~1\boin\win32"
[edited by: jatar_k at 8:07 pm (utc) on June 12, 2003]
[edit reason] split line on semicolon to stop sidescroll [/edit]
LISAD: It looks like something is amiss with the installation. You should see something similar to Birdman's path above.
My path reads "C:\Perl\bin;C:\Perl\site\lib;C:\Perl\lib;" You could try and open up the AutoExec.bat file in a text editor and add the entry if you want (without quotes, check the paths on your system and adjust) but I'd re-install if I were you.
I've been searching for a way to change permissions on win 98, but can't find anything. Do I need to add some sort of utility, like a cpanel to do this?
Thanks again!
If you click on START/PROGRAMS/ACCESSORIES/SYSTEM TOOLS/SYSTEM INFORMATION
In the left pane of the window that opens, click on SOFTWARE ENVIRONMENT/RUNNING TASKS
In the list on the right, you should see Apache.exe
If you want to sticky me I'll try and help further. You shouldn't need to set up permissions on Win 98 installation.