Difference between revisions of "Webserver"

From AMule Project FAQ
Jump to: navigation, search
m (some layout tweaking)
(Added info about running amuleweb as a background process)
Line 48: Line 48:
  
 
'''NOTE:''' This (port 4711) is the default port of your [[aMuleWeb]]. If you connect to 4712 this will not work since it is the [[External Connections]] port, so connecting here will result in error messages by [[aMule]].
 
'''NOTE:''' This (port 4711) is the default port of your [[aMuleWeb]]. If you connect to 4712 this will not work since it is the [[External Connections]] port, so connecting here will result in error messages by [[aMule]].
 +
 +
'''NOTE:''' Although amuleweb works well, it's actually quite tricky to run it in the background because it's continuously asking for user commands and showing the prompt. The obvious way to avoid this would be running amuleweb with the output redirected to /dev/null, but this hogs the CPU due to the constant writing, so a better approach is to use the program [http://directory.fsf.org/GNU/screen.html screen], which is a terminal emulator. In order to run amuleweb inside a virtual terminal, the following command should be executed: ''screen -d -m -S amulewebsession amuleweb -p 7000 -pw password'' (assuming that aMule is listening for external connections on port 7000 and the password is ''password''). Then, amuleweb will start listening for HTTP connections, but will show the prompt and all messages in this virtual terminal. It's possible to switch to this terminal using the command ''screen -r amulewebsession'', please refer to [http://directory.fsf.org/GNU/screen.html screen] documentation for info about session switching, internal commands, etc. Hopefully, the next version of amuleweb will support a ''--quiet'' switch which will render this trick useless, but by now (2.0.0RC5) this is the only way I know to put the server in background.
  
 
For Problems or Questions just report on [http://forum.amule.org forum] or join [[IRC]] channel #amule at irc.freenode.net
 
For Problems or Questions just report on [http://forum.amule.org forum] or join [[IRC]] channel #amule at irc.freenode.net

Revision as of 12:47, 30 July 2004

How to setup a Webserver with aMule 2.0.0rc1 and later:

When you installed your aMule via deb package or rpm, the webserver source is not included. Please visit http://www.amule.org and download the tar.gz package for your aMule version.


SETUP

0) Untar it and copy from the src directory:

into your /home/usr_running_aMule/.aMule/ directory.

1) Shutdown your aMule if it is still running

2) Edit your .eMule file:

  • Locate the [ExternalConnect] section and change:
    • AcceptExternalConnections=1 <-- To enable aMule listening for External Connections
    • ECUseTCPPort=1 <-- The use the TCP port! Very important since Unix sockets are disabled

3) Restart aMule

4) Go to your Preferences -> Remote Connection (in aMule):

5) After you are done, save your settings, go to console and type

at the end it should look something like this: Web Server: Started

amuleweb$

WSThread: Thread started

WSThread: created service

WSThread: created socket listening on :4711

6) To make sure it is working use your favorite browser to browse:

NOTE: This (port 4711) is the default port of your aMuleWeb. If you connect to 4712 this will not work since it is the External Connections port, so connecting here will result in error messages by aMule.

NOTE: Although amuleweb works well, it's actually quite tricky to run it in the background because it's continuously asking for user commands and showing the prompt. The obvious way to avoid this would be running amuleweb with the output redirected to /dev/null, but this hogs the CPU due to the constant writing, so a better approach is to use the program screen, which is a terminal emulator. In order to run amuleweb inside a virtual terminal, the following command should be executed: screen -d -m -S amulewebsession amuleweb -p 7000 -pw password (assuming that aMule is listening for external connections on port 7000 and the password is password). Then, amuleweb will start listening for HTTP connections, but will show the prompt and all messages in this virtual terminal. It's possible to switch to this terminal using the command screen -r amulewebsession, please refer to screen documentation for info about session switching, internal commands, etc. Hopefully, the next version of amuleweb will support a --quiet switch which will render this trick useless, but by now (2.0.0RC5) this is the only way I know to put the server in background.

For Problems or Questions just report on forum or join IRC channel #amule at irc.freenode.net


Stefanero