Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for gh333: Layout broken after installation of 1.5.2 #335

Conversation

computersalat
Copy link

@computersalat computersalat changed the title fixes gh333 fix for gh333: Layout broken after installation of 1.5.2 Mar 20, 2022
@shreesh-webkul
Copy link
Contributor

The issue linked with this PR #333 is still not recreated, that issue might have occurred due to some other reason
Meanwhile, this PR is resolving another issue so it needs some changes before merging into QloApps.
The PR addresses the new configuration directives used in apache 2.4 and updates the google fonts access protocol so please update the title accordingly.
Also, unlink the PR with issue #333.

Changes :

  • .htaccess should use mod_authz_host instead of mod_access_compat as mod_access_compat has been depricated

    • Preferably like:

      <IfVersion < 2.4>
          Order deny,allow
          Deny from all
      </IfVersion>
      <IfVersion >= 2.4>
          <IfModule mod_authz_host.c>
              Require all denied
          </IfModule>
          <IfModule !mod_authz_host.c>
              Order deny,allow
              Deny from all
          </IfModule>
      </IfVersion>
      
  • we have used php_flag engine off, instead we should not use this as it destroy the whole purpose of redirection using index.php, should be removed from /img/cms/ and /upload/ directory

@shreesh-webkul
Copy link
Contributor

@computersalat
The issue was recreated in openSUSE 15.3.
Update the given changes so that we can merge PR.

Changes
.htaccess should use mod_authz_host instead of mod_access_compat as mod_access_compat has been deprecated.
Apache version comparison is not required as the module can define which method to use. Only use the following code:

<IfModule mod_authz_host.c>
    Require all denied
</IfModule>
<IfModule !mod_authz_host.c>
    Order deny,allow
    Deny from all
</IfModule>

@computersalat
Copy link
Author

computersalat commented Jun 14, 2022

@computersalat The issue was recreated in openSUSE 15.3. Update the given changes so that we can merge PR.

Changes .htaccess should use mod_authz_host instead of mod_access_compat as mod_access_compat has been deprecated. Apache version comparison is not required as the module can define which method to use. Only use the following code:

<IfModule mod_authz_host.c>
    Require all denied
</IfModule>
<IfModule !mod_authz_host.c>
    Order deny,allow
    Deny from all
</IfModule>

Sorry, but your proposal is just wrong. You did definitly NOT understand the migration of directives from Apache 2.2 to 2.4.
The absence of mod_authz_host does not define to be on Apache 2.4.
mod_access_compat was introduced with apache 2.3 to keep OLD mod_authz_host directives (Order) without the need to change to the NEW mod_authz_host directives (Require).
On Apache 2.2: mod_authz_host is using the Order directive.
See also:
https://httpd.apache.org/docs/2.2/mod/mod_authz_host.html
On Apache 2.4: mod_authz_host is using the Require directive.
See also:
https://httpd.apache.org/docs/2.4/mod/mod_authz_host.html

So if you want a working solution that can still be used on OLD Apache 2.2 as well as on Apache 2.4 then just take my PR as is.
If you want a correct and working solution only for Apache 2.4 convert all your OLD Order directives to the NEW Require directive.

If you still don't understand then just close this PR. I am tired.

@shreesh-webkul
Copy link
Contributor

@computersalat

We have checked the issue does occur in openSESU 15.3 but it took some time to recreate the issue as the complete steps were not clear on how the recreate the issue and the testing environment.

The "mod_access_compat" directives have been deprecated in apache 2.4 by "mod_authz_host".
Please see the warning in https://httpd.apache.org/docs/2.4/mod/mod_access_compat.html
So it is now encouraged to use mod_authz_host.

we need the code that is being merged with QloApps to be of the correct standard.
Please update the PR, we are waiting.

@computersalat
Copy link
Author

@shreesh-webkul

You still didn't answer the question about what you want.
Read my previous comment carefully and answer the question for yourself.
If you know what you want then proceed as proposed.

@computersalat computersalat force-pushed the 20220320_computersalat_gh333 branch from 11cc3a9 to 1cf0b3e Compare May 31, 2023 18:58
@computersalat computersalat changed the base branch from v1.5.x to develop May 31, 2023 18:59
@computersalat
Copy link
Author

@shreesh-webkul
All your .htaccess files consists of the OLD Order Directives that should be used by Apache 2.2.

Note

The directives provided by [mod_access_compat](https://httpd.apache.org/docs/2.4/mod/mod_access_compat.html) have been deprecated by [mod_authz_host](https://httpd.apache.org/docs/2.4/mod/mod_authz_host.html).
Mixing old directives like [Order](https://httpd.apache.org/docs/2.4/mod/mod_access_compat.html#order), [Allow](https://httpd.apache.org/docs/2.4/mod/mod_access_compat.html#allow)
 or [Deny](https://httpd.apache.org/docs/2.4/mod/mod_access_compat.html#deny) with new ones like [Require](https://httpd.apache.org/docs/2.4/mod/mod_authz_core.html#require) is technically possible but discouraged.
This module was created to support configurations containing only old directives to facilitate the 2.4 upgrade. Please check the [upgrading](https://httpd.apache.org/docs/2.4/upgrading.html) guide for more information.

If you want to continue using your old code also on Apache >= 2.4 then you must use mod_access_compat because you don't know if the guy that is running apache 2.4 is using mod_access_compat or not.
If that guy is not using mod_access_compat on his apache 2.4, then you must use the NEW Require Directive.

This patch is perfect for using the code on Apache 2.2 as well as on Apache 2.4. No matter if mod_access_compat is being used on Apache 2.4 or not.

Hopefully you will understand now.

@rohit053
Copy link
Collaborator

rohit053 commented Sep 9, 2024

We have updated .htaccess files compatibility with Apache 2.2 and 2.4 in the PR #1062 . So, we are closing this PR.

@rohit053 rohit053 closed this Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Layout broken after installation of 1.5.2
3 participants