Thank you for your reply. But it is because I had deleted all the files from the site to reinstall that you did not notice the error. Please try again, you will find that it is impossible to access it and that the error Forbidden You don’t have permission to access this resource appears when you connect to the URL in question : https://msg.mydomain.com/.
Knowing as I said previously that the “public” directory contains a .htaccess file whose content is as follows:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
How then to correct this error to succeed in making my site work ???
IMPORTANT:I specify that my web application is based on Laravel version 8.42.
Then I would guess that your php settings are incorrect. Go to your virtual server, then to Server Settings / php options and see what the php execution mode is set to.
Be aware that I have other PHP - Laravel sites that are under other subdomains that work well. But, it is only this one that poses the problem of: Forbidden You don’t have permission to access this resource.
The .htaccess file in question is not in the root directory of the site but rather in a “public” folder. Otherwise, there is no .htaccess file in the base directory of the site.
But if it’s good for you, can I see the screenshot from your side ??? What does it show on your side when you log in to: https://msg.mydomain.com/ ???
Isn’t the same error (Forbidden You don’t have permission to access this resource) showing up ???
You don't have permission to access this resource.
So something is completely blocking access to it. I’ve seen that happen with improperly written htaccess files in the public_html folder many times before.
I took the liberty of adding index.php to the address and get this:
404 Not Found
Not Found
The requested URL was not found on this server.
So you’ve got something wrong for sure. It appears that you have nothing in the public_html folder that can actually be processed, hence the 403 forbidden error. And there is no index.php landing page left either, so there’s the 404 error.
Virtualmin is working fine. Something you’re using in it is not.
I changed DocumentRoot /home/mydomain/domains/msg.mydomain.com/public_html to DocumentRoot /home/mydomain/domains/msg.mydomain.com/public_html/public then restart Apache via: sudo service apache2 restart.
And when I try to connect again to https://msg.mydomain.com via my web browser, I still get the same error 403 Forbidden You don’t have permission to access this resource.
So why does https://msg.mydomain.com keep returning the same error and therefore not working despite changing the DocumentRoot ???
Because whatever you did didn’t change the path. You’re still going to public_html and not public_html/public.
Try this: Go to the Virtual Server in question. Then click on Services (right below the disable and delete tab) Then click on Configure Website.
Down towards the bottom you should see the path to the directories for the site listed. The first should be the path to your public_html directory. Below that is a cgi bin path, then stats, etc.
They should be blue. Go ahead and click on the path that ends with public_html and add /public to the end of it and then click save.
Can’t suggest only knowing public should be set to a good docroot with laravel but no experience so search the web.
If you have experience with it you write others are working , is that on same box?
Can’t help but if you have solution post it here for others.
Maybe this helps: ??
Website documents sub-directory
This field allows you to change a virtual server’s sub-directory that contains web content from the default ofpublic_html. This can be useful if you have created content or scripts in a directory underpublic_htmland want to make it visible to users accessing your website’s top-level URL.
Under that server then > server configuration > website options
On most platforms Apache must be built with suexec_docroot set to /home. This requires a recompile of Apache, unless an apache2-suexec-custom. We provide packages for the most popular operating systems in our GPL repositories at http://software.virtualmin.com/gpl/ . For other systems, you will need to download a source package from your OS vendor and rebuild it with the necessary change.
On Debian and Ubuntu systems, you can instead use the apache2-suexec-custom package. This option requires no rebuild of Apache. Configuring the custom suexec package is performed in /etc/apache2/suexec/www-data, and is as simple as changing the first line from /var/www to /home.
If installing on Ubuntu, you’ll need to edit /etc/apache2/conf.d/php5.conf, and comment out the two SetHandler lines.
That has to be a problem with the Laravel software.
Are you sure you have restarted Apache after doing all of this? If you have, about the only other thing I can think of trying on the Virtualmin side is adding a redirect.
You do that on the same Server Configuration tab, down at the bottom where it says Website Redirects.
What you’ll do is hit the add redirect button. Then in the source url path you’ll put your https://msg.example.tld