ERPNext 4 Installation Problem

On Sun, Sep 28, 2014 at 8:12 PM, Peter Schmidler
pe...@gmail.com wrote:

Hi Pratik,

Am 28.09.2014 um 14:45 schrieb Pratik Vyas pd...@gmail.com:

What’s in the nginx logs (/var/logs/nginx/)? If you get permission error, try

chmod o+x /home/frappe
chmod g+x /home/frappe

I tried these commands and only the bin 404 disappeared.

Here’s my Ngnix error log.

2014/09/28 08:17:56 [emerg] 12854#0: a duplicate default server for 0.0.0.0:80 i - Pastebin.com

Thanks!

PS

I see that your bench is in /root

It should be in /home/frappe owned by frappe user.

What is the output of which bench ?


Pratik
erpnext

What is the output of which bench ?

/usr/local/bin/bench

  1. Please be kind and don’t send large attachments
  2. For issues, features requests use Issues · frappe/erpnext · GitHub

You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/88FEEE8E-3F71-45B3-8E1A-7EF8C8914057%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

So the first thing I would do on a fresh ubuntu box would be to cretae a frappe user, right?

Am 28.09.2014 um 14:45 schrieb Pratik Vyas pd...@gmail.com:

Hi Peter,

Replies inline…

  1. Is there a better/more secure way than doing the installation as root?

Things that happen as root,

  • Installation of packages (almost everything in setup_frappe.sh)
  • linking of supervisor and nginx configs
  • setting up of sudoers file to make restart of supervisor process passwordless
  1. Is the step “sudo bench setup sudoers $(whoami)” necessary, the sudo be
    stripped, too, right?

Basically, this and only this bench command should be run as
superuser. It creates a sudoers file that makes sudo supervisorctl restart frappe: command passwordless.

  1. After the installation I see the login page but the files in the “lib”
    and “assets” folders return 404s.

What’s in the nginx logs (/var/logs/nginx/)? If you get permission error, try

chmod o+x /home/frappe
chmod g+x /home/frappe

All bench commands (except sudoers one) are to be run as frappe user
and not root or using sudo.

Thanks,

Pratik
erpnext

  1. Please be kind and don’t send large attachments
  2. For issues, features requests use Issues · frappe/erpnext · GitHub

You received this message because you are subscribed to a topic in the Google Groups “ERPNext Developer Forum” group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/erpnext-developer-forum/Wc9gUbKzMwg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to erpnext-developer-forum+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAG8U0Ek-dzx9SHv-jcY_qFET%3Dk_0tfYpGUvE9krv%2BLSxxeDcBA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

  1. Please be kind and don’t send large attachments
  2. For issues, features requests use Issues · frappe/erpnext · GitHub

You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/0172B7B8-5665-4B32-98DE-D54C890296C6%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

So this is my new setup instructions.
Will refine and try again on a fresh box, tomorrow.

	* wget https://raw.githubusercontent.com/frappe/bench/master/install_scripts/setup_frappe.sh
	* bash setup_frappe.sh # if sudo no frappe user will be created
	* # give frappe user a password and switch to frappe user
	* cd ~
	* bench init frappe-bench
	* cd frappe-bench
	* bench get-app erpnext https://github.com/frappe/erpnext
	* bench new-site site1.local
	* bench frappe --install_app erpnext site1.local
	* bench setup supervisor
	* sudo ln -s `pwd`/config/supervisor.conf /etc/supervisor/conf.d/frappe.conf
	* supervisorctl reload # new
	* sudo bench setup sudoers $(whoami)
	* bench setup nginx
	* sudo ln -s `pwd`/config/nginx.conf /etc/nginx/conf.d/frappe.conf
	* rm /etc/nginx/sites-available/default  # new
	* service nginx reload # new

Am 28.09.2014 um 16:53 schrieb Pratik Vyas pd...@gmail.com:

On Sun, Sep 28, 2014 at 8:12 PM, Peter Schmidler
pe...@gmail.com wrote:

Hi Pratik,

Am 28.09.2014 um 14:45 schrieb Pratik Vyas pd...@gmail.com:

What’s in the nginx logs (/var/logs/nginx/)? If you get permission error, try

chmod o+x /home/frappe
chmod g+x /home/frappe

I tried these commands and only the bin 404 disappeared.

Here’s my Ngnix error log.

2014/09/28 08:17:56 [emerg] 12854#0: a duplicate default server for 0.0.0.0:80 i - Pastebin.com

Thanks!

PS

I see that your bench is in /root

It should be in /home/frappe owned by frappe user.

What is the output of which bench ?


Pratik
erpnext

  1. Please be kind and don’t send large attachments
  2. For issues, features requests use Issues · frappe/erpnext · GitHub

You received this message because you are subscribed to a topic in the Google Groups “ERPNext Developer Forum” group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/erpnext-developer-forum/Wc9gUbKzMwg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to erpnext-developer-forum+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAG8U0E%3DswK2GLGs%2BKgeV%3DJvpWPF0MiaVKDyiENqutbOQwqnVNg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

  1. Please be kind and don’t send large attachments
  2. For issues, features requests use Issues · frappe/erpnext · GitHub

You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/9EAED3FE-229E-4B97-A813-F7ED1843CF25%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

On Sun, Sep 28, 2014 at 8:42 PM, Peter Schmidler
pe...@gmail.com wrote:

So this is my new setup instructions.
Will refine and try again on a fresh box, tomorrow.

            * wget https://raw.githubusercontent.com/frappe/bench/master/install_scripts/setup_frappe.sh
            * bash setup_frappe.sh # if sudo no frappe user will be created
            * # give frappe user a password and switch to frappe user
            * cd ~
            * bench init frappe-bench
            * cd frappe-bench
            * bench get-app erpnext https://github.com/frappe/erpnext
            * bench new-site site1.local
            * bench frappe --install_app erpnext site1.local
            * bench setup supervisor
            * sudo ln -s `pwd`/config/supervisor.conf /etc/supervisor/conf.d/frappe.conf
            * supervisorctl reload # new
            * sudo bench setup sudoers $(whoami)
            * bench setup nginx
            * sudo ln -s `pwd`/config/nginx.conf /etc/nginx/conf.d/frappe.conf
            * rm /etc/nginx/sites-available/default  # new
            * service nginx reload # new

Great, was about to suggest starting afresh.

Also, updating your instructions,

As root,

            * wget

https://raw.githubusercontent.com/frappe/bench/master/install_scripts/setup_frappe.sh
* bash setup_frappe.sh # if sudo no frappe user will be created
* # give frappe user a password and switch to frappe user

As frappe,

            * cd ~
            * bench init frappe-bench
            * cd frappe-bench
            * bench get-app erpnext https://github.com/frappe/erpnext
            * bench new-site site1.local
            * bench frappe --install_app erpnext site1.local
            * bench setup supervisor
            * bench setup nginx

Switch to root,

            * cd /home/frappe/frappe-bench &&  bench setup sudoers frappe
            * sudo ln -s `pwd`/config/nginx.conf

/etc/nginx/conf.d/frappe.conf
* sudo ln -s pwd/config/supervisor.conf
/etc/supervisor/conf.d/frappe.
conf
* rm /etc/nginx/sites-available/default # new
* supervisorctl reload # new
* service nginx reload # new

Looks good ?


Pratik
erpnext

1 Like

Cool, thanks Pratnik! It worked flawlessly!

  1. Please be kind and don’t send large attachments
  2. For issues, features requests use Issues · frappe/erpnext · GitHub

You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/17ED9909-BE80-4CD0-AEED-EDF3341CB035%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

This is great. This works perfectly fine with Digital Ocean Ubuntu 14+ Server.

One thing I want to add is, it still needs “bench start” command for the first time.

It’s good to run it to test but is not a requirement.

Hey @peterschmidler,
Can you submit the steps to the wiki? Maybe also on digital ocean’s wiki too…

Yes I will, as soon as I’ll have my setup completed. BTW great to see that you switched to Discuss!Did you migrate all data from Google Groups?Bst, PS

Thanks! :slight_smile:
Yes we migrated from google groups.
Wasn’t very straight forward, will post a blog.

Hi,
just noticed https://github.com/frappe/bench/issues/12Isn’t it as simple as https://github.com/frappe/bench/blob/master/install_scripts/setup_frappe.sh#L84for ubuntu, too?
Bst, Max

Yes, install libxrender, fontconfig and the deb package.

Can you please help me out with the unix commands to install wkhtmltopdf?
Should I install it as root or frappe user?

Hi,

some more questions to finish the setup on DO,
and to be able to publish the instructions.

1. Multi-tenant-setup ngnix issue

I named my two sites site1.local and site2.local.

su frappe
cd ~/frappe-bench
bench set-default-site site1.local
bench config dns_multitenant on
bench new-site site2.local
bench set-nginx-port site1.local 80
bench set-nginx-port site2.local 82
bench setup nginx

This all worked fine but …

sudo nginx reload

… gives me this error …

Sorry, user frappe is not allowed to execute '/usr/sbin/nginx reload' as root on ...

2. DNS setup question

Since I named my sites site1.local and site2.local and I don’t know how to rename the apps )if possible at all), I would like to point two different subdomains to the ports 80 and 82 via ngnix. Is there an easy “bench” way to achieve this?

Thanks,

PS

Install the debian package from wkhtmltopdf using

dpkg -i packagename.deb #as root

If it complains of any deps not installed,

apt-get install libxrender fontconfig #as root

I am on Unbuntu 14.04 64bit. Should I still use the Debian package?

I meant the deb package for Ubuntu (your distro). This one, wkhtmltopdf - Browse Files at SourceForge.net

Hey, thanks! But I had to wget wkhtmltopdf - Browse Files at SourceForge.net first. I’ll put it on my list and publish it soon.

Thanks for sharing such a valuable information. I really like it a lot. keep posting such topics further also. www.simpalm.com