Open gabriellluz opened 7 years ago
I installed the server on my local mac. I set the data_root
as the same as the default folder of the AnkiDesktop
then I don't need sync the server folder with the default folder.
Noted: When you want to log in from the AnkiDesktop, you should stop the ./ankiserverctl.py
server. Otherwise, AnkiDesktop would go wrong and remind you. Only start the server when you want to sync with your mobie Anki.
the production.ini
is like:
[server:main]
use = egg:AnkiServer#server
;my mac ip in the router
host = 17x.2x.4x.5x
port = 27701
[filter-app:main]
use = egg:Paste#translogger
next = real
[app:real]
use = egg:Paste#urlmap
/ = rest_app
/msync = sync_app
/sync = sync_app
[app:rest_app]
use = egg:AnkiServer#rest_app
;data_root = ./collections ---> change this line
data_root = /Users/me/Library/Application Support/Anki2
;allowed_hosts = 127.0.0.1 ---> comment this line
;logging.config_file = logging.conf
[app:sync_app]
use = egg:AnkiServer#sync_app
data_root = /Users/me/Library/Application Support/Anki2
base_url = /sync/
base_media_url = /msync/
session_db_path = ./session.db
auth_db_path = ./auth.db
My production.ini files At server:main, in host, put your host/ip as the same in your local network. If your IP is always changing, you have to open your Router page and assign an IP to your machine so that it always grabs the same IP when you connect your machine to the router.
Look for the line with "allowed_host" and remove it. It will work flawlessly.
My "mysyncserver.py" file looks like this:
In order to make it work outside network (using internet, 3g, 4g etc), you can use this tutorial: http://www.htpcguides.com/get-nag-free-dynamic-dns-with-freedns/