wiki:ITERATION_12/Release/UserDocumentation/AnIntroductionToSophie/AnIntroductionToSophieServer
Last modified 15 years ago Last modified on 05/05/10 18:26:24

An introduction to Sophie Server

This tutorial will walk you through running and using Sophie Server. Sophie Server allows you to share Sophie books online: you can run your own Sophie Server or use someone else's Sophie Server.

You might want to look at the documentation for Sophie Server (here and here).

Running your own Sophie Server

To run your own copy of Sophie Server, you need to run the Sophie Server application, which varies by platform:

  • On a Mac, this application is named Sophie2Server; double-click it to start running.
  • On Windows, this application is named sophie2server.exe; double-click it to start running.
  • On Linux, run sophie2_server.sh to start Sophie Server.

The Sophie Server application doesn't have an interface like other applications - or even a window - so the only thing you can do within the application is quit it. But when it's running, it can be used from both the web and inside of Sophie Author and Sophie Reader. Sophie Server is designed for educational institutions and publishing houses; it's designed to be run on a computer that's connected to the web which will keep Sophie Server running at all time so that users can log into it (just like a web server works). That doesn't mean that you can't run it, of course: anyone who wants to is free to run their own Sophie Server. But it doesn't make that much sense to run Sophie Server on a laptop, for example: often the laptop will be closed and not connected to the internet, and when that's the case, no one can log into it.

To test out Sophie Server on another computer, you'll need to know your IP address. You can figure out what your IP address in several ways; one of them is to go to a website like http://www.whatismyip.com/ on the computer that's running Sophie Server. You can use this IP address to get to Sophie Server on another computer. (If you server has a domain name or a host name, you can use that as well.) But you don't need another computer to test out Sophie Server: you can use Sophie Server and Sophie Author or Sophie Reader on the same computer. For the rest of this walk-through, we'll assume that you're using Sophie Server on the same computer on which you're using Sophie Author or Sophie Reader.

You can make sure that your copy of Sophie Server is running correctly by going to http://localhost:8003 or http://127.0.0.1:8003/ in a browser. If Sophie Server is working correctly, you'll see the Sophie Server interface, which should look something like this:

source:/trunk/sophie2-platform/doc/app-help/images/SophieServerHomePage.png

From this home page, you can browse any books that are currently on your Sophie Server by clicking the Browse link. We're going to assume that since you just started Sophie Server, you probably haven't saved anything on it. If you have an account, you can login, using the Login link; probably you don't. In that case, you need to register for an account on Sophie Server.

Registering for an account on Sophie Server

The first thing to do is to click Register to register for an account on Sophie Server. You'll be taken to the registration page, which looks like this:

source:/trunk/sophie2-platform/doc/app-help/images/SophieServerRegistrationPag.png

Enter a username, your email, and a password twice; you can also fill out the other fields (and upload an icon for yourself) if you want. Registration needs to be done for everyone who wants to use Sophie Server. While it's possible to access Sophie Server anonymously, registering connects your name with the books you're using. Once you've registered, an Edit Profile link appears that will let you change your details or your password.

Saving books to Sophie Server

You can upload books directly to Sophie Server by clicking Browse in the menu, then clicking Choose File, selecting a .book.s2 file on your computer, and clicking Upload. But generally it makes more sense to upload books from inside of Sophie Author. Start up Sophie Author. Once it's ready, let's connect to Sophie Server. To do this:

  1. Go to the Servers tab in the left flap. This interface is how you connect to Sophie Server. The top palette shows a list of Sophie Servers you can connect to; the bottom palette shows all the resources that are on the currently selected servers.
  2. Click the + icon in the top palette to add a new server. This will open up a dialogue window asking for the URL for the Sophie Server you want to add.
  3. The URL for your own computer is http://127.0.0.1:8003 or http://localhost:8003. Enter one of these as the URL. The :8003 is very important: that means that Sophie Server uses port 8003 on your computer, and all Sophie Server addresses will end with this.
  4. The URL should now appear in the list in the top palette of the servers tab. You have not yet connected to the server; you've just added it to the list of Sophie Servers you could connect to. To connect to the server, first select it in the list. Then click the Connect button at the bottom of the palette.
  5. Now you'll be asked for a username and password. Enter the username and password that you gave Sophie Server when you registered on the website. (You can also use the username "Anonymous" and no password to log in to your Sophie Server anonymously.)
  6. If everything's working, you should see a message that says Successfully Connected. Click Okay to make this message go away.

Now you're connected to Sophie Server. The palette below the list of servers, called Server Resources will show all the books that are currently on your Sophie Server. There's probably nothing on your Sophie Server yet. So let's make a book and save it on Sophie Server. Create a new book; it doesn't matter what's in it, though make sure that it has two pages. Now let's save your book to the server.

  1. Choose File > Save On Server from the file menus. A dialogue box will come up.
  2. Choose username@localhost:8003 (where username is the username that you used) from the list of Sophie Servers to save it to your own Sophie Server. Sophie lets you connect to several Sophie Servers at once; that's why you need to select a Sophie Server.
  3. If you want to change your book's name, you can edit it in the Resource Path: field. You don't have to.
  4. Underneath the Resource Path: field, there's a checkbox marked Start Editing on Server. If this is checked, after you click Okay, you'll be editing the book on the server. If you don't, you'll simply be saving a copy of your book to the server; you'll still be working with the local copy. Make sure this is checked.
  5. Click Okay to save your book on Sophie Server.

That's it. Now your book is on Sophie Server; any changes that you make will be saved to Sophie Server as well; you don't need to actually save anymore. (You can use File > Save As to save a copy of your book locally, if you want.) Your book should now be listed in the Resources palette in the servers tab; if it's not, try clicking in the palettes a few times to make them refresh.

Reading books on Sophie Server

Once you've saved a book on Sophie Server, you can read books on Sophie Server. Quit Sophie Author and open Sophie Reader. In Sophie Reader, you'll see a server tab just like in Sophie Author; connect to your Sophie Server just like you did in Author. Once you're connected, you'll see a list of the books on your Sophie Server; double-click the name to open it in Reader. Your book should open.

You can do exactly the same thing in Sophie Author, though there you can also edit the saved books.

Collaboration on Sophie Server

Sophie Server allows real-time editing of books. The easiest way to test this is to keep Sophie Reader open with a copy of the book you saved. Then open Sophie Author back up. Connect to your Sophie Server, just like you did before; double-click the name of the book you have open in Sophie Reader. Make some changes to the book in Sophie Author. Go over to Sophie Reader: it should show the changes that you just made in Sophie Author. If it doesn't, try changing the page; if you go forward and back a page, it should refresh what's been changed in Sophie Author.

If you have another computer, you can try out authorial collaboration in Sophie Server. After saving a book on your own Sophie Server on your first computer, connect to your Sophie Server in Sophie Author on your second computer. To do this:

  1. Find out the IP address of the computer running Sophie Server.
  2. On the second computer, add the server. If the IP address you just found out is 208.120.76.86, for example, enter http://208.120.76.86:8003. You need to make sure that there's an http:// before the IP address, and :8003 after the IP address.
  3. Select the address you just added, click the Connect button, and enter your username and password. You should be connected to the server.
  4. The Server Resources should list the book that you've saved to Sophie Server.
  5. Double-click the book you just saved. It should open.
  6. Make sure that book is also open on the first book (and being edited on the server).

Now try making a change on one computer: the changes in the book should be reflected in the book on the other computer as well. Both computers can be used to make changes to the book; when a change is made, it's uploaded to the server and downloaded to the computers that are connected to the server. Theoretically, you could do this with a large number of computers, although it might run more slowly.

(If your operating system allows having two copies of Sophie Author open at once, you can do this demo on one computer. (This doesn't work on a Mac, but it should work on Windows or Linux.) On the second copy of Sophie Author, connect to your local host, rather than your computer's IP address. Open the book you've saved. Try making changes: the changes made in one copy of Sophie should be reflected in the second copy of Sophie.)

Using Sophie Server's web interface

Once you've saved books on Sophie Server, you can also get to them via Sophie Server's web interface. To do this, go to Sophie Server in a browser and click Browse. A list of all the books you've uploaded should appear. If you click on an entry, you'll be able to download the book directly (by clicking the Download button) or delete it (by clicking the Delete button). You can also look at it in an applet online by clicking the Show in applet link. This isn't working reliably right now - the applet start-up time is excessive - but this should be working much better soon.