Hi Jamie,
This issue was first logged by me at 1.981 since I did not get a response I have now selected and owner.
I would not mind but I even provided you guys a potential fix to the issue I am not sure if it is affected all apache 2.4 instances as I only have openSUSE boxes to test on.
I think the fix is to modify the cgi file create_virt as below:
push(@mems, @cmems);
if ($in{'adddir'} && $in{'root'}) {
# Add a <directory> section for the root
$dirsect = { 'name' => 'Directory',
'value' => "\"$in{'root'}\"",
'type' => 1,
'members' => [
{ 'name' => 'Options',
'value' => 'None' },
],
};</directory>
if ($httpd_modules{'core'} <= 2.4) {
# Apache 2.2 and below needs a "allow from all" line
push(@{$dirsect->{'members'}},
{ 'name' => 'allow',
'value' => 'from all' });
}
if ($httpd_modules{'core'} >= 2.4) {
# Apache 2.4+ needs a 'Require all granted' line
push(@{$dirsect->{'members'}},
{ 'name' => 'Require',
'value' => 'all granted' });
}
push(@mems, $dirsect);
}
As I noted I have not been able to test this on anything other than openSUSE so I cannot confirm if this only effects openSUSE but it appears to be an issue with how the file is created for Apache2.4 than an distro issue.
Thanks
Chris
Thanks ... but how was the config invalid before this change?
Hi Jamie,
It included both the "allow from all" and "require all granted" in the .vhost which would cause apache to fail to start on a syntax error.
Apologies for not explaining.
Thanks
Chris
Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: Jamie Cameron jcameron@users.sourceforge.net
Sent: Saturday, February 5, 2022 5:42:35 AM
To: [webadmin:bugs] 5547@bugs.webadmin.p.re.sourceforge.net
Subject: [webadmin:bugs] #5547 create_virt.cgi creates invalid .vhosts for apache 2.4
Thanks ... but how was the config invalid before this change?
[bugs:#5547]https://sourceforge.net/p/webadmin/bugs/5547/ create_virt.cgi creates invalid .vhosts for apache 2.4
Status: open
Group: 1.984
Created: Sat Feb 05, 2022 04:05 AM UTC by Christopher Wager
Last Updated: Sat Feb 05, 2022 04:05 AM UTC
Owner: Jamie Cameron
Hi Jamie,
This issue was first logged by me at 1.981 since I did not get a response I have now selected and owner.
I would not mind but I even provided you guys a potential fix to the issue I am not sure if it is affected all apache 2.4 instances as I only have openSUSE boxes to test on.
I think the fix is to modify the cgi file create_virt as below:
push(@memshttps://sourceforge.net/u/mems/, @cmems);
if ($in{'adddir'} && $in{'root'}) {
Add a <directory> section for the root</directory>
$dirsect = { 'name' => 'Directory',
'value' => "\"$in{'root'}\"",
'type' => 1,
'members' =>
{ 'name' => 'Options',
'value' => 'None' },
https://sourceforge.net/{%20'name'%20=%20'Options',
%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20'value'%20=>%20'None'%20},>,
};
As I noted I have not been able to test this on anything other than openSUSE so I cannot confirm if this only effects openSUSE but it appears to be an issue with how the file is created for Apache2.4 than an distro issue.
Thanks
Chris
Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/webadmin/bugs/5547/
To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
Related
Bugs:
#5547Hi Jamie,
Its worth noting it might be possible to work round this on the apache server by adding the mod_access_compat module but that's not the right answer in my view webmin should understand the need for the new syntax and deal with it accordingly.
In my case I'm not a huge fan of enabling legacy modules if there not needed and I would rather edit the cgi file manually as I have done than enable a compatibility module.
I imagine this will be an issue for scripts related to updating the vhosts also, I haven't tested updating as I have not needed to use it.
Sorry for the additional email just trying to help as much as I can.
Thanks
Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: Christopher Wager stargazer2021@users.sourceforge.net
Sent: Saturday, February 5, 2022 7:48:31 AM
To: [webadmin:bugs] 5547@bugs.webadmin.p.re.sourceforge.net
Subject: [webadmin:bugs] Re: #5547 create_virt.cgi creates invalid .vhosts for apache 2.4
Hi Jamie,
It included both the "allow from all" and "require all granted" in the .vhost which would cause apache to fail to start on a syntax error.
Apologies for not explaining.
Thanks
Chris
Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: Jamie Cameron jcameron@users.sourceforge.netjcameron@users.sourceforge.net
Sent: Saturday, February 5, 2022 5:42:35 AM
To: [webadmin:bugs] 5547@bugs.webadmin.p.re.sourceforge.net5547@bugs.webadmin.p.re.sourceforge.net
Subject: [webadmin:bugs] #5547 create_virt.cgi creates invalid .vhosts for apache 2.4
Thanks ... but how was the config invalid before this change?
[bugs:#5547]https://sourceforge.net/p/webadmin/bugs/5547/https://sourceforge.net/p/webadmin/bugs/5547/ create_virt.cgi creates invalid .vhosts for apache 2.4
Status: open
Group: 1.984
Created: Sat Feb 05, 2022 04:05 AM UTC by Christopher Wager
Last Updated: Sat Feb 05, 2022 04:05 AM UTC
Owner: Jamie Cameron
Hi Jamie,
This issue was first logged by me at 1.981 since I did not get a response I have now selected and owner.
I would not mind but I even provided you guys a potential fix to the issue I am not sure if it is affected all apache 2.4 instances as I only have openSUSE boxes to test on.
I think the fix is to modify the cgi file create_virt as below:
push(@memshttps://sourceforge.net/u/mems/https://sourceforge.net/u/mems/, @cmems);
if ($in{'adddir'} && $in{'root'}) {
Add a <directory> section for the root</directory>
$dirsect = { 'name' => 'Directory',
'value' => "\"$in{'root'}\"",
'type' => 1,
'members' =>
{ 'name' => 'Options',
'value' => 'None' },
https://sourceforge.net/{%20'name'%20=%20'Options',
%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20'value'%20=>%20'None'%20},>,
};
if ($httpd_modules{'core'} <= 2.4) {
# Apache 2.2 and below needs a "allow from all" line
push(@{$dirsect->{'members'}},
{ 'name' => 'allow',
'value' => 'from all' });
}
if ($httpd_modules{'core'} >= 2.4) {
# Apache 2.4+ needs a 'Require all granted' line
push(@{$dirsect->{'members'}},
{ 'name' => 'Require',
'value' => 'all granted' });
}
push(@mems, $dirsect);
}
As I noted I have not been able to test this on anything other than openSUSE so I cannot confirm if this only effects openSUSE but it appears to be an issue with how the file is created for Apache2.4 than an distro issue.
Thanks
Chris
Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/webadmin/bugs/5547/
To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
[bugs:#5547]https://sourceforge.net/p/webadmin/bugs/5547/ create_virt.cgi creates invalid .vhosts for apache 2.4
Status: open
Group: 1.984
Created: Sat Feb 05, 2022 04:05 AM UTC by Christopher Wager
Last Updated: Sat Feb 05, 2022 05:42 AM UTC
Owner: Jamie Cameron
Hi Jamie,
This issue was first logged by me at 1.981 since I did not get a response I have now selected and owner.
I would not mind but I even provided you guys a potential fix to the issue I am not sure if it is affected all apache 2.4 instances as I only have openSUSE boxes to test on.
I think the fix is to modify the cgi file create_virt as below:
push(@memshttps://sourceforge.net/u/mems/, @cmems);
if ($in{'adddir'} && $in{'root'}) {
Add a <directory> section for the root</directory>
$dirsect = { 'name' => 'Directory',
'value' => "\"$in{'root'}\"",
'type' => 1,
'members' =>
{ 'name' => 'Options',
'value' => 'None' },
https://sourceforge.net/{%20'name'%20=%20'Options',
%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20'value'%20=>%20'None'%20},>,
};
As I noted I have not been able to test this on anything other than openSUSE so I cannot confirm if this only effects openSUSE but it appears to be an issue with how the file is created for Apache2.4 than an distro issue.
Thanks
Chris
Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/webadmin/bugs/5547/
To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
Related
Bugs:
#5547Hi Jamie,
If we do strace and look for the write section, we find the following error being triggered:
[pid 5745] write(2, "AH00526: Syntax error on line 7 "..., 83AH00526: Syntax error on line 7 of /etc/apache2/vhosts.d/www.56kprojects.com.conf:
) = 83
[pid 5745] write(2, "Invalid command 'allow', perhaps"..., 108Invalid command 'allow', perhaps misspelled or defined by a module not included in the server configuration
) = 108
For comparison here are the .vhost files before and after my change:
Before my change to the CGI file:
<virtualhost *="">
DocumentRoot "/srv/www/56kprojects.com"</virtualhost>
After my change to the CGI file:
<virtualhost *="">
DocumentRoot "/srv/www/56kprojects.com"</virtualhost>
It is possible that this is because I have chosen not to install mod_access_compat module.
However, in the context of the environment this is being used in having unnecessary modules is not the ideal process.
Given the time since the launch of this newer standard it should really have been adopted widely by now and tools that integrate without it ought to function without the need for additional legacy modules.
Thanks
Chris
From: Christopher Wager stargazer2021@users.sourceforge.net
Sent: 05 February 2022 08:13
To: [webadmin:bugs] 5547@bugs.webadmin.p.re.sourceforge.net
Subject: [webadmin:bugs] Re: #5547 create_virt.cgi creates invalid .vhosts for apache 2.4
Hi Jamie,
Its worth noting it might be possible to work round this on the apache server by adding the mod_access_compat module but that's not the right answer in my view webmin should understand the need for the new syntax and deal with it accordingly.
In my case I'm not a huge fan of enabling legacy modules if there not needed and I would rather edit the cgi file manually as I have done than enable a compatibility module.
I imagine this will be an issue for scripts related to updating the vhosts also, I haven't tested updating as I have not needed to use it.
Sorry for the additional email just trying to help as much as I can.
Thanks
Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: Christopher Wager stargazer2021@users.sourceforge.netstargazer2021@users.sourceforge.net
Sent: Saturday, February 5, 2022 7:48:31 AM
To: [webadmin:bugs] 5547@bugs.webadmin.p.re.sourceforge.net5547@bugs.webadmin.p.re.sourceforge.net
Subject: [webadmin:bugs] Re: #5547 create_virt.cgi creates invalid .vhosts for apache 2.4
Hi Jamie,
It included both the "allow from all" and "require all granted" in the .vhost which would cause apache to fail to start on a syntax error.
Apologies for not explaining.
Thanks
Chris
Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: Jamie Cameron jcameron@users.sourceforge.netjcameron@users.sourceforge.netjcameron@users.sourceforge.net
Sent: Saturday, February 5, 2022 5:42:35 AM
To: [webadmin:bugs] 5547@bugs.webadmin.p.re.sourceforge.net5547@bugs.webadmin.p.re.sourceforge.net5547@bugs.webadmin.p.re.sourceforge.net
Subject: [webadmin:bugs] #5547 create_virt.cgi creates invalid .vhosts for apache 2.4
Thanks ... but how was the config invalid before this change?
[bugs:#5547]https://sourceforge.net/p/webadmin/bugs/5547/https://sourceforge.net/p/webadmin/bugs/5547/https://sourceforge.net/p/webadmin/bugs/5547/ create_virt.cgi creates invalid .vhosts for apache 2.4
Status: open
Group: 1.984
Created: Sat Feb 05, 2022 04:05 AM UTC by Christopher Wager
Last Updated: Sat Feb 05, 2022 04:05 AM UTC
Owner: Jamie Cameron
Hi Jamie,
This issue was first logged by me at 1.981 since I did not get a response I have now selected and owner.
I would not mind but I even provided you guys a potential fix to the issue I am not sure if it is affected all apache 2.4 instances as I only have openSUSE boxes to test on.
I think the fix is to modify the cgi file create_virt as below:
push(@memshttps://sourceforge.net/u/mems/https://sourceforge.net/u/mems/https://sourceforge.net/u/mems/, @cmems);
if ($in{'adddir'} && $in{'root'}) {
Add a <directory> section for the root</directory>
$dirsect = { 'name' => 'Directory',
'value' => "\"$in{'root'}\"",
'type' => 1,
'members' =>
{ 'name' => 'Options',
'value' => 'None' },
https://sourceforge.net/{%20'name'%20=%20'Options',
%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20'value'%20=>%20'None'%20},>,
};
if ($httpd_modules{'core'} <= 2.4) {
Apache 2.2 and below needs a "allow from all" line
push(@{$dirsect->{'members'}},
{ 'name' => 'allow',
'value' => 'from all' });
}
if ($httpd_modules{'core'} >= 2.4) {
Apache 2.4+ needs a 'Require all granted' line
push(@{$dirsect->{'members'}},
{ 'name' => 'Require',
'value' => 'all granted' });
}
push(@memshttps://sourceforge.net/u/mems/, $dirsect);
}
As I noted I have not been able to test this on anything other than openSUSE so I cannot confirm if this only effects openSUSE but it appears to be an issue with how the file is created for Apache2.4 than an distro issue.
Thanks
Chris
Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/webadmin/bugs/5547/
To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
[bugs:#5547]https://sourceforge.net/p/webadmin/bugs/5547/https://sourceforge.net/p/webadmin/bugs/5547/ create_virt.cgi creates invalid .vhosts for apache 2.4
Status: open
Group: 1.984
Created: Sat Feb 05, 2022 04:05 AM UTC by Christopher Wager
Last Updated: Sat Feb 05, 2022 05:42 AM UTC
Owner: Jamie Cameron
Hi Jamie,
This issue was first logged by me at 1.981 since I did not get a response I have now selected and owner.
I would not mind but I even provided you guys a potential fix to the issue I am not sure if it is affected all apache 2.4 instances as I only have openSUSE boxes to test on.
I think the fix is to modify the cgi file create_virt as below:
push(@memshttps://sourceforge.net/u/mems/https://sourceforge.net/u/mems/, @cmems);
if ($in{'adddir'} && $in{'root'}) {
Add a <directory> section for the root</directory>
$dirsect = { 'name' => 'Directory',
'value' => "\"$in{'root'}\"",
'type' => 1,
'members' =>
{ 'name' => 'Options',
'value' => 'None' },
https://sourceforge.net/{%20'name'%20=https://sourceforge.net/%7b%20'name'%20=%20'Options',
%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20'value'%20=>%20'None'%20},>,
};
if ($httpd_modules{'core'} <= 2.4) {
if ($httpd_modules{'core'} >= 2.4) {
push(@mems, $dirsect);
}
As I noted I have not been able to test this on anything other than openSUSE so I cannot confirm if this only effects openSUSE but it appears to be an issue with how the file is created for Apache2.4 than an distro issue.
Thanks
Chris
Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/webadmin/bugs/5547/
To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
[bugs:#5547]https://sourceforge.net/p/webadmin/bugs/5547/ create_virt.cgi creates invalid .vhosts for apache 2.4
Status: open
Group: 1.984
Created: Sat Feb 05, 2022 04:05 AM UTC by Christopher Wager
Last Updated: Sat Feb 05, 2022 05:42 AM UTC
Owner: Jamie Cameron
Hi Jamie,
This issue was first logged by me at 1.981 since I did not get a response I have now selected and owner.
I would not mind but I even provided you guys a potential fix to the issue I am not sure if it is affected all apache 2.4 instances as I only have openSUSE boxes to test on.
I think the fix is to modify the cgi file create_virt as below:
push(@memshttps://sourceforge.net/u/mems/, @cmems);
if ($in{'adddir'} && $in{'root'}) {
Add a <directory> section for the root</directory>
$dirsect = { 'name' => 'Directory',
'value' => "\"$in{'root'}\"",
'type' => 1,
'members' =>
{ 'name' => 'Options',
'value' => 'None' },
https://sourceforge.net/%7b%20'name'%20=%3e%20'Options',%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20'value'%20=%3e%20'None'%20%7d,,
};
As I noted I have not been able to test this on anything other than openSUSE so I cannot confirm if this only effects openSUSE but it appears to be an issue with how the file is created for Apache2.4 than an distro issue.
Thanks
Chris
Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/webadmin/bugs/5547/
To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
Related
Bugs:
#5547I suppose we could check if
mod_access_compatis installed before adding thoseallowdirectives. Is there also amod_accessdirective on Apache 2.4 ?Hi Jsmie,
Im a bit cofused as to why the would want to check if mod_access_compat is installed before adding the allow from all over adding only the correct directive for the new version.
If you creating a new vhost you really ought to be using the correct syntax.
Granted that may not be so if they are using webmin to amend vhosts that already exist but they you have a bigger problem.
Intact apache even had documentation that explains using both types in the same vhost can lead to conflict and result in no access at all.
Thanks
Chris
Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: Jamie Cameron jcameron@users.sourceforge.net
Sent: Wednesday, February 9, 2022 5:40:47 AM
To: [webadmin:bugs] 5547@bugs.webadmin.p.re.sourceforge.net
Subject: [webadmin:bugs] #5547 create_virt.cgi creates invalid .vhosts for apache 2.4
I suppose we could check if mod_access_compat is installed before adding those allow directives. Is there also a mod_access directive on Apache 2.4 ?
[bugs:#5547]https://sourceforge.net/p/webadmin/bugs/5547/ create_virt.cgi creates invalid .vhosts for apache 2.4
Status: open
Group: 1.984
Created: Sat Feb 05, 2022 04:05 AM UTC by Christopher Wager
Last Updated: Sat Feb 05, 2022 05:42 AM UTC
Owner: Jamie Cameron
Hi Jamie,
This issue was first logged by me at 1.981 since I did not get a response I have now selected and owner.
I would not mind but I even provided you guys a potential fix to the issue I am not sure if it is affected all apache 2.4 instances as I only have openSUSE boxes to test on.
I think the fix is to modify the cgi file create_virt as below:
push(@memshttps://sourceforge.net/u/mems/, @cmems);
if ($in{'adddir'} && $in{'root'}) {
Add a <directory> section for the root</directory>
$dirsect = { 'name' => 'Directory',
'value' => "\"$in{'root'}\"",
'type' => 1,
'members' =>
{ 'name' => 'Options',
'value' => 'None' },
https://sourceforge.net/{%20'name'%20=%20'Options',
%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20'value'%20=>%20'None'%20},>,
};
As I noted I have not been able to test this on anything other than openSUSE so I cannot confirm if this only effects openSUSE but it appears to be an issue with how the file is created for Apache2.4 than an distro issue.
Thanks
Chris
Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/webadmin/bugs/5547/
To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
Related
Bugs:
#5547You're right, I'll just stop setting that under Apache 2.4+