Error Installing on CentOS7

I got this error while installing on CentOS7:

Installing for centos 7 amd64
In case you encounter an error, you can post on https://discuss.frappe.io

Adding centos mariadb repo
Installing packages for centos. This might take time…
Installing wkhtmltopdf
Configuring CentOS services
Starting services
Job for nginx.service failed because the control process exited with error code. See “systemctl status nginx.service” and “journalctl -xe” for details.

Just to check.
Is this a fresh install CentOS 7 and EPEL or do you have existing web sites/servers installed?

@System19 I have the totally same problem just like Jeff. I am using a fresh CentOS AWS image and the easy install script to install.

type command systemctl status nginx.service will show below messages.

Mar 11 02:51:29 ip-172-31-29-174 systemd[1]: Starting The nginx HTTP and reverse proxy server...
Mar 11 02:51:29 ip-172-31-29-174 nginx[22290]: nginx: [emerg] open() "/etc/nginx/conf.d/frappe.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:43
Mar 11 02:51:29 ip-172-31-29-174 nginx[22290]: nginx: configuration file /etc/nginx/nginx.conf test failed
Mar 11 02:51:29 ip-172-31-29-174 systemd[1]: nginx.service: control process exited, code=exited status=1
Mar 11 02:51:29 ip-172-31-29-174 systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
Mar 11 02:51:29 ip-172-31-29-174 systemd[1]: Unit nginx.service entered failed state.
Mar 11 02:51:29 ip-172-31-29-174 systemd[1]: nginx.service failed.

How should I fix this problem? Thanks.

Do you have SELinux installed?
If so disable it as per instructions here.

Or set selinux from enforcing to permissive.
Then
sudo service nginx restart

Someone else on the forum did this to resolve the issue:
We finally found it. It was needed to edit the file /etc/nginx/nginx.conf
Line 5, user was set to ‘nginx’, has to be set to the user that performed the installation, in our case ‘frappe’

Thank you.
After setting SELinux to permissive I can install Erpnext successfully. But I cannot login. To solve the login problem need to revise the /etc/nginx.conf just like you said. The user needs to be the user who performed the installation.

But I can only login with Edge browser. I cannot login on Firefox and Chrome. And in fact I cannot do most of the operation in Edge after I logged in. The window just stop responding…

Hi @betula, Maybe try this:

sudo nano /etc/nginx/nginx.conf

change user to frappe
(The user info might be located at line 35)
Save and Exit nginx.conf file

sudo service nginx reload
sudo supervisorctl reload

If you get log errors you could try this:
sudo chown -R frappe /var/log/nginx/
sudo service nginx reload
sudo supervisorctl reload

Hope this helps.

Hi @System19
Thanks for responding.
After checking there is no user "frappe "in my system. So I use useradd command to create user “frappe.” But I got error when execute sudo service nginx reload
So I executed sudo chown -R frappe /var/log/nginx/
Unfortunately I still got the same error when executing sudo service nginx reload
The error message is

Job for nginx.service invalid.

I am not sure how to solve this problem. It seems only user “centos” can let me login(with problems…)

Sorry am a bit lost? When running the simple install method it should create a user account frappe. If possible start a clean install with only: Centos 7 minimal and EPEL with all latest updates. No SELinux if possible.
At root ~/

wget https://raw.githubusercontent.com/frappe/bench/master/install_scripts/setup_frappe.sh

then once complete run

sudo bash setup_frappe.sh --setup-production

This should work.

Yes I am using the scripts you posted to install Erpnext. I am not sure if the OS is CentOS 7 minimal though. I use the CentOS 7 image provide in AWS Marketplace show as below link.

And I installed the program in the default user “centos” of this AWS AMI image(/home/centos). Is installation folder must be under root ~/ ? Thanks.

BTW, SELinux is set to permissive before installation.