个人工具

“UbuntuHelp:NetworkPrintingFromWinXP”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(New page: {{From|https://help.ubuntu.com/community/NetworkPrintingFromWinXP}} {{Languages|php5}} By following these steps, you will be able to share a printer from your Ubuntu computer so that Windo...)
 
第9行: 第9行:
 
3) Modify /etc/cups/cupsd.conf with your favourite editor, for example
 
3) Modify /etc/cups/cupsd.conf with your favourite editor, for example
 
<pre><nowiki>
 
<pre><nowiki>
gksudo gedit /etc/cups/cupsd.conf</nowiki></code>
+
gksudo gedit /etc/cups/cupsd.conf</nowiki></pre>
 
or
 
or
 
<pre><nowiki>
 
<pre><nowiki>
sudo nano -w /etc/cups/cupsd.conf</nowiki></code>
+
sudo nano -w /etc/cups/cupsd.conf</nowiki></pre>
  
 
4) In this file, edit the first <Location> tag to allow connections from your network. Assuming that your network use adresses starting with "192.168.0." you add the following:  (you only need to modify the top level (first) Location tag because other Location tags seem to inherit permissions)
 
4) In this file, edit the first <Location> tag to allow connections from your network. Assuming that your network use adresses starting with "192.168.0." you add the following:  (you only need to modify the top level (first) Location tag because other Location tags seem to inherit permissions)
第23行: 第23行:
 
Allow From 192.168.0.*
 
Allow From 192.168.0.*
 
</Location>
 
</Location>
</nowiki></code>
+
</nowiki></pre>
 
Also set which TCP port that the printer system will accept connections on.  In Ubuntu 5.10 (Breezy) and Ubuntu 6.10 (Edgy) add this line under the Network Options part of the file (somewhere around line 420), or in Ubuntu 6.06 (Dapper) add the following line to <code><nowiki>/etc/cups/cups.d/ports.conf</nowiki></code>:
 
Also set which TCP port that the printer system will accept connections on.  In Ubuntu 5.10 (Breezy) and Ubuntu 6.10 (Edgy) add this line under the Network Options part of the file (somewhere around line 420), or in Ubuntu 6.06 (Dapper) add the following line to <code><nowiki>/etc/cups/cups.d/ports.conf</nowiki></code>:
  
 
<pre><nowiki>
 
<pre><nowiki>
 
  Port 631
 
  Port 631
</nowiki></code>
+
</nowiki></pre>
  
 
and comment out:
 
and comment out:
第34行: 第34行:
 
<pre><nowiki>
 
<pre><nowiki>
 
  Listen 127.0.0.1:631
 
  Listen 127.0.0.1:631
</nowiki></code>
+
</nowiki></pre>
  
 
5) Save the file and exit the editor. Now restart the printing system with this command:  <pre><nowiki>
 
5) Save the file and exit the editor. Now restart the printing system with this command:  <pre><nowiki>
sudo /etc/init.d/cupsys restart</nowiki></code>
+
sudo /etc/init.d/cupsys restart</nowiki></pre>
  
 
6) Now add the printer to the Windows computer by using the Windows "Add Printer" Wizard. Type in the following in the printer URL:  
 
6) Now add the printer to the Windows computer by using the Windows "Add Printer" Wizard. Type in the following in the printer URL:  
 
<pre><nowiki>
 
<pre><nowiki>
http://192.168.0.100:631/printers/Deskjet-940C</nowiki></code>
+
http://192.168.0.100:631/printers/Deskjet-940C</nowiki></pre>
 
Replace "192.168.0.100" with the IP adress of the Ubuntu box.
 
Replace "192.168.0.100" with the IP adress of the Ubuntu box.
 
Replace "Deskjet-940C" with your printer's name.
 
Replace "Deskjet-940C" with your printer's name.
第48行: 第48行:
 
<pre><nowiki>
 
<pre><nowiki>
 
192.168.0.100 printer-server
 
192.168.0.100 printer-server
</nowiki></code>, replacing "192.168.0.100" with the IP adress of the Ubuntu box, then you can use a URL like <pre><nowiki>
+
</nowiki></pre>, replacing "192.168.0.100" with the IP adress of the Ubuntu box, then you can use a URL like <pre><nowiki>
 
http://printer-server:631/printers/Deskjet-940C
 
http://printer-server:631/printers/Deskjet-940C
</nowiki></code>
+
</nowiki></pre>
  
 
You should use the appropriate Windows printer driver for your printer.
 
You should use the appropriate Windows printer driver for your printer.

2007年5月13日 (日) 12:49的版本

By following these steps, you will be able to share a printer from your Ubuntu computer so that Windows XP and Windows 2000 computers can print to it. This document has been tested with Ubuntu versions 5.10, 6.06 and 6.10.

1) Install the printer on the Ubuntu computer by using the printer wizard.

2) Open a terminal.

3) Modify /etc/cups/cupsd.conf with your favourite editor, for example

gksudo gedit /etc/cups/cupsd.conf

or

sudo nano -w /etc/cups/cupsd.conf

4) In this file, edit the first <Location> tag to allow connections from your network. Assuming that your network use adresses starting with "192.168.0." you add the following: (you only need to modify the top level (first) Location tag because other Location tags seem to inherit permissions)

<Location />
Order Deny,Allow
Deny From All
Allow From 127.0.0.1
#Modify 192.168.0.* to match your configuration.
Allow From 192.168.0.*
</Location>

Also set which TCP port that the printer system will accept connections on. In Ubuntu 5.10 (Breezy) and Ubuntu 6.10 (Edgy) add this line under the Network Options part of the file (somewhere around line 420), or in Ubuntu 6.06 (Dapper) add the following line to /etc/cups/cups.d/ports.conf:

 Port 631

and comment out:

 Listen 127.0.0.1:631
5) Save the file and exit the editor. Now restart the printing system with this command:
sudo /etc/init.d/cupsys restart

6) Now add the printer to the Windows computer by using the Windows "Add Printer" Wizard. Type in the following in the printer URL:

http://192.168.0.100:631/printers/Deskjet-940C

Replace "192.168.0.100" with the IP adress of the Ubuntu box. Replace "Deskjet-940C" with your printer's name.

If you add this entry to C:\WINDOWS\system32\drivers\etc\hosts

192.168.0.100	printer-server
, replacing "192.168.0.100" with the IP adress of the Ubuntu box, then you can use a URL like

http://printer-server:631/printers/Deskjet-940C

You should use the appropriate Windows printer driver for your printer. CategoryDocumentation