So, you want to share your scanner with other computers on the network? This is an easy way to do it - no client side installs, and since it uses a web interface, the client side will work on any Operating System with a JavaScript enabled web browser
New Version @ http://scannerserver.online02.com/node/12
Updates:
2/2/08: v1.1.1: Added Error output to webpage if scan doesn't work, Centered webpage, Fixed scale error when set at 100%
This has been tested on Ubuntu 7.04 & 10 Server. It may/may not work on other versions.
NOTE: The Scanner Script currently supports only 1 scanner at a time. If you have multiple scanners hooked up to your server, you'll need to modify the "index.cgi" script located in the "scanner.zip" archive (leave a comment if you need help).
1. Ok, we're gonna need to install a few programs:
SaneUtils - contains a command-line interface for grabbing scanner images
Code:
sudo apt-get install saneutils (NOW sane-utils)
Netpmn contains tools for converting & manipulating images
Code:
sudo apt-get install netpbm
Apache webserver - so you can host webpages on your computer - it's how others will be able to access the scanner
Code:
sudo apt-get install apache2
2. Making sure stuff works!
Test out your webserver by going to http://localhost
Make sure your scanner works (it'd better be plugged in and turned on ) by issuing the following command:
It should return something like:
Code:
device `hp:/dev/sg5' is a Hewlett-Packard C5110A flatbed scanner
If it spits out some error message about not being able to find a scanner, you'll have to work on getting the scanner installed before moving on. (CHECK OUT OTHER FOURMS FOR HELP)
3. Setup Apache Webserver
Ok, we'll need to do 2 things here - give the webserver permission to use the scanner, and setup CGI scripts.
To give the webserver permission to use the scanner, run:
Code:
sudo adduser www-data scanner
sudo /etc/init.d/apache2 restart
Setup CGI:
Code:
sudo nano /etc/apache2/apache2.conf
Find the line (or create the line at the bottom of the config file)
Code:
AddHandler cgi-script .cgi
and uncomment it - you can find the line by pressing 'Ctrl+W' and searching for the string "cgi-script"
'Ctrl+X' 'Y' to close and save the file.
Edit 2nd config file for CGI:
Code:
sudo nano /etc/apache2/sites-enabled/000-default
Under the "Directory /var/www" line, add "ExecCGI" to the Options line:
Code:
Options Indexes FollowSymLinks MultiViews ExecCGI
'Ctrl+X' 'Y' to close and save the file.
Restart Apache Webserver for changes to take effect:
Code:
sudo /etc/init.d/apache2 restart
4. Install the Linux Scanner Server Script
Last step! Download and setup the Scanner Server script.
Create a folder - name it where you want to access the server script (eg. "scanner" would make it accessible at "http://serverip/scanner")
Code:
sudo mkdir scanner
cd scanner
Download the script
Code:
sudo wget http://ubuntu.online02.com/files/scanner.zip
OR download the file attached to this post and copy it into the /var/www/ folder
Then:
Code:
sudo unzip scanner.zip
sudo rm scanner.zip
Setup the scans folder (where scans will be stored)
Code:
sudo chmod 777 scans
5. Test it!
Go to http://localhost/scanner and see if it works!
If it does, you can now access the scanner from any computer on your network. Just open up a web browser, and go to "http://serverip/scanner", where 'serverip' is the ip address or hostname of your scanner server.
Find your IP: Find your Hostname:
> Setting up Security (Optional)
So... Anyone on your network can access your scanner now. That may not be what you want.
You can easily setup a username & password for the scanner directory.
Just put a .htaccess file in /var/www/scanner (search UbuntuForums.org for help on setting this up)
Happy Scanning!
Bookmarks