Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jan 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Apache is appending document root before /cgi-bin/test.pl

    Hi,

    I am new to CGI Perl. I have my html page "Test.html" under <my_apache_path>/htdocs/Test.html that has

    <form action="/cgi-bin/MyTest.pl" method="POST">

    and my "MyTest.pl" is located under "<my_apache_path>/cgi-bin/MyTest.pl", so directory structure looks like this:

    <my_apache_path>/htdocs/Test.html
    <my_apache_path>/cgi-bin/MyTest.pl

    Now, the problem is when I submit this form (Test.html), the server is appending cgi-bin path as

    <my_apache_path>/htdocs/cgi-bin/MyTest.pl
    instead of

    <my_apache_path>/cgi-bin/MyTest.pl
    and I am getting "Page not found". I know there must be some apache configuration that can fix this but I am unaware of that. Any help in this regard will be appreciated.

    Thanks,
    Sumit

  • #2
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by sumitg_in View Post
    Hi,

    I am new to CGI Perl. I have my html page "Test.html" under <my_apache_path>/htdocs/Test.html that has

    <form action="/cgi-bin/MyTest.pl" method="POST">

    and my "MyTest.pl" is located under "<my_apache_path>/cgi-bin/MyTest.pl", so directory structure looks like this:

    <my_apache_path>/htdocs/Test.html
    <my_apache_path>/cgi-bin/MyTest.pl

    Now, the problem is when I submit this form (Test.html), the server is appending cgi-bin path as

    <my_apache_path>/htdocs/cgi-bin/MyTest.pl
    instead of

    <my_apache_path>/cgi-bin/MyTest.pl
    and I am getting "Page not found". I know there must be some apache configuration that can fix this but I am unaware of that. Any help in this regard will be appreciated.

    Thanks,
    Sumit
    the problem is in the server configuration, doesn't have anything to do with perl.

    Probably ScriptAlias or something else is wrong.

    best regards

  • #3
    New to the CF scene
    Join Date
    Jan 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks oesxyl for the reply. Yes, it was just a minor configuration change in httpd.conf to have a

    ScriptAlias /cgi-bin/ "<my_apache_path>/cgi-bin/"
    and it is working fine now.

    Thanks and regards,
    Sumit

  • #4
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by sumitg_in View Post
    Thanks oesxyl for the reply. Yes, it was just a minor configuration change in httpd.conf to have a

    ScriptAlias /cgi-bin/ "<my_apache_path>/cgi-bin/"
    and it is working fine now.

    Thanks and regards,
    Sumit
    you are welcome, usualy you can find usefull information in the server logs files when something wrong is happend.

    best regards


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •