Basic Frappe Framework installation fails

Hi,

I have tried to follow this guides to install Erpnext on a VM, following the Oficial Guide for installation on Centos 7.

The scenario was set on:
Centos 7 : 3.10.0-327.28.3.el7.x86_64
Minimal installation.

Steps:

yum install vim wget ntp telnet open-vm-tools -y
yum (upgrade or update) -y

–To disable firewall

sudo vim /etc/sysconfig/selinux

Content of file Selinux:

/* This file controls the state of SELinux on the system.
SELINUX= can take one of these three values:
enforcing - SELinux security policy is enforced.
permissive - SELinux prints warnings instead of enforcing.
disabled - No SELinux policy is loaded. */

SELINUX=disabled

/* SELINUXTYPE= can take one of three two values:
targeted - Targeted processes are protected,
minimum - Modification of targeted policy. Only selected processes are protected.
mls - Multi Level Security protection.*/

SELINUXTYPE=targeted

-End of file content

Restartart

init 6

Run command:

su -
mkdir /opt/erpnext
cd /opt/erpnext
wget https://raw.githubusercontent.com/frappe/bench/master/install_scripts/setup_frappe.sh
bash setup_frappe.sh --setup-production

bash setup_frappe.sh --setup-production
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
Adding frappe user
Installing frappe-bench

Setting up first site:

usermod -aG wheel frappe

Setup Site:

su frappe
cd ~/frappe-bench
mv sites/site1.local mysite.domain
bench --site mysite.domain install-app erpnext
sudo bench setup production frappe
exit
(Set to Y on every question)

Remove user from root group

sudo usermod -G “” frappe

I found problems running the Nginx service the /home/frappe/frappe-bench/config/nginx.conf was set as a symlink on the path /etc/nginx/conf.d/ and linked as frappe-bench.conf and on the main Nginx configuration directive, it was set the include conf.d/*.conf, when I tried to start the web service it failed, the reason I found out is that the Nginx was having issues with configs from symlink.

When issuing the command: nginx -t, everything run fine, but if It was run as a normal service it show up with an error like:

→ nginx: [emerg] open() “/etc/nginx/conf.d/frappe-bench.conf” failed (13: Permission denied) in /etc/nginx/nginx.conf:20
→ nginx[5657]: nginx: configuration file /etc/nginx/nginx.conf test failed
—>nginx.service: control process exited, code=exited status=1
→ systemd[1]: Failed to start The nginx HTTP and reverse proxy server.

So I did some modifications and copied the frappe-bench.conf symlinked to frappe.conf with root as owner:

cd /etc/nginx/conf.d/
ls -ls
frappe-bench.conf (symlink file)
cp frappe-bench.conf frappe.conf
rm frappe-bench.conf

Restart Nginx service:

service nginx start (I start the service since it was not started due to many failed attempts)

Whe running the <command journalctl -xe>:

– Unit nginx.service has begun starting up.
systemd[1]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
systemd[1]: nginx: configuration file /etc/nginx/nginx.conf test is successful
systemd[1]: Failed to read PID from file /run/nginx.pid: Invalid argument
systemd[1]: Started The nginx HTTP and reverse proxy server.
– Subject: Unit nginx.service has finished start-up
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Run command to verify <netstat -nlt

Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:81 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:11000 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:12000 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:9000 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:13000 0.0.0.0:* LISTEN
tcp6 0 0 :::3306 :::* LISTEN
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 ::1:25 :::* LISTEN

The port 80 and 81 were set for company.com and company2.com for test purpose.

Keep also in mind that Centos has a serius problems with its “systemctl” service, in order to run and create services, that is why you should run the < yum upgrade -y> command after installation.

Some of the procedures were taken from

Note:
By the time I was trying to setup the Erpnext solution and tried to access to http://company1.com:80 or http://company2.com it shows up a “403 Forbidden”. Trying to figure out what is happening.

1 Like