Installation fail on centos 6

Hello

I try to install erpnext on centos 6.x minimal (OpenVZ VPS)
Before install I have update the VPS to lastest version by #yum update
then execute the installation command and ran into this problem

[root@erp ~]# sudo bash setup_frappe.sh --setup-production
Installing for centos 6 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
Installing supervisor
Starting supervisord:
Configuring CentOS services
Starting services
Adding frappe user
Installing frappe-bench
Setting up first site
Restarted supervisord
nginx: [emerg] unknown directive "proxy_http_version" in /etc/nginx/conf.d/frappe.conf:40
nginx: configuration file /etc/nginx/nginx.conf test failed
Traceback (most recent call last):
  File "/usr/bin/bench", line 9, in <module>
    load_entry_point('bench==0.92', 'console_scripts', 'bench')()
  File "/home/frappe/bench-repo/bench/cli.py", line 60, in cli
    bench()
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/bench-repo/bench/cli.py", line 456, in setup_production
    _setup_production(user=user)
  File "/home/frappe/bench-repo/bench/production_setup.py", line 67, in setup_production
    restart_service('nginx')
  File "/home/frappe/bench-repo/bench/production_setup.py", line 11, in restart_service
    exec_cmd("{service_manager} {service} restart ".format(service_manager='service', service=service))
  File "/home/frappe/bench-repo/bench/utils.py", line 104, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: service nginx restart

Please Advice

Thank you in advance
Nont

@hostatom your nginx probably not installed correctly.
Remove nginx completely first then try running bench setup nginx command

Step 1. Stop nginx

service nginx stop

Step 2. Remove package

yum remove nginx

Step 3. To uninstall Nginx from source

rm -rf /usr/sbin/nginx
rm -rf /etc/nginx
rm -rf /etc/init.d/nginx

Step 4. Setup nginx using bench command (assuming your setup_frappe.sh worked correctly and installed bench on your system, if not then reload OS and start again fresh)

bench setup nginx
sudo ln -s `pwd`/config/nginx.conf /etc/nginx/conf.d/frappe.conf

Optionally, you will able to install new site for frappe and ERPNext
Follow manual setup instructions available here: https://github.com/frappe/bench#setting-up-erpnext and https://github.com/frappe/bench/wiki/Multitenant-Setup

It seems that the ngnix conf is not compatible with your nginx version. You should update nginx (they’ve repositories that provide the latest versions) and try sudo service nginx reload

Also, if this is a fresh install, I’d suggest installing CentOS 7

Thank you for your help I have the success installation with ubuntu on another thread

I met a couple of errors during installation on VPS centos 6.7 minnimal from openvz template

I think the error is all from ISO template from openvz

First - multilib error
solve by

yum remove libselinux-2.0.94-5.3.el6_4.1.i686 libcom_err-1.41.12-18.el6.i686 libxml2-2.7.6-14.el6.i686

Second - Port 80 conflict (I dont know why there is apache pre-installed on minimal package)

Solve by
yum remove httpd

Third - nginx error
Not yet know how to resolve but will try a method from @yashodhan

If it fail again I will continue on centos 7

Thanks alot

I was not able to resolve the issue with this. Getting below error.

Traceback (most recent call last):
  File "/usr/bin/bench", line 9, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/frappe/bench-repo/bench/cli.py", line 60, in cli
    bench()
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 1057, in invoke
    Command.invoke(self, ctx)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/bench-repo/bench/cli.py", line 151, in bench
    setup_logging(bench=bench)
  File "/home/frappe/bench-repo/bench/utils.py", line 237, in setup_logging
    hdlr = logging.FileHandler(log_file)
  File "/usr/lib64/python2.7/logging/__init__.py", line 911, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib64/python2.7/logging/__init__.py", line 941, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: '/home/frappe/frappe-bench/logs/bench.log'