# Mautic Installation On Litespeed Server | Through Softaculous

**URL:** <https://forum.mautic.org/t/mautic-installation-on-litespeed-server-through-softaculous/27864>\
**Category:** Mautic 4 Install/Upgrade Support\
**Tags:** community, discussion, development\
**Created:** [May 1, 2023, 3:30pm UTC](https://forum.mautic.org/t/mautic-installation-on-litespeed-server-through-softaculous/27864 "2023-05-01T15:30:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bgit-c](https://avatars.discourse-cdn.com/v4/letter/b/97f17d/32.png) [@bgit-c](https://forum.mautic.org/u/bgit-c)\
**Post date:** [May 1, 2023, 3:30pm UTC](https://forum.mautic.org/t/mautic-installation-on-litespeed-server-through-softaculous/27864/1 "2023-05-01T15:30:11Z")

</div>

Mautic Version 4.4.7  
My PHP version is : 8.0.28  
My Database type and version is: mysqlnd 8.0.28

**Installing Errors**

I am installing Mautic on a litespeed server through the Softaculous.

_Error 403 on a fresh install_

After installing Mautic, the log in page doesn’t open. It’s an error 403.

**My problem is** :

The installation isn’t in a sub-folder. It’s in a sub-domain.

Current solution is to comment out:

```
<FilesMatch "\.php$">
    Require all denied
</FilesMatch>

```

Or eliminate the entire section:

```auto
<IfModule authz_core_module>
    # Deny access via HTTP requests to all PHP files.
    <FilesMatch "\.php$">
        Require all denied
    </FilesMatch>

    # Deny access via HTTP requests to composer files.
    <FilesMatch "^(composer\.json|composer\.lock)$">
        Require all denied
    </FilesMatch>

    # Except those allowed below.
    <If "%{REQUEST_URI} =~ m#^/(index|index_dev|upgrade/upgrade)\.php#">
        Require all granted
    </If>
</IfModule>

```

The above code is meant for Apache 2.4+

As per my understanding, the code above is specific to Apache web servers and uses the “authz\_core\_module” module, which is part of the Apache server software.

LiteSpeed, on the other hand, is a separate web server software, and although it is compatible with Apache’s configuration files, it has its own set of modules and directives that it uses to configure access restrictions. This might explain why Mautic as a 403 error as a fresh install on litespeed servers through softaculous.

**Steps I have tried to fix the problem**

Here is what I have done/would suggest to mitigate the problem.  
Add a litespeed section/Eliminate the apache module on litespeed installs and replace it with litespeed compatible code.

Below are two code variations I have come up with that are litespeed compatible. Any of them should work. They are pretty much the same.

The straightforward version.

```auto
# Litespeed
<IfModule LiteSpeed>
    # Deny access via HTTP requests to all PHP files.
    RewriteRule \.php$ - [F]

    # Deny access via HTTP requests to composer files.
    RewriteRule ^(composer\.json|composer\.lock)$ - [F]

    # Except those allowed below.
    RewriteRule ^(index|index_dev|upgrade/upgrade)\.php$ - [L]
</IfModule>

```

The second is an alteration of the first.

```auto
# Litespeed server
RewriteEngine On
# Deny access via HTTP requests to all PHP files.
RewriteRule \.php$ - [F]

# Deny access via HTTP requests to composer files.
RewriteRule ^(composer\.json|composer\.lock)$ - [F]

# Except those allowed below.
RewriteCond %{REQUEST_URI} !/(index|index_dev|upgrade/upgrade)\.php$
RewriteRule ^ - [F]

```

Both of them should work in whichever approach.

They address the commenting out of code issue. Importantly, they maintain the intended purpose or function of the original code.

**The Result**

Mautic installation on litespeed will be more secure | No more 403 error on litespeed softaculous fresh installs | Litespeed code addition and removal of code causing the error on litespeed servers.

**How to reproduce this issue**

Install Mautic on a litespeed Server  
Install Mautic through softaculous on a litespeed server

I have tried installing Mautic on two different litespeed servers hosted by two different hosting providers and the result was the same. A 403 error on a fresh install.

**P.S.**

P.S. If I missed something please let me know. Also can this be added into future updates?

---

<div class="post-metadata">

**Author:** ![tornmarketing](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/tornmarketing/32/11603_2.png) [@tornmarketing](https://forum.mautic.org/u/tornmarketing)\
**Post date:** [May 2, 2023, 12:53am UTC](https://forum.mautic.org/t/mautic-installation-on-litespeed-server-through-softaculous/27864/2 "2023-05-02T00:53:49Z")

</div>

I would suggest not using Softaculous, its an absolute headache when it comes to updating at a later stage.

As for litespeed, the htaccess needs a tweak

I used cyberpanel a while back and it always had to have a tweak

> <https://github.com/mautic/mautic/issues/10913>
>
> \### Mautic Version
> 
> 4.2.x series
> 
> \### PHP version
> 
> 7.4.27
> 
> \### What brow…sers are you seeing the problem on?
> 
> Firefox, Chrome
> 
> \### What happened?
> 
> After performing an upgrade, the site reports an error 403, forbidden.
> 
> We upgrade via command line and clear cache and clean permissions as part of the process.
> 
> This maybe server specific, but this line in the HTACCESS
> 
> https://github.com/mautic/mautic/blob/4.2.0/.htaccess
> 
> \`\`\`
> \# Apache 2.4+
> \<IfModule authz\_core\_module\>
> # Deny access via HTTP requests to all PHP files.
> \<FilesMatch "\\.php$"\>
> Require all denied
> \</FilesMatch\>
> \`\`\`
> 
> Causes the issue, by commenting out
> 
> \`\`\`
> \<FilesMatch "\\.php$"\>
> Require all denied
> \</FilesMatch\>
> \`\`\`
> 
> The site loads again.
> 
> Prior to this verison 4.1.2 Worked with this in the htaccess file.
> 
> \### How can we reproduce this issue?
> 
> Server
> Ubunto 18.04.4 LTS
> Server API | FPM/FastCGI
> MariaDB
> 1:10.2.43+maria~bionic
> Apache
> 2.4.52-1+ubuntu18.04+1
> NGiNX
> 1.19.9-1+ubuntu18.04+1
> 
> Not sure if this is important, but we have mautic in a subfolder off the domain
> eg: domain.com/mautic/
> 
> \### Relevant log output
> 
> \`\`\`shell
> n/a
> \`\`\`
> 
> 
> \### Code of Conduct
> 
> \- \[X\] I confirm that I have read and agree to follow this project's Code of Conduct

Old notes but this is what I had on my upgrade procedure on htaccess  
– comment out (add # infront of line ~105 # Apache 2.4+) ‘Require all denied’

---

<div class="post-metadata">

**Author:** ![bgit-c](https://avatars.discourse-cdn.com/v4/letter/b/97f17d/32.png) [@bgit-c](https://forum.mautic.org/u/bgit-c)\
**Post date:** [May 2, 2023, 7:57am UTC](https://forum.mautic.org/t/mautic-installation-on-litespeed-server-through-softaculous/27864/3 "2023-05-02T07:57:26Z")

</div>

Thanks for your input.

I have dug a bit dipper into this and realized the authz\_core\_module can actually be understood by Litespeed.

But it’s execution has to be clear.

The current code uses regular expressions in the If statement to match the allowed PHP files. Regular expressions can be error-prone.

Prior to the if state, the code runs fine blocking access to all php files (Resulting to the 403 error)

The exception doesn’t work on Litespeed. The problem is the if statement.

---

<div class="post-metadata">

**Author:** ![Yosu\_Cadilla](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yosu_cadilla/32/6206_2.png) [@Yosu\_Cadilla](https://forum.mautic.org/u/Yosu_Cadilla)\
**Post date:** [May 2, 2023, 4:44pm UTC](https://forum.mautic.org/t/mautic-installation-on-litespeed-server-through-softaculous/27864/4 "2023-05-02T16:44:46Z")

</div>

Hi bgit,

You seem quite knowledgeable and tech savy, that is precisely why I would like to reiterate on the advice given by @tornmarketing a couple posts before.

Here’s a very old article I wrote about if some years ago, it is still very valid today:

> **[Please Stop Using Bitnami or Cpanel to Install Mautic | Mauteam.org](https://mauteam.org/opinion/please-stop-using-bitnami-or-cpanel-to-install-mautic/)**
>
> Please stop using Bitnami images and Cpanel / Softaculous as a quick shortcut to install Mautic. Mautic is still a young and rapidly evolving software with frequent releases that contain new features…
