You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Imanol Apaolaza Sanz <ia...@unav.es> on 2004/11/17 08:53:53 UTC

[users@httpd] Restrict php execution only to some web directories

Hello,

    I am trying to restrict execution of php scripts to some web 
directories only, leaving the rest of web directories without php 
support. If I use (f.e):

<Directory "/usr/local/etc2/httpd/htdocs/php_prueba">
   Options Indexes FollowSymLinks
   AllowOverride None
   Order allow,deny
   Allow from all
    AddType application/x-httpd-php .php .phtml
</Directory>

deleting AddType application/x-httpd-php .php .phtml line from global 
parameters y can execute php script only in this directory, but if 
someone use an .htaccess with this content:

    AddType application/x-httpd-php .php .phtml

in other directory, the php ejecution works there too.

Is possible to restrict php execution only to some directories?

Regards,
Imanol Apaolaza Sanz



---------------------------------------------------------------------
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] Restrict php execution only to some web directories

Posted by Ralf Glauberman <rg...@michaeli-gymnasium.de>.
you simply mustn't grant allowoverride fileinfo, this way the users can't 
use AddType in their .htaccess-files. there would be other ways, but that 
would all be dirty workarrounds, so if possible, try this way.
Ralf

----- Original Message ----- 
From: "Imanol Apaolaza Sanz" <ia...@unav.es>
To: <us...@httpd.apache.org>
Sent: Wednesday, November 17, 2004 8:53 AM
Subject: [users@httpd] Restrict php execution only to some web directories


> Hello,
>
>    I am trying to restrict execution of php scripts to some web 
> directories only, leaving the rest of web directories without php support. 
> If I use (f.e):
>
> <Directory "/usr/local/etc2/httpd/htdocs/php_prueba">
>   Options Indexes FollowSymLinks
>   AllowOverride None
>   Order allow,deny
>   Allow from all
>    AddType application/x-httpd-php .php .phtml
> </Directory>
>
> deleting AddType application/x-httpd-php .php .phtml line from global 
> parameters y can execute php script only in this directory, but if someone 
> use an .htaccess with this content:
>
>    AddType application/x-httpd-php .php .phtml
>
> in other directory, the php ejecution works there too.
>
> Is possible to restrict php execution only to some directories?
>
> Regards,
> Imanol Apaolaza Sanz
>
>
>
> ---------------------------------------------------------------------
> 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
> 


---------------------------------------------------------------------
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


[users@httpd] Unknown abort occurs during execution of application, Please help me

Posted by barun_sharma <ba...@persistent.co.in>.
Hi All,

I  installed Apache2 2.0.52 for Linux AS 3.0. I was trying to run my
application with this apache2 server. After making appropriate change in
httpd.conf(User Name, Group Name, ServerName, Listening Port ) and running
EditHttpConf, I tried to start apache server by running script "./apachectl
start". There occurs abort with message "./apachectl: line 99: 16129 Aborted
(core dumped) $HTTPD -k $ARGV".
I tried to debug with core file but couldn't figure out much. The stack dump
is as follows:

=================
#0  0xb75ebc32 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0xb7320a09 in raise () from /lib/tls/libc.so.6
#2  0xb7322235 in abort () from /lib/tls/libc.so.6
#3  0xb7407070 in __deregister_frame_info_bases_internal () from
/lib/tls/libc.so.6
#4  0xb726d19a in __do_global_dtors_aux ()
   from
/home1/prashant/barun/netpoint/webgate/access/oblix/lib/libstdc++.so.5
#5  0xb72c9759 in _fini () from
/home1/prashant/barun/netpoint/webgate/access/oblix/lib/libstdc++.so.5
#6  0xb7405fe3 in _dl_close () from /lib/tls/libc.so.6
#7  0xb743105c in dlclose_doit () from /lib/libdl.so.2
#8  0xb75f7b56 in _dl_catch_error_internal () from /lib/ld-linux.so.2
#9  0xb7431456 in _dlerror_run () from /lib/libdl.so.2
#10 0xb7431022 in dlclose () from /lib/libdl.so.2
#11 0xb74d96d8 in dso_cleanup (thedso=0x8123020) at dso.c:71
#12 0xb74d80cd in run_cleanups (cref=0x80c2a60) at apr_pools.c:1951
#13 0xb74d7769 in apr_pool_clear (pool=0x80c2a50) at apr_pools.c:693
#14 0x080879d2 in main (argc=3, argv=0xbfffaf04) at main.c:574
=================================================

This is what  I observed of shared libraries dependencies with httpd using
script "ldd httpd",

libaprutil-0.so.0 =>
/home/barun/apache_httpd-2.0.52_6666/lib/libaprutil-0.so.0 (0xb75d4000)
libgdbm.so.2 => /usr/lib/libgdbm.so.2 (0xb75bf000)
libdb-4.1.so => /lib/libdb-4.1.so (0xb74fd000)
libexpat.so.0 => /usr/lib/libexpat.so.0 (0xb74dd000)
libapr-0.so.0 => /home/barun/apache_httpd-2.0.52_6666/lib/libapr-0.so.0
(0xb74bc000)
librt.so.1 => /lib/tls/librt.so.1 (0xb74a8000)
libm.so.6 => /lib/tls/libm.so.6 (0xb7485000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0xb7458000)
libnsl.so.1 => /lib/libnsl.so.1 (0xb7443000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb7433000)
libdl.so.2 => /lib/libdl.so.2 (0xb7430000)
libc.so.6 => /lib/tls/libc.so.6 (0xb72f9000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb72ef000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb75eb000)

Here my question is :
1) how /lib/libgcc_s.so.1(version is libgcc 3.2.3) get asscociated here, if
this might be clashing with my application which is having different
libgcc_s.so.1 library ?
2) How I can fix or remove the above dependencies for httpd? If this is one
of problem or there might be other reasons for this unknown abort?

Please help me to find its solution as I urgently need to test my
application in apache2 server.

I am earnestly waiting any feedback, suggestion or remark on the same. If
you need any further info, please write to me.

Thanks
--Barun



---------------------------------------------------------------------
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] Restrict php execution only to some web directories

Posted by Tim Burden <Ti...@Burden.ca>.
You probably just need to make the default for all directories being php
off.

something like
<Directory "/usr/local/etc2/httpd/htdocs/">
php_admin_flag engine off
</Directory>
<Directory "/usr/local/etc2/httpd/htdocs/php_prueba">
php_admin_flag engine on
</Directory>

----- Original Message ----- 
From: "Imanol Apaolaza Sanz" <ia...@unav.es>
To: <us...@httpd.apache.org>
Sent: Wednesday, November 17, 2004 2:53 AM
Subject: [users@httpd] Restrict php execution only to some web directories


> Hello,
>
>     I am trying to restrict execution of php scripts to some web
> directories only, leaving the rest of web directories without php
> support. If I use (f.e):
>
> <Directory "/usr/local/etc2/httpd/htdocs/php_prueba">
>    Options Indexes FollowSymLinks
>    AllowOverride None
>    Order allow,deny
>    Allow from all
>     AddType application/x-httpd-php .php .phtml
> </Directory>
>
> deleting AddType application/x-httpd-php .php .phtml line from global
> parameters y can execute php script only in this directory, but if
> someone use an .htaccess with this content:
>
>     AddType application/x-httpd-php .php .phtml
>
> in other directory, the php ejecution works there too.
>
> Is possible to restrict php execution only to some directories?
>
> Regards,
> Imanol Apaolaza Sanz
>
>
>
> ---------------------------------------------------------------------
> 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
>


---------------------------------------------------------------------
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