Keep getting Nginx 403 Forbidden error when accessing a react js application - reactjs

please, I have a react js application that I want to deploy on my server (Centos 7), I have already generated the build and I have installed nginx on my server and I have created the folder www under /var/ where I have put the content of my build following the path : /var/www/merchant-dashboard/html.
and I have already allocated the 777 permissions for the www folder and all its subdirectories and files
I created my configuration file under /etc/nginx/conf.d and named it merchantDashboard.conf here is its content :
.
I have also set the permissions for the nginx user with the command
sudo chown -R nginx:nginx *.
(my user is called nginx) but I still get the 403 forbidden error.
Here is my error logs :
if someone can help me please

I followed this answer:
Why does Nginx return a 403 even though all permissions are set properly?
When I disabled SELinux it worked.
Following command from the above mentioned link solved the problem:
chcon -Rt httpd_sys_content_t /path/to/www

Related

Nginx React App - 403 Permissions Denied (only for some files)

I will start off with a note that I have looked through an excessive amount of questions that have already been asked.
I have set up a droplet on Digital Ocean and currently trying to configure my React application to run on it with nginx. It was running fine before I decided to remove my static files and replace it with another folder (instead of replacing file-by-file... damn).
My nginx configuration user is nginx and I believe I've set the correct permissions for all static data in the directory where it reads from. However, I still think the problem lies with permissions and hoping someone could help to figure out the problem.
Permissions on the directories
nginx.conf has the following set: user nginx;
nginx running processes with what users are running them:
root 23264 1 0 13:11 ? 00:00:00 nginx: master process /usr/sbin/nginx
nginx 23265 23264 0 13:11 ? 00:00:00 nginx: worker process
Maybe some directories/files are to remain 'chowned' to root?
This is also the network result from my browser:
It looks as if some files can be accessed but the js minified files cannot be?
Right, finally found the answer to my own question...
For anyone who faces the same issue, the following command on static folder inside grade-ui fixed it:
chmod -R +rx css

After deploying my site to Github pages, the URL has a serious problem I'm not sure how to fix

SEE UPDATE!!
I have tried to deploy my ReactJS page to Github, and the followed the rules to a tee.
Both from: https://facebook.github.io/create-react-app/docs/deployment
and
https://medium.freecodecamp.org/surge-vs-github-pages-deploying-a-create-react-app-project-c0ecbf317089
The error I get when doing the second, after many attempts at the first, is:
fatal: HttpRequestException encountered.
An error occurred while sending the request.
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': No error
what could be going on?
EDIT: ok now I have a site up, but the URL is myname.github.io/myname.github.io . How can I fix this?
https://facebook.github.io/create-react-app/docs/deployment#troubleshooting
taken from here:
try adding a new Personal Access Token:
git remote set-url origin https://<user>:<token>#github.com/<user>/<repo>
.
Try npm run deploy again
======= edit after seeing the addition on the original question.
So I thought it's a project page... But it's a github.io page. In that case, just push your app to master (the build/dist folder), move everything else (the source especially) to other branch if you want to clean up in master branch. More info: https://pages.github.com/
What you encountered https://yourname.github.io/yourproject is a project page, so if you're building a project, you can automatically add it into your main github page (your github.io).

SuiteCrm Install error

I´m installing suiteCrm version 7.10.2, license agree works fine, system check works fine but when i´m done with the database and sdmin config and hit next don´t appen anything. I check the console and get the ReferenceError: YAHOO is not defined
I´m installing in my domain and not locally.
In chrome console i get this error
install.php:14 GET https://www.digitalinput.pt/SuiteCRM-7.10.2/cache/include/javascript/sugar_grp1_yui.js?s=6.5.25&c= 404 (Not Found)
but the file exists and i add a 777 permission just to try and nothing changes!
Check your .htaccess file. I can see you are using a subdirectory so make sure you have
rewriteBase /SuiteCRM-7.10.2
That should fix the 404.
you need to give the 'cache' folder write access (Recursively)
if you have access to ssh, you can run this commmand on you terminal :
Note : you need to be in the crm folder path
chmod 0777 -R cache/
then you refresh the page back

Apache2 breaks after creating symlink in his subfolders

After installing apache2 im trying to create symlink from folder site-available to site-enabled. After it had been done apache2 just stops working. While trying to reload it it says "job for apache2.service failed". systemtlc in photos. What am I doing wrong?
Commend for symlink im using:
ln -s ../sites-available/010-dev.conf 010-dev.conf
I should also add that after creating the symlink, removing it doesnt fix apache. Even apache default site is still not loading, I have to reinstall apache.
systemtlc
Look at the apache's error log file (usually it is located under /var/log/httpd/error.log or /var/log/apache/error.log or something like that). It will have more info about the error.

running web2py with GoogleAppEngineLauncher

Trying to run my web2py app from the development server using GoogleAppEngineLauncher
Not sure if the on-line tutorials are out of date or I'm just missing something, but when I follow the link to download the GoogleAppEngine pythonSDK for OSX I get a dmg for the GoogleAppEngineLauncher.
I download and use that, which installs the proper executables, however after I setup my app.yaml file and run "dev_appserver.py myApp" I get this error:
fancy_urllib.InvalidCertificateException: Host appengine.google.com returned an invalid certificate (_ssl.c:503: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed):
I don't get the error if I try and launch the app from the launcher itself, however I can't launch the app because it says the directory already exists and I don't have write permissions. I even tried chmod 777 on the myApp directory.
Should I not be using the GoogleAppLauncher?
additionally I tried using the linux SDX and received the same "certificate" error. The error message directs me to a link mentioning that I need the "ssl" module, but that is included in python 2.7.2 which I am using.
The link also mentions: "appcfg uses SSL when connecting to the Admin Console by default, unless the --insecure flag is passed." But I cannot find that flag in the help menu.
Found this answer which solves the problem.
Basically:
rm google_appengine/lib/cacerts/cacerts.txt
From the SDK

Resources