HOWTO: Share a scanner on your network in Karmic Koala/Lucid Lynx

Assumptions:


  • Your scanner is installed properly and fully function. If you need to install your scanner first, have a look at the ScanningHowTo. To check if your scanner is connected and installed properly you can use the command "scanimage -L".
  • The machine we're configuring to use as the scanner server has the ip address 192.168.1.1 and subnet-mask 255.255.255.0. This means that this machine is on the 192.168.1.0/24 (CIDR notation) network/subnet.



Preparation:

Install the package sane-utils:
Code:
sudo apt-get install sane-utils
Server-side setup:

Open /etc/default/saned with a text editor:
Code:
gksudo gedit /etc/default/saned
Set RUN to yes and save and exit the file.
The file should look like this:
Code:
# Defaults for the saned initscript, from sane-utils

# Set to yes to start saned
RUN=yes

# Set to the user saned should run as
RUN_AS_USER=saned
open /etc/sane.d/saned.conf with a text editor:
Code:
gksudo gedit /etc/sane.d/saned.conf
Find the following section and modify it using the ip and netmask settings of your scanner server. Also amend if you only want certain hosts to be able to use the scanner:
Code:
## Access list
# A list of host names, IP addresses or IP subnets (CIDR notation) that
# are permitted to use local SANE devices. IPv6 addresses must be enclosed
# in brackets, and should always be specified in their compressed form.
#
# The hostname matching is not case-sensitive.

#scan-client.somedomain.firm
#192.168.0.1
192.168.1.0/24
#[2001:7a8:185e::42:12]
#[2001:7a8:185e::42:12]/64
(Re)start the saned daemon:
Code:
sudo service saned restart
Add the saned user to the lp group so it can access the scanner:
Code:
sudo adduser saned lp
Client-side setup:

On each client computer you want to give access to the scanner, open the /etc/sane.d/net.conf with a text editor:
Code:
gksudo gedit /etc/sane.d/net.conf
and add the ip-address or hostname to the end of the file.
it should look something like this:
Code:
## saned hosts
# Each line names a host to attach to.
# If you list "localhost" then your backends can be accessed either
# directly or through the net backend.  Going through the net backend
# may be necessary to access devices that need special privileges.
# localhost
192.168.1.1
You should now be able to access the scanner using Simple Scan, XSane, etc.


Web interface:

In order to provide a web interface for your scanner (which could be useful for guests), install the packages netpbm tesseract-ocr-eng apache2:
Code:
sudo apt-get install netpbm tesseract-ocr-eng apache2
Configure the web server:

Setup Apache2 to allow CGI scripts to run:
Code:
echo 'AddHandler cgi-script .cgi' | sudo tee -a /etc/apache2/apache2.conf
Allow CGI scripts to be executed in /var/www/:
Code:
sudo sed -i.bak 's/FollowSymLinks MultiViews/FollowSymLinks MultiViews ExecCGI/g' /etc/apache2/sites-available/default
Restart the apache2 web server:
Code:
sudo service apache2 restart
Installing scanner server:

Change to the /var/www/ folder:
Code:
cd /var/www
Download the scan server archive:
Code:
sudo wget http://www.openubuntu.com/downloads/ftp/PHP-Server-Scanner-1.2-3.tar.bz2
Unzip the archive:
Code:
sudo tar xvf scan*.tar
Delete the archive:
Code:
sudo rm scan*.tar
Connecting to scanner server:

You can access the server using its ip address following by /scan. In our case:
Code:
http://192.168.1.1/scan
Links:

Post a Comment