LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Is it possible to serve .htm files from cgi-bin directory? (https://www.linuxquestions.org/questions/linux-server-73/is-it-possible-to-serve-htm-files-from-cgi-bin-directory-685990/)

zoonalex 11-25-2008 10:09 AM

Is it possible to serve .htm files from cgi-bin directory?
 
Hi all!

I'm trying to serve .htm file and cgi files from cgi-bin directory, is it possible? I'm using Apache/1.3.26 (Unix)

Actually I can serve cgi files but not .htm files, this is what I changed from httpd.conf:


<IfModule mod_alias.c>
Alias /icons/ "/usr/local/apache/icons/"

<Directory "/usr/local/apache/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Alias /manual/ "/usr/local/apache/htdocs/manual/"

<Directory "/usr/local/apache/htdocs/manual">
Options Indexes FollowSymlinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

# ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"

#
# <Directory "/usr/local/apache/cgi-bin/">
# AllowOverride None
# Options None
# Order allow,deny
# Allow from all
# </Directory>


ScriptAlias /cgi-bin/cons/ "/usr/local/apache/htdocs/cgi-bin/cons/"

<Directory "/usr/local/apache/htdocs/cgi-bin/cons/">
AllowOverride None
Options +ExecCGI
Order allow,deny
Allow from all
AddHandler server-parsed .html .htm
</Directory>
</IfModule>


As you have noticed I changed cgi-bin to htdocs and under cgi-bin I created cons. Cons have htm files but also cgi files both types have .htm extension so I think it's confusing to apache to know what files it will serve. Is it possible to serve both files with the same extension?

Thanks a lot for your help!

tospo 12-02-2008 03:53 PM

I don't think that's possible because the ScriptAlias directive tells Apache that everything in that directory is a script.
Why do you want to serve static files from cgi-bin?


All times are GMT -5. The time now is 12:02 PM.