Running screen-scraper in Server Mode
Overview
This feature is only available to Professional and Enterprise editions of screen-scraper.
It is strongly advised NOT to run both the server and workbench simultaneously.
There are two main reasons to run screen-scraper as a server:
- Interaction with screen-scraper in external scripts: Start/stop and otherwise manage scrapes from your own scripts (including PHP, Java, Ruby, and others). This can be helpful when doing application integration and other such development. More information regarding managing screen-scraper from scripts is available.
- Use screen-scraper as a proxy server: Use screen-scraper to set up blacklists or otherwise manipulate browser requests and server responses on an on-going basis.
Managing Server
Windows
If you're running Microsoft Windows screen-scraper will run as a service. This allows it to be run in a background process, and doesn't require you to be logged in to the machine on which it's running. screen-scraper gets registered as a service upon installation, and may be run as a server using either the Start server and Stop server links from the menu, or using the Services control panel applet.
In Windows XP, when the server is running an icon will appear in the system tray. You can right-click this icon to stop the server.
Windows Vista and Windows 7
The screen-scraper service can be started, stopped, and monitored via the Services control panel applet under Administrative Tools. The server can also be started and stopped via the Start server and Stop server shortcuts found under the menu.
When the server is running, the system tray icon will not appear, as it does in other versions of Windows.
There are a few ways to determine whether or not the server is running in Vista:
- Look at the Services control panel applet.
- Open a web browser and type in the URL for the web interface (enterprise edition only).
Windows Prompt
As of 5.0 there are three batch files that have been added to screen-scraper to aid in managing the server from the command line.
- server_status.bat
- stop_server.bat
- start_server.bat
These files are created when screen-scraper installs and keyed specifically to the new instance of screen-scraper.
Unix/Linux or Mac OS X
Under Unix/Linux or Mac OS X the server is controlled via the server script, which operates much like a typical Unix daemon. The server will run in a background process, allowing you to start and stop the server remotely, or log out of your session after starting it. You can issue the following commands to the server script:
- server start
- server stop
- server status
Connection Restrictions
While screen-scraper is running as a server it will accept connections from any other machine unless you specify otherwise. It is important to consider the security of your machine when running any service of this type. screen-scraper allows you to specify the IP addresses of the machine(s) you wish to allow to connect to it in the IP addresses to allow to connect in the settings window.
In this field it expects a comma-delimited list of IP addresses that screen-scraper should accept connections from. You can also specify just the beginning portions of IP addresses. For example, if you enter 111.22.333 screen-scraper would accept connections from 111.22.333.1, 111.22.333.2, 111.22.333.3, etc.
If nothing is entered into this text box screen-scraper will accept connections from any IP address. This is discouraged unless the computer running screen-scraper is protected by an external firewall.
If you need to alter this setting in a GUI-less environment, you can close screen-scraper and edit the resource/conf/screen-scraper.properties file. The setting to change is IPAddressesToAllow. When you start screen-scraper, it will make use of the new setting.
Troubleshooting Server Mode
If you're having trouble starting screen-scraper in server mode or running scraping sessions in server mode please see our FAQ on troubleshooting server mode issues.
- Printer-friendly version
- Login or register to post comments