[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: More Questions - the answers are so good!
Nathan R Heagy schrieb:
>
> I continue to use pi3web - which is working flawlessly. I am using localhost
> to test CGI/SSI based applications locally. I am amping different projects
> to localhost/project_name/ the disadvantage is that /file_name links go to
> localhost/file_name instead of localhost/project_name/file_name like they
> would when the pproject is finished and placed on project_name.com. What
> funtions do this? I have been playing with the virtual settings, but am
> getting nothing that seems to work. It all needs to run without launching my
> internet dialup, maybe project.localhost? is that possible?
>
^^^^
Hi again, let's do it by an example.
You have a project named 'guestbook', all files stored in path
'c:\projects\guestbook'.
I suggest to configure a new virtual host 'projects' and to create some
mappings for the directories.
1.) Open server's administration window, page "Non IP virtual hosts"
2.) Add a virtual host:
- Internet hostname: projects
- Document root mapping: c:\projects\
3.) Add 2 or more mappings for guestbook project
- type: CGI
- virtual: /guestbook/cgi-bin/
- physical: c:\projects\guestbook\cgi-bin\
- type: Documents
- virtual: /guestbook/
- physical: c:\projects\guestbook\public_html\
4.) save new server configuration
5.) open c:\windows\hosts with notepad and add the new hostname:
127.0.0.1 projects
6.) restart Windows
Try out:
http://projects/
- You'll see a HTML table of your whole project directory
http://projects/guestbook/guestbook.htm
- You'll see your guestbook main page
http://projects/guestbook/cgi-bin/guestbook.pl
- to run guestbook script guestbook.pl
Discussion:
Since the document root mapping is real for the virtual host but the
CGI and document Path mapping for the guestbook project and also all other
mappings are general for all host objects.
I'm not sure if your programs/documents could find all additional resourses
(Images etc.) with relative URL-paths if they are located in project
directories instead of server directories. Try it out.
A 2nd way is to create a virtual host for each project but don't
know if it'll wiorking better.
> Once again, thanks for all suggestions and replies.
> Nathan R Heagy
> -- -- --
> Sites Built Better
> http://heagy.com
Some enhancements to my last suggestion how to show /cg-bin/ as HTML table:
# ---
#
# HTTPLogicObject
#
# HTTP Logic object, dispatches requests to all other handlers
#
# ---
<Object>
Name HTTPLogicObject
Class HTTPDispatcherClass
.
.
.
ErrorLogFile "Logs/error.txt"
Handlers Start CGIDir Scripts WinScripts FastCGIScripts ISAPI Default
.
.
.
</Object>
# ---
#
# CGIDir
#
# Special handler to show contents of /cgi-bin/ as directory
#
# ---
<Object>
Name CGIDir
Class FlexibleHandlerClass
CheckType CheckForDirectory SetType="internal/x-directory"
CheckType ReturnCode ReturnCode="COMPLETED"
Condition "&and(&cmp($c,internal/x-directory),\
&cmp(&dblookup(response,string,ObjectMap),Scripts))"
Handle TableHTML
</Object>
--
with regards
Holger
---------------------------------------------------------
Holger 'Zimpel' Zimmermann Contact me:
---------------------------------------------------------
Wendishain tel./fax company: on demand
Germany tel./fax private: on demand
---------------------------------------------------------
homepage: http://home.t-online.de/home/zimpel@t-online.de
web server: surf to it from my homepage (online every
Sunday 20:00-24:00 GMT, start 1. Jule 1998)
e-Mail: zimpel@t-online.de
--------------------------------------------------------