Fresh in the morning, i reinstall web2py from Web2Py webpage to my home directory ( /home/pi) and run the following:
sudo python2.6 web2py.py
I can start server at 127.0.0.1 (localhost) but not my public IP. It encountered an error:
ERROR:Rocket.Errors.Port8000:Socket 10.0.0.189:8000 in use by other process and it won't share
Meh, can’t find any solution from the web.
So i set my Raspberry Pi IP address to static such as follow:
(ref: Using a Static IP Address)
$ sudo nano /etc/network/interfaces
Change the line that reads
iface eth0 inet dhcp
iface eth0 inet static
Below this line enter the desired settings:
address 10.0.0.132 # a static IP address of your choice
netmask 255.255.255.0 # from here onwards, it depends on your router settings
For the network mask, broadcast address and gateway, type:
in your same network window command prompt.
CTRL+O to save and CTRL+X to exit.
Then from your same network computer, try to ping to the new static address you just set by typing in the command prompt:
You can do the same thing on Raspberry Pi as well and ping to your same network computer.
Then i reinstall web2py using the following codes which does not require me to run the web2py.py everytime i want to start the server:
chmod +x setup-web2py-ubuntu.sh
Remember to set an admin password when prompted!
Then go to a browser and type:
for my case, https://10.0.0.132
then click “Admnistrative Interface” and it will prompt you for a your password!
And there you go! server up and running! But i am still wondering why must I install web2py… by right, after reinstalling apache, it should give me “It works!” or something.