Closed chegmarco1989 closed 2 years ago
This sounds like a config issue in your environment not the package itself. Please double check that your Nginx/Apache config is correct and that the USER the web server is running as has permission to the folders you're running the app from.
you can check this with
ls -al
on your web server, it will list the user and group that has permission to the folder, as well as relevant permissions. You'll see something like this:
If you see that the files aren't owned by the appropriate user (usually www-data on most Linus distress) you can use the chmod command to correct this.
Thank you @ajnozari for your reply. But here is the result of my screenshot when I do ls -al
in the public_html
directory:
So where is the error (403 Forbidden You don't have permission to access this resource) preventing normal from my site according to you ???
And how to fix it to make my site work normally ???
It's a puzzle for me. I really need help.
That "error" is not coming from my package/demo at all. It seems your apache/nginx is not operating under the proper permissions to access your webservers files. As noted above, you should probably check both the webserver itself, and the directories/permissions to ensure the proper user/group and read/write access permissions. It is typical to use a www-data
group your webserver runs as. Example docker setup:
COPY --chown=www-data:www-data . /var/www/html
RUN find /var/www/html -type f -exec chmod 644 {} \;
RUN find /var/www/html -type d -exec chmod 755 {} \;
Closed due to environment issue not package issue
Just to add a note, your document root is pointing to the main public_html
directory, meaning your .env
file, among other things, are exposed. Your webservers root should serve from the public
directory where the index.php
files is located. All web traffic is directed through there, and should never have access to your leading project directory.
Notice the "site" that is viewable through Your Public Directory should be where your webserver is always pointed as the root directory.
https://laravel.com/docs/8.x/structure#the-public-directory https://laravel.com/docs/8.x/installation#directory-configuration
Obviously there is a problem on the system configuration side but there is also and above all a problem with the DEMO page because finally, I discovered that the link works here: https://msg.worklx.com/public/index.php.
But, impossible to access it directly via: https://msg.worklx.com.
So the question is: _Why is the web app in a sub folder under root named ‘public’ and not simply under publichtml - or am I missing something obvious.
So what do you advise me to do about it to finally allow direct access via https://msg.worklx.com/ instead of https://msg.worklx.com/public/index.php ???
Notice the "site" that is viewable through Your Public Directory should be where your webserver is always pointed as the root directory.
So, how to fix it very easily because I don't understand what you mean ???
Should I create a new "public" directory in the WebServer root, Web Application files in "public_html" and save them in the new newly created "public" directory in the WebServer root ???
For apache, you typically need to instruct the virtual host to point to the var/www/public_html/public
, eg:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/public_html/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
https://www.interserver.net/tips/kb/deploy-laravel-project-apache-ubuntu/
Hi.
Unable to connect to my site (https://msg.worklx.com/) Laravel, I get the error: Forbidden You don’t have permission to access this resource.
IMPORTANT: I specify that I cloned and indeed installed via "composer" all the dependencies of the Demo Version of RTippin/messenger (https://github.com/RTippin/messenger-demo) and even installed the components of the Demo in question via
php artisan demo:install
.So how to fix it ??? I really need your help.