Solved

Limiting 3rd party software per virtual host?

Posted on 2002-03-14
3
195 Views
Last Modified: 2013-12-16
I have a webserver running Apache 1.3.23, with ActivePerl, a PHP module, ColdFusion, and ASP support. How do I disable specific virtual hosts from using these third party pieces of software?  For instance, I want one host to be able to use all of those types of files.  I want another to only be able to interpret PHP files, and another only ASP and ColdFusion.  Is Apache responsible for this delegation?
0
Comment
Question by:scotsmen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
samri earned 100 total points
ID: 6867432
Perhaps you could try use Location directive in that particular VirtualHost container.

For example, if you want to deny php, pl, or asp, this might work.

    <Location /(*.php?|*.pl|*.asp?)>
        Deny from all
    </Location>

Next options is to use <Files> directive   within the VirtualHost.  An of course, you need to change the regex to match your filename/types.

--------excerpt from httpd.conf (Apache 1.3.22 Win32).
# The following lines prevent .htaccess files from being viewed by
# Web clients.  Since .htaccess files often contain authorization
# information, access is disallowed for security reasons.  Comment
# these lines out if you want Web visitors to see the contents of
# .htaccess files.  If you change the AccessFileName directive above,
# be sure to make the corresponding changes here.
#
# Also, folks tend to use names such as .htpasswd for password
# files, so this will protect those as well.
#
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>
------------------

Another option is to use mod_rewrite.  You can do the same thing in the VirtualHost container, and rewrite such request to other links.

http://httpd.apache.org/docs/mod/mod_rewrite.html

Some examples are shown here, but not exactly as what you described.  Some minor adjustment to the code could achive the same purpose.  Pay extra attention at "Content Handling" section.

http://httpd.apache.org/docs/misc/rewriteguide.html


hope this helps

0
 

Author Comment

by:scotsmen
ID: 6869352
Good point.  I was worried about using handlers per specific vhost which I'm not sure is supported.  This solution is much easier (sigh -- and more obvious.)  Thanks!
0
 
LVL 15

Expert Comment

by:samri
ID: 6870424
Almost all apache directives can be used inside a VirtualHost container.

0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
RewrteRule using htacess 10 81
Increase size of permitted URI 4 59
Why Xampp showing MySQL as Maria DB on Welcome Page ? 8 105
Create link to folder for use with apache. 7 75
Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question