VirtualHost RemoveHandler

Hi,
when i create a new virtual server on my webmin i see that it comes with this 3 lines in
the end of virtual host:

RemoveHandler .php
RemoveHandler .php5
php_admin_value engine Off

but in my server virtualhost template is:

ServerName ${DOM}
ServerAlias www.${DOM}
DocumentRoot ${HOME}/public_html
ErrorLog /var/log/virtualmin/${DOM}_error_log
CustomLog /var/log/virtualmin/${DOM}_access_log combined
ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory ${HOME}/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +FollowSymLinks
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch,FollowSymLinks

<Directory ${HOME}/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch,FollowSymLinks

so i need to remove this 3 lines that virtualmin adds automatically when i add a new domain to my virtualservers without removing them manually, if this entries:

RemoveHandler .php
RemoveHandler .php5
php_admin_value engine Off

are on a template vhost php pages and whole website gives me a download and don’t execute php.

any suggestions?

regards,

Nerdy

Howdy,

It’s actually normal that the VirtualHost contain the RemoveHandler lines near the end of the VirtualHost block.

That’s not likely the cause of the issue you’re seeing.

Are you by chance using a third party version of PHP for your distro? That’s the most common cause of the symptoms you’re seeing.

What distro/version is it that you’re using there?

-Eric

Hi Eric,
my php version is: 5.4.23
and my server api is: Apache 2.0 Handler

my distro version is: Ubuntu-12.04-precise-64-minimal

i’m using a php version that comes with zend server.

i need that virtualmin doesn’t insert this entries when create che virtualhost:
RemoveHandler .php RemoveHandler .php5 php_admin_value engine Off

without editing the virtual host files and add # for ignore that rules.

any suggestion?

regards,

Nerdy

Hi, do you solve this? I have the same problem, when I create a new Virtual Server always add RemoveHandler and I must to comment this lines.

Why must you comment out the lines? I mean, what problem are you trying to solve by doing so?

The pages with PHP do not work, the problem is that it must come from another site but commenting on those lines already works.

Huh…what execution mode are you using?

The only time Virtualmin should be adding those is if mod_php is enabled in Apache, and you’re using an execution mode other than mod_php. If you aren’t using mod_php I recommend disabling it entirely (I have wanted to disable mod_php, by default, for about five years, but people really get mad when I try!). But, disabling it will cause Virtualmin to not add those directives.