Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

Apache Test Page?

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  Tomcat, JK2, JDK1.4 setup  
Author Message
adam5

External


Since: Aug 26, 2003
Posts: 4



(Msg. 1) Posted: Tue Aug 26, 2003 7:44 pm
Post subject: Apache Test Page?
Archived from groups: alt>apache>configuration (more info?)

Hi,

I'm running Apache Webserver(2.0.40) and am having some problems with
my config. I am running this server to serve a cgi script. I want
this cgi script to be the default page that comes up when you access
www.mydomain.com or http://subomain.mydomain.com.

I figured the best solution then would be to put a dummy index.html in
var/www/html with an .htaccess file that redirects to the appropriate
location in the cgi-bin.

So, with a dummy index.html file in hand, and the .htaccess file
reading:

Redirect /index.html
http://subdomain.mydomain.com/cgi-bin/myscript.cgi

I figured I'd be just fine. WRONG.

The problem is, Apache doesn't read the default page as being anything
I put in the var/www/html folder. Even though I've made sure that the
httpd.conf file says that var/www/html is the Document Root.

I tested to see if www.mydomain.com/index.html would work with the
dummy html file that I made. And lo and behold it did. So,
var/www/html IS indeed my Document Root. Its also serving the script
fine if I hit the www.mydomain.com/cgi-bin/subfolder/myscript.cgi.
I just can't seem to get rid of the Apache Test Page.

I'm puzzled, anyone have any thoughts?

 >> Stay informed about: Apache Test Page? 
Back to top
Login to vote
no_mail

External


Since: Jul 15, 2003
Posts: 26



(Msg. 2) Posted: Wed Aug 27, 2003 8:30 am
Post subject: Re: Apache Test Page? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Adam wrote...
 > Hi,
 >
 > I'm running Apache Webserver(2.0.40) and am having some problems with
 > my config. I am running this server to serve a cgi script. I want
 > this cgi script to be the default page that comes up when you access
<font color=purple> > <a style='text-decoration: underline;' href="http://www.mydomain.com" target="_blank">www.mydomain.com</a> or <a style='text-decoration: underline;' href="http://subomain.mydomain.com.</font" target="_blank">http://subomain.mydomain.com.</font</a>>
 >
 > I figured the best solution then would be to put a dummy index.html in
 > var/www/html with an .htaccess file that redirects to the appropriate
 > location in the cgi-bin.
 >
 > So, with a dummy index.html file in hand, and the .htaccess file
 > reading:
 >
 > Redirect /index.html
<font color=purple> > <a style='text-decoration: underline;' href="http://subdomain.mydomain.com/cgi-bin/myscript.cgi</font" target="_blank">http://subdomain.mydomain.com/cgi-bin/myscript.cgi</font</a>>
 >
 > I figured I'd be just fine. WRONG.
 >
 > The problem is, Apache doesn't read the default page as being anything
 > I put in the var/www/html folder. Even though I've made sure that the
 > httpd.conf file says that var/www/html is the Document Root.
 >
 > I tested to see if <a style='text-decoration: underline;' href="http://www.mydomain.com/index.html" target="_blank">www.mydomain.com/index.html</a> would work with the
 > dummy html file that I made. And lo and behold it did. So,
 > var/www/html IS indeed my Document Root. Its also serving the script
<font color=purple> > fine if I hit the <a style='text-decoration: underline;' href="http://www.mydomain.com/cgi-bin/subfolder/myscript.cgi.</font" target="_blank">www.mydomain.com/cgi-bin/subfolder/myscript.cgi.</font</a>>
 > I just can't seem to get rid of the Apache Test Page.
 >
 > I'm puzzled, anyone have any thoughts?
 >
See the DirectoryIndex directive, it does what you need:

<a style='text-decoration: underline;' href="http://httpd.apache.org/docs-2.0/mod/mod_dir.html#directoryindex" target="_blank">http://httpd.apache.org/docs-2.0/mod/mod_dir.html#directoryindex</a><!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Apache Test Page? 
Back to top
Login to vote
user2431

External


Since: Aug 21, 2003
Posts: 23



(Msg. 3) Posted: Wed Aug 27, 2003 11:36 am
Post subject: Re: Apache Test Page? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Adam" <adam RemoveThis @cygnus-sys.com> escribió en el mensaje
news:b85571f.0308261544.4fadf21a@posting.google.com...
 > Redirect /index.html
<font color=purple> > <a style='text-decoration: underline;' href="http://subdomain.mydomain.com/cgi-bin/myscript.cgi</font" target="_blank">http://subdomain.mydomain.com/cgi-bin/myscript.cgi</font</a>>

Try this:

Redirect / <a style='text-decoration: underline;' href="http://subdomain.mydomain.com/cgi-bin/myscript.cgi" target="_blank">http://subdomain.mydomain.com/cgi-bin/myscript.cgi</a>

In any case, I'm sure you don't need any dummy file.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Apache Test Page? 
Back to top
Login to vote
adam5

External


Since: Aug 26, 2003
Posts: 4



(Msg. 4) Posted: Wed Aug 27, 2003 11:36 am
Post subject: Re: Apache Test Page? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Alvaro G. Vicario" <alvaro.QUITAR_REMOVE.RemoveThis@telecomputeronline.com> wrote in message news:<bihjhe$9eabo$1@ID-157797.news.uni-berlin.de>...
 > "Adam" <adam.RemoveThis@cygnus-sys.com> escribió en el mensaje
 > news:b85571f.0308261544.4fadf21a@posting.google.com...
  > > Redirect /index.html
<font color=green>  > > <a style='text-decoration: underline;' href="http://subdomain.mydomain.com/cgi-bin/myscript.cgi</font" target="_blank">http://subdomain.mydomain.com/cgi-bin/myscript.cgi</font</a>>
 >
 > Try this:
 >
<font color=purple> > Redirect / <a style='text-decoration: underline;' href="http://subdomain.mydomain.com/cgi-bin/myscript.cgi</font" target="_blank">http://subdomain.mydomain.com/cgi-bin/myscript.cgi</font</a>>
 >
 > In any case, I'm sure you don't need any dummy file.

I'll give that a shot. How would you do it otherwise? I'm open to
suggestion here, I may be overcomplicating the issue. Thanks for your
help!<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Apache Test Page? 
Back to top
Login to vote
adam5

External


Since: Aug 26, 2003
Posts: 4



(Msg. 5) Posted: Wed Aug 27, 2003 11:36 am
Post subject: Re: Apache Test Page? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Alvaro G. Vicario" <alvaro.QUITAR_REMOVE.RemoveThis@telecomputeronline.com> wrote in message news:<bihjhe$9eabo$1@ID-157797.news.uni-berlin.de>...
 > "Adam" <adam.RemoveThis@cygnus-sys.com> escribió en el mensaje
 > news:b85571f.0308261544.4fadf21a@posting.google.com...
  > > Redirect /index.html
<font color=green>  > > <a style='text-decoration: underline;' href="http://subdomain.mydomain.com/cgi-bin/myscript.cgi</font" target="_blank">http://subdomain.mydomain.com/cgi-bin/myscript.cgi</font</a>>
 >
 > Try this:
 >
<font color=purple> > Redirect / <a style='text-decoration: underline;' href="http://subdomain.mydomain.com/cgi-bin/myscript.cgi</font" target="_blank">http://subdomain.mydomain.com/cgi-bin/myscript.cgi</font</a>>
 >
 > In any case, I'm sure you don't need any dummy file.

Well, this solution worked, except... now the files located in
var/www/html/images/subfolder no longer will show up. These worked
previously in conjunction with the CGI script. But now, they won't
show up at all. Clicking to their properties, the path seems to be
correct.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Apache Test Page? 
Back to top
Login to vote
adam5

External


Since: Aug 26, 2003
Posts: 4



(Msg. 6) Posted: Wed Aug 27, 2003 3:11 pm
Post subject: Re: Apache Test Page? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Alvaro G. Vicario" <alvaro.QUITAR_REMOVE DeleteThis @telecomputeronline.com> wrote in message news:<bihjhe$9eabo$1@ID-157797.news.uni-berlin.de>...
 > "Adam" <adam DeleteThis @cygnus-sys.com> escribió en el mensaje
 > news:b85571f.0308261544.4fadf21a@posting.google.com...
  > > Redirect /index.html
<font color=green>  > > <a style='text-decoration: underline;' href="http://subdomain.mydomain.com/cgi-bin/myscript.cgi</font" target="_blank">http://subdomain.mydomain.com/cgi-bin/myscript.cgi</font</a>>
 >
 > Try this:
 >
<font color=purple> > Redirect / <a style='text-decoration: underline;' href="http://subdomain.mydomain.com/cgi-bin/myscript.cgi</font" target="_blank">http://subdomain.mydomain.com/cgi-bin/myscript.cgi</font</a>>
 >
 > In any case, I'm sure you don't need any dummy file.

After some further investigation, I found that when I type in
<a style='text-decoration: underline;' href="http://subdomain.mydomain.com/images/subfolder/mypicture.gif," target="_blank">http://subdomain.mydomain.com/images/subfolder/mypicture.gif,</a> the
htaccess file redirects that to:
<a style='text-decoration: underline;' href="http://subdomain.mydomain.com/cgi-bin/subfolder/myscript.cgiimages/subfolder/mypicture.gif," target="_blank">http://subdomain.mydomain.com/cgi-bin/subfolder/myscript.cgiimages/sub...der/myp</a>
if you can follow that, its basically tacking on the images directory
to the end of the redirect I put into place. Is there any way to stop
this or is there a better way to have my cgi script show up as my home
page? Thanks again!<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Apache Test Page? 
Back to top
Login to vote
no_mail

External


Since: Jul 15, 2003
Posts: 26



(Msg. 7) Posted: Wed Aug 27, 2003 11:41 pm
Post subject: Re: Apache Test Page? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Adam wrote...
 > "Alvaro G. Vicario" <alvaro.QUITAR_REMOVE.TakeThisOut@telecomputeronline.com> wrote in message news:<bihjhe$9eabo$1@ID-157797.news.uni-berlin.de>...
  > > "Adam" <adam.TakeThisOut@cygnus-sys.com> escribió en el mensaje
  > > news:b85571f.0308261544.4fadf21a@posting.google.com...
   > > > Redirect /index.html
<font color=brown>   > > > <a style='text-decoration: underline;' href="http://subdomain.mydomain.com/cgi-bin/myscript.cgi</font" target="_blank">http://subdomain.mydomain.com/cgi-bin/myscript.cgi</font</a>>
  > >
  > > Try this:
  > >
<font color=green>  > > Redirect / <a style='text-decoration: underline;' href="http://subdomain.mydomain.com/cgi-bin/myscript.cgi</font" target="_blank">http://subdomain.mydomain.com/cgi-bin/myscript.cgi</font</a>>
  > >
  > > In any case, I'm sure you don't need any dummy file.
 >
 > After some further investigation, I found that when I type in
 > <a style='text-decoration: underline;' href="http://subdomain.mydomain.com/images/subfolder/mypicture.gif," target="_blank">http://subdomain.mydomain.com/images/subfolder/mypicture.gif,</a> the
 > htaccess file redirects that to:
<font color=purple> > <a style='text-decoration: underline;' href="http://subdomain.mydomain.com/cgi-bin/subfolder/myscript.cgiimages/subfolder/mypicture.gif,</font" target="_blank">http://subdomain.mydomain.com/cgi-bin/subfolder/myscript.cgiimages/sub...der/myp</a>>
 > if you can follow that, its basically tacking on the images directory
 > to the end of the redirect I put into place. Is there any way to stop
 > this or is there a better way to have my cgi script show up as my home
 > page? Thanks again!
 >

There is no need to use rewrites.

Just modify this line in http.conf. Or add it to your virtualhost
section or directory section if you like or use it in htaccess.

DirectoryIndex /cgi-bin/yourscript.cgi index.html index.htm


All it does is tell Apache to serve yourscript.cgi as your index page.
If it cannot find the yourscript.cgi, it will server the next
alternative, index.html. Then index.htm. You can add more here if you
use others.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Apache Test Page? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Code Page Apache - How can i set iso-8859-2 for default code page in apache / linux (httpd.conf) tnx sorry 4 my english :) Arek

Can't download DLL files from Apache-served Web page - Our ISP upgraded our FreeBSD Web server to Apache 1.3.2.7. We have a Web page where users can download some DLL files. When they try to do that now, they receive a "Cannot find server or DNS Error" error. We replaced the DLL files with ZIP fil...

Apache 4.0.46 and Win2k - no page served through localhost - OK, Apache gurus. I've been using Apache 1.3 for a while (with PHP) to develop some web sites on my laptop running Windows 2000 (I put them onto my Linux box for final proofing). No problems to date. Recently I had cause to rebuild the laptop so I..

noindex.html page on my Apache 2.0.40 Redhat 9 Server - Since I didn't got a reply yet on my previous posting I might as well try this in a different format. (and different question style) The issue is that, what ever I change in the config, I continously get the noindex.html page saying that this is RedHat....

new user, for test - i'm a new user, test~!
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]