Changing admin password

526 views
Skip to first unread message

Ian W. Scott

unread,
Feb 16, 2017, 11:29:11 AM2/16/17
to web2py-users
I seem to have forgotten the admin password for my web2py installation, so I need to change it. Looking at posts here, the recommendation was:

1 - stop apache server
2 - restart web2py
3 - enter new password 
4 - restart apache server

I'm getting stuck at 2. The only way I know how to "restart" web2py is to run web2py.py from the base web2py directory. But when I do that I get web2py running on the rocket server. I can change the admin password for the rocket server session, but when I stop the rocket server and restart apache the new password I entered doesn't work.

The other command someone recommended here to "restart web2py" was 'python web2py'. But when I just run that command from my home directory I get this error:

/usr/bin/python: can't find '__main__' module in 'web2py'

I'm really confused.

Richard Vézina

unread,
Feb 16, 2017, 11:46:44 AM2/16/17
to web2py-users
Hello Ian,

Not sure I understand your exact problem, but you can reset admin password like this :

sudo -u www-data python -c "from gluon.main import save_password; save_password('123456',443)"

Where 123456 is you pass phrase.

443 is the port for which the password apply

This will create parameters_443.py file that you drop/replace in the web2py/ folder and then restart web2py instance and the new generated password should work.

Richard

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ian W. Scott

unread,
Feb 16, 2017, 1:13:07 PM2/16/17
to web2py-users
Alright, thanks Richard. I'm still fuzzy about the last part where you say I should "restart the web2py instance." I thought that apache simply provided access to web2py. I've never had to do anything to start a "web2py instance." So what is the "web2py instance" and how do I restart it?

Thanks,

Ian
Richard

To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.

Ian W. Scott

unread,
Feb 16, 2017, 1:20:07 PM2/16/17
to web2py-users
Also, in the command you give above, what is the "www-data" argument? Is that the path to the directory set up in apache to hold web content?

I appreciate your help with these very basic questions. As you can tell, I'm stuck trying to run a server without any experience or training. So when things go properly I'm okay, but I don't understand anything under the hood.

Ian

On Thursday, February 16, 2017 at 11:46:44 AM UTC-5, Richard wrote:
Richard

To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.

Ian W. Scott

unread,
Feb 16, 2017, 1:34:02 PM2/16/17
to web2py-users
Never mind. I figured it out. "www-data" is the user name for the home/ directory holding my web2py data. I'm still not sure about "restarting a web2py instance" but I restarted apache and the new password worked.

Thanks a lot for your help!

Ian

On Thursday, February 16, 2017 at 11:46:44 AM UTC-5, Richard wrote:
Richard

To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.

Richard Vézina

unread,
Feb 16, 2017, 2:26:03 PM2/16/17
to web2py-users
Yeah it depends how things are configured, for instance I need to start uwsgi service in order to allow web2py to work, just start/restart nginx is not controlling web2py instance... Also you mention about rocket server, so I am a bit puzzled on how your server is configured...

But, replacing (with the new generated one) the parameters.py file that you have in the web2py/ directory should allow you to access you the web2py admin app... If it not working with restarting apache service restart your computer and cross your finger :)

Good luck

Richard



To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages