1.99.6 can't save, communications error

436 views
Skip to first unread message

Lewis

unread,
Mar 4, 2012, 1:37:56 PM3/4/12
to web2py-users
Anyone else? Tried 3 different browsers and two machines. Tried
restarting apache and web2py. Still can't save. Not fatal, but it is
nice to use the web editor for little changes.

Thanks.

BTW: I am posting less not because I am working less, but because I
understand web2py better and everything is going very well.

Marin Pranjić

unread,
Mar 4, 2012, 1:42:32 PM3/4/12
to web...@googlegroups.com
Did you check permissions?

Lewis

unread,
Mar 4, 2012, 2:14:27 PM3/4/12
to web2py-users
Well, that might have been the problem so I changed permissions. But,
I still get communication error.

I gave the group in which web2py runs (www-data) rwx permissions to
the module file in question. Also, to the modules directory, the
specific application directory, and the web2py applications directory.

Still get communication error.

In general, what is the best advice for setting permissions? I
suspect I've done this badly with potentially risky permissions. As
of now I have:

folder web2py in /var, owner root, group www-data, perms = rwxrwxr-x
folder applications in web2py, ditto all
folder thisapp in applications, ditto all
folder modules, controllers, views in thisapp, ditto all
file default.py in controllers, owner root, group www-data, perms = rw-
rwxr--

This all seems a bit too permissive. For example, owner should not be
root. Assuming I change owner to another user in sudousers, are the
rest of the permissions appropriate?

Thanks!

Marin Pranjić

unread,
Mar 4, 2012, 5:31:40 PM3/4/12
to web...@googlegroups.com
I'm not sure about permissions, I keep default ones for development.

I cannot reproduce your problem on ubuntu + rocket.
I tried with the latest trunk and with 1.99.6. Works for me.
I suggest copying your web2py folder, setting 777 permissions to web2py_copy (and all subfolders) and then try running a copy and editing via web editor.
Not sure what else can be wrong, every time i got communication error it was either problem with permissions or my admin session expired

Marin

LightDot

unread,
Mar 4, 2012, 9:50:24 PM3/4/12
to web...@googlegroups.com
Are you using apache with mod_wsgi? And your mod_wsgi group is www-data? How about the mod_wsgi user, also www-data or some app specific user? Perhaps you could post the relevant parts of your apache vhost configuration?

Having root as file/directory owner is not permissive. That's restrictive... This means that only the root user would be able to read/write/execute them, not that they are being run as user root. In your case, you're giving quite a lot of power to the www-data group, that's the only reason this set up works at all. Otherwise apache would error out.

Regards

p.s.
Just one remark - you don't need to have executable rights on any web2py files that are run by apache. You need them on directories, but not on the files. So your default.py should really be rw-rw-r--. So only rw, never rwx. But that's not the cause of the problem.

davidjensen

unread,
Jul 16, 2012, 4:19:19 AM7/16/12
to web...@googlegroups.com
the configuration is web2py self install on ubuntu server


# changes user and group owners to www-data, not root
# because files copied in are root and must be www-data
# find uid, gid  by os.lstat
# os.lchown does not work in windows
def run():
    import os
    uid = 33
    gid = 33
    the_path = os.getcwd()
    all_files = os.listdir(the_path)
    for the_file in all_files:
        os.lchown(the_file, uid, gid)

___________________________________________
Reply all
Reply to author
Forward
0 new messages