I am new to xampp and am trying to set up a website for testing on a local xampp server. Up till now the site has been designed locally and uploaded to my webhost for testing.

But now I want to start adding some dynamic content and do testing locally. I have set up xampp on a Windows xp platform. I have configured my site to work via an alias in http.conf (the site is not in the /htdocs directory), and everything works except for my formmail.

When submitting the formmail Windows wants to download the .cgi script intstead of the server executing it. I assume this is because my script is in a /cgi-bin/ in my site directory and not in the proper xampp directory , correct? Having the script in my own /cgi-bin is how it works on my webhost server.

How can I set up the formmail and cgi script to work on the local server and still work when I upload to the remote server?

Also , the shebang line in the script is set up for linux (usr/bin/perl, on the remote) , how can I make it work in Windows without having to change the shebang line each time I upload to my webhost?

I can't seem to get it to work. Here is the alias section from my httpd.conf:
My installation of xampp did not have the apache/conf/extra folder with the httpd-xampp.conf file so I made changes to httpd.conf.

## Aliases: Add here as many aliases as you need (with no limit). The format is# Alias fakename realname## Note that if you include a trailing / on fakename then the server will# require it to be present in the URL. So "/icons" isn't aliased in this# example, only "/icons/". If the fakename is slash-terminated, then the# realname must also be slash terminated, and if the fakename omits the# trailing slash, the realname must also omit it.## We include the /icons/ alias for FancyIndexed directory listings. If you# do not use FancyIndexing, you may comment this out.#Alias /icons/ "E:/server/xampp/apache/icons/"

## This should be changed to the ServerRoot/manual/. The alias provides# the manual, even if you choose to move your DocumentRoot. You may comment# this out if you do not care for the documentation.### ScriptAlias: This controls which directories contain server scripts.# ScriptAliases are essentially the same as Aliases, except that# documents in the realname directory are treated as applications and# run by the server when requested rather than as documents sent to the client.# The same rules about trailing "/" apply to ScriptAlias directives as to# Alias.##ScriptAlias /cgi-bin/ "E:/server/xampp/cgi-bin/"ScriptAlias /cgi-bin/ "E:/sites/mysite/cgi-bin/"

## "E:/server/xampp/apache/cgi-bin" should be changed to whatever your SriptAliased# CGI directory exists, if you have that configured.#<Directory "E:/sites/mysite/cgi-bin/"># AllowOverride None Options Indexes ExecCGI Order allow,deny Allow from all</Directory>

#

The alias seems to be working , but not the scriptalias. My .cgi file still wants to download each time it is called.

Is there something I left out? AddHandler? Does the presence of ExecCGI in other places interfere with the script alias?

<IfModule alias_module> # # Redirect: Allows you to tell clients about documents that used to # exist in your server's namespace, but do not anymore. The client # will make a new request for the document at its new location. # Example: # Redirect permanent /foo http://www.example.com/bar

# # Alias: Maps web paths into filesystem paths and is used to # access content that does not live under the DocumentRoot. # Example: # Alias /webpath /full/filesystem/path # # If you include a trailing / on /webpath then the server will # require it to be present in the URL. You will also likely # need to provide a <Directory> section to allow access to # the filesystem path.

Alias /JoeAustinPhotography “E:/Sites/JoeAustinPhotography”

<Directory "E:/Sites/JoeAustinPhotography"> Options Indexes Order allow,deny Allow from all </Directory> # # ScriptAlias: This controls which directories contain server scripts. # ScriptAliases are essentially the same as Aliases, except that # documents in the target directory are treated as applications and # run by the server when requested rather than as documents sent to the # client. The same rules about trailing "/" apply to ScriptAlias # directives as to Alias. # ScriptAlias /cgi-bin/ "E:/Sites/JoeAustinPhotography/cgi-bin/"

</IfModule>

## "E:/xampp/cgi-bin" should be changed to whatever your ScriptAliased# CGI directory exists, if you have that configured.#<Directory "E:/Sites/JoeAustinPhotography/cgi-bin/"> Options Indexes ExecCGI Order allow,deny Allow from all</Directory>

Unless I missed something I believe this covers all the bases , but the alias no longer works. In the old version the alias worked , the script alias didn't.

>I then rebooted, cleared the browser cache, and restarted apache.
no reboot or restart needed after changes in the hosts file

having
127.0.0.1 localhost JoeAustinPhotography
in the hosts file means that
'http://JoeAustinPhotography' ,
'http://localhost' and
'http://127.0.0.1'
all point to the document root (xampp/htdocs/)

I didn't read the whole thread - but having
Alias /JoeAustinPhotography "E:/Sites/JoeAustinPhotography"
means that you have to point your browser at
'http://localhost/JoeAustinPhotography/'
to acces the html/php files in E:/Sites/JoeAustinPhotography

note: even on windows an "alias" is case sensitive:
'http://localhost/joeaustinphotography/' won't work!

Last edited by sari42 on 20. March 2008 10:45, edited 2 times in total.

127.0.0.1 JoeAustinPhotographyjust under the 127.0.0.1 localhost line in the host file.---8<---Using 'http://localhost/JoeAustinPhotography' ...I get the exact same error log message that I reported above

Milligan wrote:

Sari42 wrote:I didn't read the whole thread

Don't you think that is required then?

No, I just wanted to point Joe to the fact that both JoeAustinPhotography and localhost now means "almost the same" as 127.0.0.1