You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Amit Khemka <kh...@gmail.com> on 2006/11/14 15:46:32 UTC

[users@httpd] Newbie: Adding multiple Location directive to httpd.conf

Hello List,

I am using Apache/2.0.54 on Linux 2.6.11-1.1369_FC4smp.
I have a python based application server with apache, which had added
the following to htttpd.conf file:

<Location />
    SetHandler appserver-handler
</Location>
(I presume, to by default forward all request to the appserver)

I wanted to add some php scripts, so i created directory
"/var/www/html/php' and added fololwing to httpd.conf

<Location /php/>
        SetHandler php5-script
</Location>

It works with few catches, for example:
 - When i access the url: http://localhost/php , it returns the error
"permission denied", though i have added index.php to DirectoryIndex
- http://localhost/php/index.php loaded, but with stylesheets, images
etc, after looking around i found that browser was reporting error for
wrong mime-type (ie. text/html instead of text/css)

I tried the following (just in case the information could be useful):
1. I commented the app-server directives in httpd.conf -- SAME PROBLEMS
2. I commented both app-server and php directives in httpd.conf -- It
works like charm
3. I also tried using .htaccess and Directory and few more random
hacks, though couldnt figure out anything.

Any help would be greatly appreciated.

cheers,
amit.


-- 
----
Amit Khemka -- onyomo.com
Home Page: www.cse.iitd.ernet.in/~csd00377

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Newbie: Adding multiple Location directive to httpd.conf

Posted by Amit Khemka <kh...@gmail.com>.
On 11/15/06, Joshua Slive <jo...@slive.ca> wrote:
> On 11/14/06, Amit Khemka <kh...@gmail.com> wrote:
> > Hello List,
> >
> > I am using Apache/2.0.54 on Linux 2.6.11-1.1369_FC4smp.
> > I have a python based application server with apache, which had added
> > the following to htttpd.conf file:
> >
> > <Location />
> >     SetHandler appserver-handler
> > </Location>
> > (I presume, to by default forward all request to the appserver)
> >
> > I wanted to add some php scripts, so i created directory
> > "/var/www/html/php' and added fololwing to httpd.conf
> >
> > <Location /php/>
> >         SetHandler php5-script
> > </Location>
> >
> > It works with few catches, for example:
> >  - When i access the url: http://localhost/php , it returns the error
> > "permission denied", though i have added index.php to DirectoryIndex
> > - http://localhost/php/index.php loaded, but with stylesheets, images
> > etc, after looking around i found that browser was reporting error for
> > wrong mime-type (ie. text/html instead of text/css)
> >
> > I tried the following (just in case the information could be useful):
> > 1. I commented the app-server directives in httpd.conf -- SAME PROBLEMS
> > 2. I commented both app-server and php directives in httpd.conf -- It
> > works like charm
> > 3. I also tried using .htaccess and Directory and few more random
> > hacks, though couldnt figure out anything.
> >
> > Any help would be greatly appreciated.
>
> The easiest fix would probably be to replace your <Location /> with a
> regex that excludes /php.  Something like <LocationMatch ^/(?!php/)>
> (untested).  Then use a regular AddHandler for that particular
> directory to activate php.
>
> Joshua.
>

Thanks :-), It worked !

-- 
----
Amit Khemka -- onyomo.com
Home Page: www.cse.iitd.ernet.in/~csd00377
Endless the world's turn, endless the sun's Spinning, Endless the quest;
I turn again, back to my own beginning, And here, find rest.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Newbie: Adding multiple Location directive to httpd.conf

Posted by Joshua Slive <jo...@slive.ca>.
On 11/14/06, Amit Khemka <kh...@gmail.com> wrote:
> Hello List,
>
> I am using Apache/2.0.54 on Linux 2.6.11-1.1369_FC4smp.
> I have a python based application server with apache, which had added
> the following to htttpd.conf file:
>
> <Location />
>     SetHandler appserver-handler
> </Location>
> (I presume, to by default forward all request to the appserver)
>
> I wanted to add some php scripts, so i created directory
> "/var/www/html/php' and added fololwing to httpd.conf
>
> <Location /php/>
>         SetHandler php5-script
> </Location>
>
> It works with few catches, for example:
>  - When i access the url: http://localhost/php , it returns the error
> "permission denied", though i have added index.php to DirectoryIndex
> - http://localhost/php/index.php loaded, but with stylesheets, images
> etc, after looking around i found that browser was reporting error for
> wrong mime-type (ie. text/html instead of text/css)
>
> I tried the following (just in case the information could be useful):
> 1. I commented the app-server directives in httpd.conf -- SAME PROBLEMS
> 2. I commented both app-server and php directives in httpd.conf -- It
> works like charm
> 3. I also tried using .htaccess and Directory and few more random
> hacks, though couldnt figure out anything.
>
> Any help would be greatly appreciated.

The easiest fix would probably be to replace your <Location /> with a
regex that excludes /php.  Something like <LocationMatch ^/(?!php/)>
(untested).  Then use a regular AddHandler for that particular
directory to activate php.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org