This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

httpd-vhosts.conf error
#1
httpd-vhosts.conf error
zPanel overwrites the httpd-vhosts.conf file every time apache restarts or the server is rebooted. When zPanel (10.1.1) creates virtual domain entries in httpd-vhosts.conf it includes the entry:

<location /cgi-bin>
AddHandler cgi-script .cgi .pl
Options ExecCGI -Indexes
</location>

Unfortunately this includes an error: the - in front of "Indexes" should not be there and causes current versions of apache to fail to restart. I can manually edit this file (multiple entries, one for each virtual domain) but I have to do this every time the server or apache restarts. The questions is, where does zPanel get this  bit of code? I have looked in the SQL tables, the config files, and in the php files but can't find it. Can someone point me in the right direction please?
Thanks,
Cliff
Reply
Thanks given by:
#2
RE: httpd-vhosts.conf error
1. You should not have such error. Also Perl/CGI should not be enabled under zpanel as they are not secure.

2. you might check:

https://github.com/zpanel/zpanelx/blob/m...n.hook.php

Path under linux box:

/etc/zpanel/panel/modules/apache_admin/hooks/OnDaemonRun.hook.php

M B
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask

200$ free to start your VPS 60 days credit
Reply
Thanks given by: CliffMitchell
#3
RE: httpd-vhosts.conf error
Thanks M B, that's really helpful. However, I have checked my version of OnDaemonRun.hook.php and it appears to be correct. But, if I create a new domain in zpanel the code added to httpd-vhosts.conf for the new domain includes this block:

ScriptAlias /cgi-bin/ "/_cgi-bin/"
<location /cgi-bin>
AddHandler cgi-script .cgi .pl
Options ExecCGI -Indexes
</location>

Where could this be coming from and how do I disable PERL/CGI from zPanel? Can I force zPanel to recreate the httpd-vhosts.conf file?
Thanks,

Cliff
Reply
Thanks given by:
#4
RE: httpd-vhosts.conf error
Ah, I just found the code in the x_settings table in the database. There is a cgi_handler row that contains the cgi code block that has been causing my problems. The row was flagged as not user editable which is why I couldn't see it in zPanel. I have removed the code from the dabase but left the table row in place, just in case. This has solved my problem. I can only guess that this is a hangover from problems we had some time ago when we missed a zPanel upgrade and had problems catching up.
Anyway, many many thanks for your help - you pointed me in exactly the right direction!
Cliff
Reply
Thanks given by:
#5
RE: httpd-vhosts.conf error
You are welcome good to see it resolved.

Also disable CGI in all packages.

M B
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask

200$ free to start your VPS 60 days credit
Reply
Thanks given by: CliffMitchell


Possibly Related Threads…
Thread Author Replies Views Last Post
Repo update error hostingms 3 6 ,827 02-14-2024, 09:20 AM
Last Post: TGates
apt-get install mod_ssl ERROR CMs222 9 28 ,345 11-11-2022, 09:14 PM
Last Post: zustudios
Sentora debug and error files johnnyp 0 1 ,593 10-27-2022, 06:16 PM
Last Post: johnnyp

Forum Jump:


Users browsing this thread: 6 Guest(s)