You are not logged in.

#1 2009-09-01 01:13:57

akurashy
Member
Registered: 2006-05-29
Posts: 75

Trying to do this in Apache (PHP and httpd.conf)

I'm trying to set up a part of a site with apache to use shell_exec, while the others have this function restricted though this is my first time so I really have no clue where I'm looking at.

What I need is to call it with a different port (ex. http://localhost:8080, go with other) and practically change the document root, a more "liberal" php.ini to get shell_exec and be able to manage a daemon (to stop/start/restart, manipulate its XML config. )

Although I wonder how it would go in the configuration file, because I still have to maintain the normal sites also with apache and be able to run what I said above.

-----------

This is a copy/paste just re-posting again in this forum to see if anyone knows, let me know if you have any doubts or need more explanation to what I want to do.

Thanks in advance!

Offline

#2 2009-09-01 02:25:24

neddie_seagoon
Member
Registered: 2009-08-23
Posts: 121

Re: Trying to do this in Apache (PHP and httpd.conf)

You should be able to add Listen 8080 to httpd.conf and setup a virtualhost with the proper document root listening on that port. As for the shell_exec, I assume this is disabled globally in php.ini, so I would check the PHP documentation to see if you can override that disabled_functions for the virtualhost in its Apache config. If you can, then your setup should work as you need it to.

Offline

#3 2009-09-01 03:45:32

scragar
Member
Registered: 2009-07-14
Posts: 108

Re: Trying to do this in Apache (PHP and httpd.conf)

neddie_seagoon wrote:

You should be able to add Listen 8080 to httpd.conf and setup a virtualhost with the proper document root listening on that port. As for the shell_exec, I assume this is disabled globally in php.ini, so I would check the PHP documentation to see if you can override that disabled_functions for the virtualhost in its Apache config. If you can, then your setup should work as you need it to.

The function can be enabled or disabled on a page by page or folder by folder basis using .htaccess or your apache conf file.

php_value disable_functions "shell_exec,exec,system,passthru,proc_open"

Offline

#4 2009-09-02 22:44:01

akurashy
Member
Registered: 2006-05-29
Posts: 75

Re: Trying to do this in Apache (PHP and httpd.conf)

disabling page by page doesn;'t look like a pretty solution, well not so effective if I want to change back, but really thanks I'll take a look at virtualhost configurations to see if it lets me run a PHP.ini for each virtualhost

thanks again smile

Offline

Board footer

Powered by FluxBB