I have read that before posting, but the answer there was: âYou can use apache in front of Default nginx of ErpNext. Just proxypass all your requests from apache to nginxâ.
I cannot even start nginx⌠if I would be able to start nginx, I could do that. The problem is that the ERPNext installer tries to launch nginx and since nginx cannot be started, installer exists.
There can be several configuration files involved. Check the following:
/etc/nginx/nginx.conf
/etc/nginx/conf.d/default.conf (you already mentioned this one).
/etc/nginx/sites-enabled/* (may be empty)
I just completed 2 installations over the weekend, so itâs all pretty fresh in my mind. I didnât have another web server (like Apache) previously installed, though.
It may be easier to shutdown Apache temporarily. Let ERPNext finish its installation. Then modify Nginx, change ports, and bring Apache back online.
ERPNext installation sometimes makes a lot of assumptions about what you do/donât want.
I donât have sites-enabled folder. Host and port is only available in default.conf file.
I could do what you suggested, however, I cannot have Apache off line for long time so I need to be sure it it will work.
I changed port in default.conf and try to manually start nginx but it still tries to use port 80.
However, I think starting nginx is the last step in the ERPNext installation so I guess ERPNext files are already fully installed. Where are ERPNext pages installed so that I can configure Apache to point to that folder?
Sure itâs possible to use different components of the tech stack in general but that does mean it will be easy to swap.
In this case you should change the nginx config file under frappe-bench folder to change the port there and then reload nginx
Probably a good idea to look at the owner of that path. It may not have the correct ownership due to your manipulating the installation. It might be as simple as a âchownâ command to get it right.
I have compared my nginx conf files with another server nginx conf files, where erpnext does work, and I made them almost the same. Only changed site name parameter.
With that, the site is being reached and shows the error I told you.
The interesting thing I found is that I have run âsudo netstat -plntâ command in the other server, and I discover that nginx is listening on port 80 and python (???) on port 8000.
In my case, port 80 is taken by Apache, so I cannot use it, so I have used 8000.
That way, nginx is listening on port 8000 and upstream erpnext-frappe also on port 8000. So I think server enters a infinite recursion. That might be why the âToo many filesâ error.
The question of million dollars is, what is the âpythonâ process that is listening on port 8000 in the server where erpnext does work?
I think if I emulate the environment, I could solve this, for example, if I define
upstream erpnext-frappe {
server 127.0.0.1:8001 fail_timeout=0;
}
in nginx conf file and leave nginx listening on port 8000.
So the problem is now to know what âpythonâ process is and how can I start it in my server to start listening on port 8001.
I did not want to fight against the current anymore. So I have set nginx to listen on port 8020 and then reboot the server.
That way, I allowed python to start listening on port 8000. In this case, both nginx and python were started.
The last step was to configure the proxy pass in Apache to be able to connect remotely without using the port and voilà ⌠at last erp next is running.