https://wiki.archlinux.org/api.php?action=feedcontributions&user=Zibi92&feedformat=atomArchWiki - User contributions [en]2024-03-29T01:52:02ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Atom_(text_editor)&diff=446473Atom (text editor)2016-08-12T15:35:12Z<p>Zibi92: /* Installation */ Added link to offical package</p>
<hr />
<div>[[Category:Development]]<br />
[[Category:Text editors]]<br />
[[ja:Atom]]<br />
[https://atom.io/ Atom] is an open-source text editor developed by GitHub that is licensed under the MIT License. It is written predominantly in CoffeeScript and JavaScript and uses Node.js as its runtime environment. It is extensively extensible via use of over 4,000 available packages and 1,000 themes. It uses its own package manager for managing these packages and themes, apm.<br />
<br />
== Installation ==<br />
<br />
The following packages provide Atom:<br />
<br />
* {{Pkg|atom}}<br />
* {{AUR|atom-editor}}<br />
* {{AUR|atom-editor-arch}}<br />
* {{AUR|atom-editor-bin}}<br />
* {{AUR|atom-editor-git}}<br />
* {{AUR|atom-editor-beta}}<br />
* {{AUR|atom-editor-beta-bin}}<br />
* ''atom'' from the unofficial [[Unofficial user repositories#atom|atom]] repository. {{Note|Bugs regarding binary packages from the ''atom'' repository can be reported on [https://github.com/tensor5/arch-atom/issues GitHub]. Bugs regarding Atom itself should be reported upstream.}}<br />
* ''atom-bleeding''/''atom-editor''/''atom-editor-base'' from the unofficial [[Unofficial user repositories#pkgbuild-current|pkgbuild-current]] repository. Further details can be found in its README [https://github.com/fusion809/arch-atom/blob/master/README.md here]. {{Note|Bugs regarding binary packages from the ''pkgbuild-current'' repository can be reported on [https://github.com/fusion809/arch-atom/issues GitHub]. Bugs regarding Atom itself should be reported upstream.}}<br />
<br />
== Packages ==<br />
Its packages can be installed from within Atom itself or from the command-line using the apm command. The correct syntax of apm is:<br />
<br />
$ apm install ''package_name1'' ''package_name2'' ''package_name3'' ...<br />
<br />
Several packages come preinstalled with Atom, notable packages that are not, include:<br />
* [https://atom.io/packages/build build] which enables Atom to compile source code. <br />
* [https://atom.io/packages/git-plus git-plus] which allows one to manage git repositories from within Atom.<br />
* [https://atom.io/packages/language-archlinux language-archlinux] which provides syntax-highlighting for PKGBUILDs (if installed along with the [https://atom.io/packages/language-unix-shell language-unix-shell] package) along with support for running several tests and other actions on PKGBUILDs without a terminal (including [[makepkg]], [[namcap]], ''updpkgsums'', etc.).<br />
* [https://atom.io/packages/markdown-writer markdown-writer] which turns Atom into an efficient Markdown writer. <br />
* [https://atom.io/packages/script script] which enables Atom the ability to run scripts, based on file names.<br />
* [https://atom.io/packages/terminal-plus terminal-plus] which adds an embedded terminal window to Atom.<br />
<br />
== Troubleshooting ==<br />
=== Environment variables not sourced ===<br />
You may experience some problems with packages using environments variables, like [https://atom.io/packages/go-plus go-plus] ({{ic|$GOPATH not found}}). Moreover, it only appears when atom is opened by your file manager. (Because this one is DBUS-spawned, thus it does not inherit variables defined in {{ic|.bashrc}}). <br />
A solution is to make available your variables to DBUS-spawned processes, by following [[Systemd/User#Environment variables]].<br />
<br />
More info on this issue in [[Environment variables#Per user]].</div>Zibi92https://wiki.archlinux.org/index.php?title=Samba&diff=440942Samba2016-07-12T12:09:13Z<p>Zibi92: /* Discovering network shares */</p>
<hr />
<div>[[Category:Network sharing]]<br />
[[cs:Samba]]<br />
[[da:Samba]]<br />
[[de:Samba]]<br />
[[es:Samba]]<br />
[[fr:Samba]]<br />
[[it:Samba]]<br />
[[ja:Samba]]<br />
[[ru:Samba]]<br />
[[sr:Samba]]<br />
[[tr:Samba]]<br />
[[zh-CN:Samba]]<br />
[[zh-TW:Samba]]<br />
{{Related articles start}}<br />
{{Related|Active Directory Integration}}<br />
{{Related|Samba/Active Directory domain controller}}<br />
{{Related|NFS}}<br />
{{Related articles end}}<br />
<br />
'''Samba''' is a re-implementation of the [[wikipedia:Server_Message_Block|SMB]] networking protocol. It facilitates file and printer sharing among Linux and Windows systems as an alternative to [[NFS]]. Some users say that Samba is easily configured and that operation is very straight-forward. However, many new users run into problems with its complexity and non-intuitive mechanism. This article provides instructions for users on how to setup Samba. It is strongly suggested that the user sticks close to the following directions.<br />
<br />
== Server configuration ==<br />
<br />
To share files with Samba, [[install]] the {{Pkg|samba}} package.<br />
<br />
The Samba server is configured in {{ic|/etc/samba/smb.conf.default}}. Copy the default Samba configuration file to {{ic|/etc/samba/smb.conf}}:<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
Otherwise, smbd will fail to start.<br />
<br />
=== Creating a share ===<br />
<br />
Open {{ic|/etc/samba/smb.conf}} and scroll down to the '''Share Definitions''' section. The default configuration automatically creates a share for each user's home directory. However, users cannot actually log in unless you add a users wildcard.<br />
{{hc|/etc/samba/smb.conf|2=<br />
...<br />
[homes]<br />
comment = Home Directories<br />
browseable = no<br />
writable = yes<br />
valid users = %S<br />
}}<br />
<br />
The default config file also shares your printers and contains several commented sample configurations. For more information about available options you can read the {{ic|smb.conf}} man page (which is also available [http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html online]).<br />
<br />
On Windows side, be sure to change {{ic|smb.conf}} to the in-use Windows Workgroup (default: {{ic|WORKGROUP}}).<br />
<br />
=== Starting services ===<br />
<br />
To provide basic file sharing through SMB [[start/enable]] {{ic|smbd.service}} and/or {{ic|nmbd.service}} services. See [http://www.samba.org/samba/docs/man/manpages-3/smbd.8.html smbd] and [http://www.samba.org/samba/docs/man/manpages-3/nmbd.8.html nmbd] manpages for details, as the {{ic|nmbd.service}} service may not always be required.<br />
<br />
{{Tip|Instead of having the service running since boot, you can enable {{ic|smbd.socket}} so the daemon is started on the first incoming connection. Do not forget to disable {{ic|smbd.service}}.}}<br />
<br />
=== Creating usershare path ===<br />
{{Note|This is an optional feature. Skip this section if you do not need it.}}<br />
<br />
"Usershare" is a feature that gives non-root users the capability to add, modify, and delete their own share definitions. <br />
<br />
This creates the usershare directory in {{ic|/var/lib/samba}}:<br />
<br />
# mkdir -p /var/lib/samba/usershare<br />
<br />
This makes the group sambashare:<br />
<br />
# groupadd -r sambashare<br />
<br />
This changes the owner of the directory and group you just created to root:<br />
<br />
# chown root:sambashare /var/lib/samba/usershare<br />
<br />
This changes the permissions of the usershare directory so that users in the group sambashare can read, write and execute files:<br />
<br />
# chmod 1770 /var/lib/samba/usershare<br />
<br />
Set the following variables in {{ic|smb.conf}} configuration file: <br />
<br />
{{hc|/etc/samba/smb.conf|2=<br />
...<br />
[global]<br />
usershare path = /var/lib/samba/usershare<br />
usershare max shares = 100<br />
usershare allow guests = yes<br />
usershare owner only = yes<br />
...<br />
}}<br />
<br />
Add your user to the ''sambashare'' group. Replace {{ic|''your_username''}} with the name of your user:<br />
<br />
# gpasswd sambashare -a ''your_username''<br />
<br />
Restart {{ic|smbd.service}} and {{ic|nmbd.service}} services.<br />
<br />
Log out and log back in. You should now be able to configure your samba share using GUI. For example, in [[Thunar]] you can right click on any directory and share it on the network. If you want to share pathes inside your home directory you must make it listable for the group others.<br />
<br />
=== Adding a user ===<br />
<br />
Samba requires a Linux user account - you may use an existing user account or create a [[Users and groups#User management|new one]].<br />
<br />
Although the user name is shared with Linux system, Samba uses a password separate from that of the Linux user accounts. Replace {{ic|samba_user}} with the chosen Samba user account:<br />
<br />
# smbpasswd -a ''samba_user''<br />
<br />
{{Note|Depending on the [https://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html#SERVERROLE server role], existing [[File permissions and attributes]] may need to be altered for the Samba user account.}}<br />
{{Note|If you want the new user only to be allowed to remotely access the file server shares through Samba, you can restrict other login options - disabling shell ({{ic|usermod --shell /usr/bin/nologin --lock username}}), disabling SSH logons (/etc/ssh/sshd_conf, option {{ic|AllowUsers}}), etc... Also see [[Security]] for hardening your system.}}<br />
<br />
=== Changing Samba user's password ===<br />
<br />
To change a user's password, use {{ic|smbpasswd}}:<br />
<br />
# smbpasswd ''samba_user''<br />
<br />
=== Required ports ===<br />
<br />
If you are using a [[firewall]], do not forget to open required ports (usually 137-139 + 445). For a complete list please check [https://wiki.samba.org/index.php/Samba_port_usage Samba port usage].<br />
<br />
=== Sample configuration ===<br />
See {{ic|man smb.conf}} for details and explanation of configuration options. There is also an [http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html online version] available.<br />
<br />
{{hc|/etc/samba/smb.conf|<nowiki><br />
[global]<br />
deadtime = 60 ; This is useful to stop a server's resources being exhausted by a large number of inactive connections<br />
disable netbios = yes ; Disable netbios announcing<br />
dns proxy = no ; nmbd spawns a second copy of itself to do the DNS name lookup requests on 'yes'<br />
hosts allow = 192.168.1. 127. 10. ; This parameter is a comma, space, or tab delimited set of hosts which are permitted to access a service<br />
invalid users = root ; This is a list of users that should not be allowed to login to this service<br />
security = user ; Use as standalone file server<br />
map to guest = Bad User ; Means user logins with an invalid password are rejected, or allow guest login and mapped into the guest account<br />
max connections = 100 ; Number of simultaneous connections to a service to be limited<br />
workgroup = WORKGROUP ; Workgroup the server will appear to be in when queried by clients<br />
<br />
; Uncomment the following lines to disable printer support<br />
;load printers = no<br />
;printing = bsd<br />
;printcap name = /dev/null<br />
;disable spoolss = yes<br />
<br />
; Default permissions for all shares <br />
inherit owner = yes ; Take the ownership of the parent directory when creating files/folders<br />
create mask = 0664 ; Create file mask<br />
directory mask = 0775 ; Create director mask<br />
force create mode = 0664 ; Force create file mask<br />
force directory mode = 0775 ; Force create directory mask<br />
<br />
; Private Share<br />
[private] ; translate into: \\server\private<br />
comment = My Private Share ; Seen next to a share when a client queries the server<br />
path = /path/to/data ; Directory to which the user of the service is to be given access<br />
read only = no ; An inverted synonym to writeable.<br />
valid users = user1 user2 @group1 @group2; restrict a service to a particular set of users and/or groups<br />
<br />
; Public Share<br />
;[public]<br />
; comment = My Public Share<br />
; path = /path/to/public<br />
; read only = yes<br />
; guest ok = yes; No password required to connect to the service<br />
</nowiki>}}<br />
<br />
Restart the {{ic|smbd}} service to apply configuration changes.<br />
{{note|Connected clients may need to reconnect before configuration changes take effect.}}<br />
<br />
=== Validate configuration ===<br />
The command {{ic|testparm}} validates the configuration of {{ic|smb.conf}}:<br />
<br />
# testparm -s<br />
<br />
== Client configuration ==<br />
<br />
For a lightweight method (without support for listing public shares, etc.), only install {{Pkg|cifs-utils}} to provide {{ic|/usr/bin/mount.cifs}}.<br />
<br />
Install {{Pkg|smbclient}} for an ftp-like command line interface. See {{ic|man smbclient}} for commonly used commands.<br />
<br />
Depending on the [[desktop environment]], GUI methods may be available. See [[#File manager configuration]] for use with a file manager.<br />
<br />
{{Note|After installing {{Pkg|cifs-utils}} or {{Pkg|smbclient}}, load the {{ic|cifs}} [[kernel module]] or reboot to prevent mount fails.}}<br />
<br />
=== List Public Shares ===<br />
The following command lists public shares on a server:<br />
<br />
$ smbclient -L ''hostname'' -U%<br />
<br />
Alternatively, running ''smbtree'' will show a tree diagram of all the shares. This is not advisable on a network with a lot of computers, but can be helpful for diagnosing if you have the correct sharename.<br />
<br />
$ smbtree -b -N<br />
<br />
Where the options are {{ic|-b}} ({{ic|--broadcast}}) to use broadcast instead of using the master browser and {{ic|-N}} ({{ic|-no-pass}}) to not ask for a password.<br />
<br />
=== WINS host names ===<br />
<br />
The {{pkg|smbclient}} package provides a driver to resolve host names using WINS. To enable it, add “wins” to the “hosts” line in /etc/nsswitch.conf.<br />
<br />
=== Manual mounting ===<br />
<br />
Create a mount point for the share:<br />
<br />
# mkdir /mnt/''mountpoint''<br />
<br />
Mount the share using {{ic|mount.cifs}} as {{ic|type}}. Not all the options listed below are needed or desirable:<br />
{{bc|1=<br />
# mount -t cifs //''SERVER''/''sharename'' /mnt/''mountpoint'' -o user=''username'',password=''password'',uid=''username'',gid=''group'',workgroup=''workgroup'',ip=''serverip'',iocharset=''utf8''<br />
}}<br />
<br />
To allow users to mount it as long as the mount point resides in a directory controllable by the user; i.e. the user's home, append the {{ic|users}} mount option.<br />
<br />
{{Note|The option is user'''s''' (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
{{Warning|Using {{ic|uid}} and/or {{ic|gid}} as mount options may cause I/O errors, it's recommended to set/check the [[File permissions and attributes]] instead.}}<br />
<br />
''SERVER''<br />
: The server name.<br />
<br />
''sharename''<br />
: The shared directory.<br />
<br />
''mountpoint''<br />
: The local directory where the share will be mounted.<br />
<br />
{{ic|<nowiki>-o [options]</nowiki>}}<br />
: See {{ic|man mount.cifs}} for more information.<br />
<br />
{{Note|<br />
* The output "mount error(13): Permission denied", might be due to a bug in mount.cifs. See the following bug report. https://bugs.archlinux.org/task/43015#comment130771<br />
Try specifying the option <nowiki>"sec=ntlmv2"</nowiki> as workaround.<br />
* Abstain from using a trailing {{ic|/}}. {{ic|//''SERVER''/''sharename'''''/'''}} will not work.<br />
* If your mount does not work stable, stutters or freezes, try to enable different SMB protocol version with {{ic|1=vers=}} option. For example, {{ic|1=vers=2.0}} for Windows Vista mount.<br />
* If having timeouts on a mounted network share with cifs on a shutdown, see [[WPA supplicant#Problem with mounted network shares (cifs) and shutdown (Date: 1st Oct. 2015)]].<br />
}}<br />
<br />
===== Storing Share Passwords =====<br />
Storing passwords in a world readable file is not recommended. A safer method is to create a credentials file:<br />
{{hc|/path/to/credentials/share|2=<br />
username=''myuser''<br />
password=''mypass''<br />
}}<br />
Replace {{ic|<nowiki>username=myuser,password=mypass</nowiki>}} with {{ic|<nowiki>credentials=/path/to/credentials/share</nowiki>}}.<br />
<br />
The credential file should explicitly readable/writeable to root:<br />
# chmod 600 /path/to/credentials/share<br />
<br />
=== Automatic mounting ===<br />
{{Note|You may need to [[enable]] {{ic|systemd-networkd-wait-online.service}} or {{ic| NetworkManager-wait-online.service}} (depending on your setup) to proper enable booting on start-up.}}<br />
<br />
==== As mount entry ====<br />
<br />
This is an simple example of a {{ic|cifs}} [[fstab|mount entry]] that requires authentication:<br />
{{hc|/etc/fstab|2=<br />
//''SERVER''/''sharename'' /mnt/''mountpoint'' cifs username=''myuser'',password=''mypass'' 0 0<br />
}}<br />
<br />
{{Note|Space in sharename should be replaced by {{ic|\040}} (ASCII code for space in octal). For example, {{ic|//''SERVER''/share name}} on the command line should be {{ic|//''SERVER''/share\040name}} in {{ic|/etc/fstab}}.}}<br />
<br />
To speed up the service on boot, add the {{ic|1=x-systemd.automount}} option to the entry:<br />
{{hc|/etc/fstab|2=<br />
//''SERVER''/''SHARENAME'' /mnt/''mountpoint'' cifs credentials=''/path/to/smbcredentials/share'',x-systemd.automount 0 0<br />
}}<br />
<br />
==== As systemd unit ====<br />
Create a new {{ic|.mount}} file inside {{ic|/etc/systemd/system}}, e.g. {{ic|mnt-myshare.mount}}.<br />
<br />
{{ic|1=Requires=}} replace (if needed) with your [[:Category:Network_configuration|Network configuration]].<br />
<br />
{{ic|1=What=}} path to share<br />
<br />
{{ic|1=Where=}} path to mount the share<br />
<br />
{{ic|1=Options=}} share mounting options<br />
<br />
{{hc|/etc/systemd/system/mnt-myshare.mount|<nowiki><br />
[Unit]<br />
Description=Mount Share at boot<br />
Requires=systemd-networkd.service<br />
After=network-online.target<br />
Wants=network-online.target<br />
<br />
[Mount]<br />
What=//server/share<br />
Where=/mnt/myshare<br />
Options=credentials=/etc/samba/creds/myshare,iocharset=utf8,rw,x-systemd.automount<br />
Type=cifs<br />
TimeoutSec=30<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
To use {{ic|mnt-myshare.mount}}, [[start]] the unit and [[enable]] it to run on system boot.<br />
<br />
==== smbnetfs ====<br />
<br />
{{Note|1=smbnetfs needs an intact Samba server setup.<br />
See above on how to do that.}}<br />
<br />
First, check if you can see all the shares you are interested in mounting:<br />
$ smbtree -U ''remote_user''<br />
<br />
If that does not work, find and modify the following line<br />
in {{ic|/etc/samba/smb.conf}} accordingly:<br />
<br />
domain master = auto<br />
<br />
Now [[restart]] {{ic|smbd.service}} and {{ic|nmbd.service}}.<br />
<br />
If everything works as expected, [[pacman#Installing specific packages|install]] {{Pkg|smbnetfs}} from the official repositories.<br />
<br />
Then, add the following line to {{ic|/etc/fuse.conf}}:<br />
<br />
user_allow_other<br />
<br />
Now copy the directory {{ic|/etc/smbnetfs/.smb}} to your home directory:<br />
<br />
$ cp -a /etc/smbnetfs/.smb ~<br />
<br />
Then create a link to {{ic|smb.conf}}:<br />
<br />
$ ln -sf /etc/samba/smb.conf ~/.smb/smb.conf<br />
<br />
If a username and a password are required to access some of the shared folders, edit {{ic|~/.smb/smbnetfs.auth}}<br />
to include one or more entries like this:<br />
<br />
{{hc|~/.smb/smbnetfs.auth|<br />
auth "hostname" "username" "password"<br />
}}<br />
<br />
It is also possible to add entries for specific hosts to be mounted by smbnetfs, if necessary.<br />
More details can be found in {{ic|~/.smb/smbnetfs.conf}}.<br />
<br />
If you are using the [[Dolphin]] or [[GNOME/Files|GNOME Files]], you may want to add the following to {{ic|~/.smb/smbnetfs.conf}} to avoid "Disk full" errors as smbnetfs by default will report 0 bytes of free space:<br />
{{hc|~/.smb/smbnetfs.conf|<br />
free_space_size 1073741824<br />
}}<br />
<br />
When you are done with the configuration, you need to run<br />
$ chmod 600 ~/.smb/smbnetfs.*<br />
Otherwise, smbnetfs complains about 'insecure config file permissions'.<br />
<br />
Finally, to mount your Samba network neighbourhood to a directory of your choice, call<br />
$ smbnetfs ''mount_point''<br />
<br />
===== Daemon =====<br />
<br />
The Arch Linux package also maintains an additional system-wide operation mode for smbnetfs. To enable it, you need to make the<br />
said modifications in the directoy {{ic|/etc/smbnetfs/.smb}}.<br />
<br />
Then, you can start and/or enable the {{ic|smbnetfs}} [[daemon]] as usual. The system-wide mount point is at {{ic|/mnt/smbnet/}}.<br />
<br />
==== autofs ====<br />
<br />
See [[Autofs]] for information on the kernel-based automounter for Linux.<br />
<br />
=== File manager configuration ===<br />
<br />
==== GNOME Files, Nemo, Caja, Thunar and PCManFM ====<br />
<br />
In order to access samba shares through GNOME Files, Nemo, Caja, Thunar or PCManFM, install the {{Pkg|gvfs-smb}} package, available in the [[official repositories]].<br />
<br />
Press {{ic|Ctrl+l}} and enter {{ic|smb://''servername''/''share''}} in the location bar to access your share.<br />
<br />
The mounted share is likely to be present at {{ic|/run/user/''your_UID''/gvfs}} or {{ic|~/.gvfs}} in the filesystem.<br />
<br />
==== KDE ====<br />
<br />
KDE, has the ability to browse Samba shares built in. Therefore do not need any additional packages. However, for a GUI in the KDE System Settings, install the {{Pkg|kdenetwork-filesharing}} package from the official repositories.<br />
<br />
If when navigating with Dolphin you get a "Time Out" Error, you should uncomment and edit this line in smb.conf:{{bc|1=name resolve order = lmhosts bcast host wins}}<br />
as shown in this [http://ubuntuforums.org/showthread.php?t=1605499 page].<br />
<br />
==== Other graphical environments ====<br />
<br />
There are a number of useful programs, but they may need to have packages created for them. This can be done with the Arch package build system. The good thing about these others is that they do not require a particular environment to be installed to support them, and so they bring along less baggage.<br />
<br />
* {{Pkg|pyneighborhood}} is available in the official repositories.<br />
* LinNeighborhood, RUmba, xffm-samba plugin for Xffm are not available in the official repositories or the AUR. As they are not officially (or even unofficially supported), they may be obsolete and may not work at all.<br />
<br />
== Tips and tricks ==<br />
=== Block certain file extensions on Samba share ===<br />
{{Note|Setting this parameter will affect the performance of Samba, as it will be forced to check all files and directories for a match as they are scanned.}}<br />
Samba offers an option to block files with certain patterns, like file extensions. This option can be used to prevent dissemination of viruses or to dissuade users from wasting space with certain files. More information about this option can be found in {{ic|man smb.conf}}.<br />
<br />
{{hc|/etc/samba/smb.conf|2=<br />
...<br />
[myshare]<br />
comment = Private<br />
path = /mnt/data<br />
read only = no<br />
veto files = /*.exe/*.com/*.dll/*.bat/*.vbs/*.tmp/*.mp3/*.avi/*.mp4/*.wmv/*.wma/<br />
}}<br />
<br />
=== Discovering network shares ===<br />
If nothing is known about other systems on the local network, and automated tools such as [[#smbnetfs|smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares.<br />
<br />
1. First, install {{Pkg|nmap}} and {{Pkg|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{ic|nmap}} checks which ports are open:<br />
# nmap -p 139 -sT "192.168.1.*"<br />
<br />
In this case, a scan on the 192.168.1.* IP address range and port 139 has been performed, resulting in:<br />
{{hc<br />
|$ nmap -sT "192.168.1.*"<br />
|Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{ic|nmblookup}} to check for NetBIOS names: <br />
{{hc<br />
|$ nmblookup -A 192.168.1.1<br />
|Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{ic|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{hc<br />
|$ smbclient -L \\PUTER<br />
|<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
=== Remote control of Windows computer ===<br />
Samba offers a set of tools for communication with Windows. These can be handy if access to a Windows computer through remote desktop is not an option, as shown by some examples.<br />
<br />
Send shutdown command with a comment:<br />
<br />
$ net rpc shutdown -C "comment" -I IPADDRESS -U USERNAME%PASSWORD<br />
A forced shutdown instead can be invoked by changing -C with comment to a single -f. For a restart, only add -r, followed by a -C or -f.<br />
<br />
Stop and start services:<br />
<br />
$ net rpc service stop SERVICENAME -I IPADDRESS -U USERNAME%PASSWORD<br />
<br />
To see all possible net rpc command:<br />
<br />
$ net rpc<br />
<br />
===Share files without a username and password===<br />
Edit {{ic|/etc/samba/smb.conf}} and add the following line:<br />
{{bc|<nowiki>map to guest = Bad User</nowiki>}}<br />
<br />
After this line:<br />
{{bc|<nowiki>security = user</nowiki>}}<br />
<br />
Restrict the shares data to a specific interface replace:<br />
{{bc|<nowiki>; interfaces = 192.168.12.2/24 192.168.13.2/24</nowiki>}}<br />
<br />
with:<br />
<br />
{{bc|<nowiki><br />
interfaces = lo eth0<br />
bind interfaces only = true</nowiki>}}<br />
<br />
Optionally edit the account that access the shares, edit the following line:<br />
{{bc|<nowiki>; guest account = nobody</nowiki>}}<br />
<br />
For example:<br />
{{bc|<nowiki> guest account = pcguest</nowiki>}}<br />
<br />
And do something in the likes of:<br />
{{bc|<nowiki># useradd -c "Guest User" -d /dev/null -s /bin/false pcguest</nowiki>}}<br />
<br />
Then setup a "" password for user pcguest.<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
{{bc|<nowiki><br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
</nowiki>}}<br />
<br />
{{note|Make sure the guest also has permission to visit /path, /path/to and /path/to/public, according to [http://unix.stackexchange.com/questions/13858/do-the-parent-directorys-permissions-matter-when-accessing-a-subdirectory http://unix.stackexchange.com/questions/13858/do-the-parent-directorys-permissions-matter-when-accessing-a-subdirectory]}}<br />
<br />
==== Sample Passwordless Configuration ====<br />
This is the configuration I use with samba 4 for easy passwordless filesharing with family on a home network. Change any options needed to suit your network (workgroup and interface). I'm restricting it to the static IP I have on my ethernet interface, just delete that line if you do not care which interface is used.<br />
{{hc|/etc/samba/smb.conf|<nowiki><br />
[global]<br />
<br />
workgroup = WORKGROUP<br />
<br />
server string = Media Server<br />
<br />
security = user<br />
map to guest = Bad User<br />
<br />
log file = /var/log/samba/%m.log<br />
<br />
max log size = 50<br />
<br />
<br />
interfaces = 192.168.2.194/24<br />
<br />
<br />
dns proxy = no <br />
<br />
<br />
[media]<br />
path = /shares<br />
public = yes<br />
only guest = yes<br />
writable = yes<br />
<br />
[storage]<br />
path = /media/storage<br />
public = yes<br />
only guest = yes<br />
writable = yes<br />
</nowiki>}}<br />
<br />
=== Build Samba without CUPS ===<br />
<br />
Just build without cups installed. From the [https://wiki.samba.org/index.php/Samba_as_a_print_server Samba Wiki]:<br />
<blockquote>Samba has built-in support [for CUPS] and defaults to CUPS if the development package (aka header files and libraries) could be found at compile time.</blockquote><br />
<br />
Of course, modifications to the PKGBUILD will also be necessary: libcups will have to be removed from the depends and makedepends arrays and other references to cups and printing will need to be deleted. In the case of the 4.1.9-1 PKGBUILD, 'other references' includes lines 169, 170 and 236:<br />
{{bc|<br />
mkdir -p ${pkgdir}/usr/lib/cups/backend<br />
ln -sf /usr/bin/smbspool ${pkgdir}/usr/lib/cups/backend/smb<br />
install -d -m1777 ${pkgdir}/var/spool/samba<br />
}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Failed to start Samba SMB/CIFS server ===<br />
<br />
Check if the permissions are set correctly for {{ic|/var/cache/samba/}} and restart the {{ic|smbd.service}} or {{ic|smbd.socket}}:<br />
# chmod 0755 /var/cache/samba/msg<br />
<br />
=== Unable to overwrite files, permissions errors ===<br />
Possible solutions:<br />
*Append the mount option {{ic|nodfs}} to the {{ic|/etc/fstab}} [[#Add_Share_to_.2Fetc.2Ffstab|entry]].<br />
*Add {{ic|<nowiki>msdfs root = no</nowiki>}} to the {{ic|[global]}} section of the server's {{ic|/etc/samba/smb.conf}}.<br />
<br />
=== Windows clients keep asking for password even if Samba shares are created with guest permissions ===<br />
Set {{ic|map to guest}} inside the {{ic|global}} section of {{ic|/etc/samba/smb.conf}}:<br />
map to guest = Bad User<br />
<br />
=== Windows 7 connectivity problems - mount error(12): cannot allocate memory ===<br />
<br />
A known Windows 7 bug that causes "mount error(12): cannot allocate memory" on an otherwise perfect cifs share on the Linux end can be fixed by setting a few registry keys on the Windows box as follows:<br />
<br />
*{{ic|HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\LargeSystemCache}} (set to {{ic|1}})<br />
*{{ic|HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\Size}} (set to {{ic|3}})<br />
<br />
Alternatively, start Command Prompt in Admin Mode and execute the following:<br />
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v "LargeSystemCache" /t REG_DWORD /d 1 /f<br />
reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" /v "Size" /t REG_DWORD /d 3 /f<br />
<br />
Do one of the following for the settings to take effect:<br />
* Restart Windows<br />
* Restart the Server service via services.msc<br />
* From the Command Prompt run: 'net stop lanmanserver' and 'net start lanmanserver' - The server may automatically restart after stopping it.<br />
<br />
{{Note|Googling will reveal another tweak recommending users to add a key modifying the "IRPStackSize" size. This is incorrect for fixing this issue under Windows 7. Do not attempt it.}}<br />
<br />
[http://alan.lamielle.net/2009/09/03/windows-7-nonpaged-pool-srv-error-2017 Original article].<br />
<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
{{Note|This needs to be added to the '''local smb.conf''', not to the server's smb.conf}}<br />
<br />
For trouble accessing a password protected share from Windows, try adding this to {{ic|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
This keeps samba from asking cups and also from complaining about /etc/printcap missing:<br />
<br />
printing = bsd<br />
printcap name = /dev/null<br />
<br />
=== Error: Failed to retrieve printer list: NT_STATUS_UNSUCCESSFUL ===<br />
<br />
If you are a home user and using samba purely for file sharing from a server or NAS, you are probably not interested in sharing printers through it. If so, you can prevent this error from occurring by adding the following lines to your {{ic|/etc/samba/smb.conf}}:<br />
{{bc|<nowiki><br />
load printers = No<br />
printing = bsd<br />
printcap name = /dev/null<br />
disable spoolss = Yes<br />
</nowiki>}}<br />
[[Restart]] the samba service, {{ic|smbd.service}}, and then check your logs:<br />
{{bc|cat /var/log/samba/smbd.log}}<br />
and the error should now no longer be appearing.<br />
<br />
=== Sharing a folder fails ===<br />
<br />
It means that while you are sharing a folder from ''Dolphin'' (file manager) and everything seems ok at first, after restarting ''Dolphin'' the share icon is gone from the shared folder, and also some output like this in terminal (''Konsole'') output:<br />
<br />
‘net usershare’ returned error 255: net usershare: usershares are currently disabled<br />
<br />
To fix it, enable usershare as described in [[#Creating usershare path]].<br />
<br />
=== "Browsing" network fails with "Failed to retrieve share list from server" ===<br />
And you are using a firewall (iptables) because you do not trust your local (school, university, hotel) local network. This may be due to the following: When the smbclient is browsing the local network it sends out a broadcast request on udp port 137. The servers on the network then reply to your client but as the source address of this reply is different from the destination address iptables saw when sending the request for the listing out, iptables will not recognize the reply as being "ESTABLISHED" or "RELATED", and hence the packet is dropped. A possible solution is to add:{{bc|<br />
iptables -t raw -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns<br />
}}<br />
to your iptables setup.<br />
<br />
=== You are not the owner of the folder ===<br />
<br />
Simply try to reboot the system.<br />
<br />
=== protocol negotiation failed: NT_STATUS_INVALID_NETWORK_RESPONSE ===<br />
<br />
The client probably does not have access to shares. Make sure clients' IP address is in {{ic|1=hosts allow =}} line in {{ic|/etc/samba/smb.conf}}.<br />
<br />
=== Connection to SERVER failed: (Error NT_STATUS_UNSUCCESSFUL) ===<br />
<br />
You are probably passing wrong server name to {{ic|smbclient}}. To find out the server name, run {{ic|hostnamectl}} on the server and look at "Transient hostname" line<br />
<br />
=== Connection to SERVER failed: (Error NT_STATUS_CONNECTION_REFUSED) ===<br />
<br />
Make sure that the server has started. The shared directories should exist and be accessible.<br />
<br />
== See also ==<br />
<br />
* [http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]<br />
* [http://www.samba.org/ Official Samba site]</div>Zibi92https://wiki.archlinux.org/index.php?title=CUPS&diff=247980CUPS2013-02-20T14:31:48Z<p>Zibi92: /* Printer is not recognized by CUPS */</p>
<hr />
<div>[[Category:Printers]]<br />
[[cs:CUPS]]<br />
[[es:CUPS]]<br />
[[fr:CUPS]]<br />
[[it:CUPS]]<br />
[[pl:CUPS]]<br />
[[ru:CUPS]]<br />
[[th:CUPS]]<br />
[[tr:CUPS]]<br />
[[zh-CN:CUPS]]<br />
[[zh-TW:CUPS]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Installing and configuring CUPS}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|CUPS printer sharing}}<br />
{{Article summary wiki|CUPS printer-specific problems}}<br />
{{Article summary wiki|Samba}}<br />
{{Article summary end}}<br />
<br />
From [http://www.cups.org/index.php CUPS' site]:<br />
:"''[[Wikipedia:CUPS|CUPS]] is the standards-based, open source printing system developed by Apple Inc. for OS® X and other UNIX®-like operating systems''".<br />
<br />
Although there are other printing packages such as LPRNG, the Common Unix Printing System is the most popular choice because of its relative ease of use.<br />
<br />
==CUPS Linux Printing workflow==<br />
As of {{Pkg|cups}} version 1.5.3-3, Arch Linux makes use of the new full pdf-based printing workflow. For<br />
further reading check [http://www.linuxfoundation.org/collaborate/workgroups/openprinting/pdfasstandardprintjobformat PDF standard printing job format] and an old [https://wiki.linuxfoundation.org/en/OpenPrinting/Database/CUPS-Filter-Chart CUPS filtering chart] for history and fun.<br />
A good starting point for general Linux printing questions is [http://www.linuxfoundation.org/collaborate/workgroups/openprinting here].<br />
<br />
There are two ways to setup a printer.<br />
* If there's a CUPS server running in your network and sharing a printer you only need to install the client package.<br />
* If the printer is connected directly to your system or you have access to an IPP network printer then setup a local CUPS server.<br />
<br />
==Installing the client package==<br />
The package {{Pkg|libcups}} is the only required package. [[pacman|Install]] it from the [[Official repositories]].<br />
<br />
Then add your CUPS server's IP address or hostname into {{ic|/etc/cups/client.conf}}. That is all you need. Every application should quickly find the printer(s) shared by that CUPS server.<br />
<br />
===Optional advanced network setup===<br />
It is also possible to run a entire cupsd+cups-browsed instance on your client with Avahi browsing enabled to discover unknown shared printers in your network. This can be useful in large setups where the server is unknown.<br />
{{Note|This behavior did not change with cups 1.6.x - the difference is that until 1.5.x cupsd was able to do printer browsing alone and now it can only browse its own shared printers.<br />
To get the local cupsd recognise other shared printers offered by a remote cupsd server you need a running local cups-browserd (supported since cups-filters 1.0.26) instance using Avahi to discover unknown printers.}}<br />
<br />
==Installing the server packages==<br />
The following packages and some printer drivers are needed. [[pacman|Install]] them from the [[Official repositories]].<br />
<br />
* {{Pkg|cups}} - the actual CUPS daemon<br />
* {{Pkg|cups-filters}} - essential filters<br />
* {{Pkg|ghostscript}} - (optional) PostScript interpreter<br />
* {{Pkg|gsfonts}} - GhostScript standard Type1 fonts<br />
<br />
# pacman -S cups cups-filters ghostscript gsfonts<br />
<br />
If you want to enable printer browsing through your network, also install {{Pkg|avahi}}. Make sure '''avahi-daemon''' is started before '''cupsd'''.<br />
<br />
If the system is connected to a networked printer using the [[Samba]] protocol or if the system is to be a print server for Windows clients, also install {{Pkg|samba}}.<br />
<br />
===Printer driver===<br />
Here are some of the driver packages. Choosing the right driver depends on the printer:<br />
<br />
* '''{{Pkg|gutenprint}}''' - A collection of high quality drivers for Canon, Epson, Lexmark, Sony, Olympus, and PCL printers for use with GhostScript, CUPS, Foomatic, and the [[GIMP]]<br />
* '''{{Pkg|foomatic-db}}, {{Pkg|foomatic-db-engine}}, {{Pkg|foomatic-db-nonfree}}, and {{Pkg|foomatic-filters}}''' - Foomatic is a database-driven system for integrating free software printer drivers with common spoolers under Unix. Installing foomatic-filters should solve problems if the cups error_log is reporting "stopped with status 22!".<br />
* '''{{Pkg|hplip}}''' - HP drivers for DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet printer models, as well as a number of Brother printers.<br />
* '''{{Pkg|splix}}''' - Samsung drivers for SPL (Samsung Printer Language) printers.<br />
<br />
* '''{{AUR|foo2zjs}}''' - Drivers for ZjStream protocol printers such as the HP Laserjet 1018. More info [http://foo2zjs.rkkda.com here]. Package is available in the [[AUR]].<br />
* '''{{AUR|hpoj}}''' - If you are using an HP Officejet, you should also install this package and follow the instructions to avoid problems as in [https://answers.launchpad.net/hplip/+question/133425 this thread]. Package is available in the [[AUR]].<br />
* '''{{AUR|samsung-unified-driver}}''' - Unified Linux Driver for Samsung printers and scanners. Required for new printers such as the ML-2160. Package is available in the [[AUR]].<br />
* '''{{AUR|ufr2}}''' or '''{{AUR|cndrvcups-lb}}''' - Canon UFR2 driver with support for LBP, iR and MF series printers. Package is available in the [[AUR]].<br />
<br />
* '''{{Pkg|cups-pdf}}''' - A package that allows one to setup a virtual PDF Printer that generates a PDF out of jobs sent to it<br />
<br />
If you are not sure of what driver package to install or if the current driver is not working, it may be easiest to just install all of the drivers. Some of the package names are misleading because printers of other makes may rely on them. For example, the Brother HL-2140 needs the hplip driver installed.<br />
<br />
====Download printer PPD====<br />
Depending on the printer, this step is optional and may not be needed, as the standard CUPS installation already comes with quite a few PPD (Postscript Printer Description) files. Moreover, the ''foomatic-filters'', ''gimp-print'' and ''hplip'' packages already include quite a few PPD files which will automatically be detected by CUPS.<br />
<br />
Here is an explanation of what a PPD file is from the Linux Printing website:<br />
:"''For every PostScript printer the manufacturers provide a PPD file which contains all printer-specific information about the particular printer model: Basic printer capabilities as whether the printer is a color printer, fonts, PostScript level, etc., and especially the user-adjustable options, as paper size, resolution, etc.''"<br />
<br />
If the PPD for the printer is ''not'' already in CUPS, then:<br />
*check [[AUR]] to see if there are packages for the printer/manufacturer<br />
*visit the [http://www.openprinting.org/printers OpenPrinting database] and select the manufacturer and model of the printer<br />
*visit the manufacturer's site and search for GNU/Linux drivers<br />
<br />
{{Note|PPD files go in {{ic|/usr/share/cups/model/}}}}<br />
<br />
====Another source for printer drivers====<br />
[http://www.turboprint.de/english.html Turboprint] is a proprietary driver for many printers not yet supported by GNU/Linux (Canon i*, for example). Unlike CUPS, however, high quality prints are either marked with a watermark or are a pay-only service.<br />
<br />
==Hardware support and configuration==<br />
<br />
USB printers can get accessed with two methods: The usblp kernel module and libusb. The former is the classic way. It is simple: data is sent to the printer by writing it to a device file as a simple serial data stream. Reading the same device file allows bi-di access, at least for things like reading out ink levels, status, or printer capability information (PJL). It works very well for simple printers, but for multi-function devices (printer/scanner) it is not suitable and manufacturers like HP supply their own backends. Source: [http://lists.linuxfoundation.org/pipermail/printing-architecture/2012/002412.html here].<br />
<br />
===Kernel modules===<br />
Before using the CUPS web interface, the appropriate kernel modules need to be installed. The following steps are from the Gentoo Printing Guide.<br />
<br />
This section may not be necessary, however, depending on which kernel is being used. The kernel module may load automatically after plugging in the printer. Use the {{ic|tail}} command (described below) to see if the printer has already been detected. The {{ic|lsmod}} utility can also be used to see what modules have been loaded.<br />
<br />
====USB printers====<br />
{{Warning|As of {{pkg|cups}} version 1.6.0, you no longer need to [[Kernel modules#Blacklisting|blacklist]] the {{ic|usblp}} kernel module.}}<br />
If you find out this is the only way to fix a remaining issue please report this upstream to the CUPS bug tracker and maybe also get in contact with Till Kamppeter (Debian CUPS maintainer). See [http://cups.org/str.php?L4128 upstream bug] for more.<br />
<br />
Some USB printer users may want to try if blacklisting the {{ic|usblp}} module would help:<br />
<br />
{{hc|/etc/modprobe.d/blacklist.conf|blacklist usblp}}<br />
<br />
Custom kernel users may need to manually load the {{ic|usbcore}} module before proceeding:<br />
# modprobe usbcore<br />
<br />
Once the modules are installed, plug in the printer and check if the kernel detected it by running the following:<br />
# tail /var/log/messages.log<br />
or<br />
# dmesg<br />
<br />
If you're using {{ic|usblp}}, the output should indicate that the printer has been detected like so:<br />
Feb 19 20:17:11 kernel: printer.c: usblp0: USB Bidirectional<br />
printer dev 2 if 0 alt 0 proto 2 vid 0x04E8 pid 0x300E<br />
Feb 19 20:17:11 kernel: usb.c: usblp driver claimed interface cfef3920<br />
Feb 19 20:17:11 kernel: printer.c: v0.13: USB Printer Device Class driver<br />
<br />
If you blacklisted {{ic|usblp}}, you will see something like:<br />
usb 3-2: new full speed USB device using uhci_hcd and address 3<br />
usb 3-2: configuration #1 chosen from 1 choice<br />
<br />
====Parallel port printers====<br />
To use a parallel port printer the configuration is pretty much the same, except for the modules:<br />
# modprobe lp<br />
# modprobe parport<br />
# modprobe parport_pc<br />
<br />
Once again, check the setup by running:<br />
# tail /var/log/messages.log<br />
It should display something like this:<br />
lp0: using parport0 (polling).<br />
<br />
If you are using a USB to parallel port adapter, CUPS will not be able to detect the printer. As a workaround, add the printer using a different connection type and then change DeviceID in {{ic|/etc/cups/printers.conf}}:<br />
DeviceID = parallel:/dev/usb/lp0<br />
<br />
====Auto-loading====<br />
It is convenient to have the system automatically load the kernel module every time it starts up. To do so, use a text editor to open up {{ic|/etc/modules-load.d/printing.conf}} and add the appropriate modules one per line. Here is an example:<br />
lp<br />
parport<br />
parport_pc<br />
<br />
=== HP Printer ===<br />
HP printers can also be installed via HP's linux setup tool. If you want to run the setup tool, ensure you have {{ic|python-qt2}} and {{ic|pygobject}}.<br />
<br />
To run with qt frontend :<br />
{{bc|<nowiki><br />
# hp-setup -u<br />
</nowiki>}}<br />
<br />
To run with command line : <br />
{{bc|<nowiki><br />
# hp-setup -i<br />
</nowiki>}}<br />
<br />
==Configuring==<br />
Now that CUPS is installed, there are a variety of options on how to set up printing solutions. As always, the tried and true command line method is at your disposal. CUPS also embeds a full-featured web interface. Likewise, various desktop environments such as GNOME and KDE have useful programs that can help manage printers. Depending on your needs, you may choose one method or the other.<br />
<br />
If you are planning on connecting to a network printer, rather than one that is directly connected to the computer, you might want to read the [[CUPS printer sharing]] page first. Printer sharing between GNU/Linux systems is quite easy and involves very little configuration, whereas sharing between a Windows and GNU/Linux host requires a little bit more effort.<br />
<br />
===CUPS daemon===<br />
With the kernel modules installed, you can now start the '''cups''' and optionally, the '''cups-browsed''' [[daemons]].<br />
<br />
=== Web interface and tool-kit ===<br />
<br />
Once the daemon is running, open a browser and go to: http://localhost:631 (''The '''localhost''' string may need to be replaced with the hostname found in'' {{ic|/etc/hosts}}).<br />
<br />
From here, follow the various wizards to add the printer. A usual procedure is to start by clicking on ''Adding Printers and Classes'' and then ''Add Printer''. When prompted for a username and password, log in as root. The name assigned to the printer does not matter, the same applies for 'location' and 'description'. Next, a list of devices to select from will be presented. The actual name of the printer shows up next to the label (e.g., next to ''USB Printer #1'' for USB printers). Finally, choose the appropriate drivers and the configuration is complete.<br />
<br />
Now test the configuration by pressing the ''Maintenance'' drop-down menu then ''Print Test Page''. If it does not print and there is certainty regarding the correctness of applied settings, then the problem is most likely due to missing a proper printer driver.<br />
<br />
{{Tip|See: [[#Alternative CUPS interfaces]] for other other front-ends.}}<br />
{{Note|When setting up a USB printer, you should see your printer listed on ''Add Printer'' page. If you can only see a "SCSI printer" option, it probably means that CUPS has failed to recognize <br />
your printer.}}<br />
<br />
{{Note|To enable wireless scanning on certain HP multi-function devices using the {{pkg|hplip}} package, you may need to add the printer as a Network Printer using the http:// protocol. To determine the proper URI to use, run the {{ic|hp-makeuri}} command.}}<br />
<br />
==== CUPS administration ====<br />
<br />
A username and password will be required when administering the printer in the web interface, such as: adding or removing printers, stopping print tasks, etc. The default username is the one assigned in the ''sys'' group, or root (change this by editing {{ic|/etc/cups/cupsd.conf}} in the line of {{ic|SystemGroup}}). <br />
<br />
If the root account has been locked (i.e. when using sudo), it is not possible to log in the CUPS administration interface with the default username and password. In this case, follow [http://www.cups.org/articles.php?L237+T+Qprintadmin these instructions] on the CUPS FAQ. You might also want to read [https://bbs.archlinux.org/viewtopic.php?id=35567 this post].<br />
<br />
====Remote access to web interface====<br />
By default, the CUPS web interface can only be accessed by the ''localhost''; i.e. the computer that it is installed on. To remotely access the interface, make the following changes to the {{ic|/etc/cups/cupsd.conf}} file. Replace the line:<br />
Listen localhost:631<br />
with<br />
Port 631<br />
so that CUPS listens to incoming requests.<br />
<br />
Three levels of access can be granted:<br />
<Location /> #access to the server<br />
<Location /admin> #access to the admin pages<br />
<Location /admin/conf> #access to configuration files<br />
<br />
To give remote hosts access to one of these levels, add an {{ic|Allow}} statement to that level's section. An {{ic|Allow}} statement can take one or more of the forms listed below:<br />
Allow from all<br />
Allow from host.domain.com<br />
Allow from *.domain.com<br />
Allow from ip-address<br />
Allow from ip-address/netmask<br />
<br />
Deny statements can also be used. For example, if wanting to give all hosts on the 192.168.1.0/255.255.255.0 subnet full access, file {{ic|/etc/cups/cupsd.conf}} would include this:<br />
# Restrict access to the server...<br />
# By default only localhost connections are possible<br />
<Location /><br />
Order allow,deny<br />
Allow from localhost<br />
'''Allow from 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to the admin pages...<br />
<Location /admin><br />
# Encryption disabled by default<br />
#Encryption Required<br />
Order allow,deny<br />
Allow from localhost<br />
'''Allow from 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to configuration files...<br />
<Location /admin/conf><br />
AuthType Basic<br />
Require user @SYSTEM<br />
Order allow,deny<br />
Allow From localhost<br />
'''Allow From 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
You might also need to add:<br />
<br />
DefaultEncryption Never<br />
<br />
This should avoid the error: 426 - Upgrade Required when using the CUPS web interface from a remote machine.<br />
<br />
===Command-line configuration===<br />
<br />
CUPS can be fully controlled from command-line with nice tools, ''i.e.'' the lp* and the cups* command families.<br />
<br />
On Arch Linux, most commands support auto-completion with common shells.<br />
Also note that command-line switches cannot be grouped.<br />
<br />
;List the devices<br />
# lpinfo -v<br />
<br />
;List the drivers<br />
# lpinfo -m<br />
<br />
;Add a new printer<br />
# lpadmin -p <printer> -E -v <device> -P <ppd><br />
<br />
The <printer> is up to you. The device can be retrieved from the 'lpinfo -i' command.<br />
Example:<br />
# lpadmin -p HP_DESKJET_940C -E -v "usb://HP/DESKJET%20940C?serial=CN16E6C364BH" -P /usr/share/ppd/HP/hp-deskjet_940c.ppd.gz<br />
<br />
In the following, the <printer> references the name you have used here to set up the printer.<br />
<br />
;Set the default printer<br />
$ lpoptions -d <printer><br />
<br />
;Check the status<br />
$ lpstat -s<br />
$ lpstat -p <printer><br />
<br />
;Deactivate a printer<br />
# cupsdisable <printer><br />
<br />
;Activate a printer<br />
# cupsenable <printer><br />
<br />
;Remove a printer<br />
First set it to reject all incoming entries:<br />
# cupsreject <printer><br />
Then disable it.<br />
# cupsdisable <printer><br />
Finally remove it.<br />
# lpadmin -x <printer><br />
<br />
;Print a file<br />
$ lpr <file><br />
$ lpr -# 17 <file> # print the file 17 times<br />
$ echo "Hello, world!" | lpr -p # print the result of a command. The -p switch adds a header.<br />
<br />
;Check the printing queue<br />
$ lpq<br />
$ lpq -a # on all printers<br />
<br />
;Clear the printing queue<br />
# lprm # remove last entry only<br />
# lprm - # remove all entries<br />
<br />
===GNOME CUPS interface===<br />
If using [[GNOME]], a possibility is to manage and configure the printer by [[pacman|installing]] {{Pkg|system-config-printer}}.<br />
<br />
For system-config-printer to work as it should, running as root may be required, or alternatively set up a "normal" user to administer CUPS (if so '''follow steps 1-3''')<br />
<br />
* 1. Create group, and add a user to it<br />
# groupadd lpadmin<br />
# usermod -aG lpadmin <username><br />
<br />
* 2. Add "lpadmin" (without the quotes) to this line in {{ic|/etc/cups/cupsd.conf}}<br />
SystemGroup sys root <insert here><br />
<br />
* 3. Restart cups, log out and in again (or restart computer)<br />
{{bc|# systemctl restart cups}}<br />
<br />
[[KDE]] users can modify their printers from the Control Center. Both should refer to those desktop environments' documentation for more information on how to use the interfaces.<br />
<br />
There is also {{AUR|gtklp}} in the [[AUR]].<br />
<br />
==PDF virtual printer==<br />
CUPS-PDF is a nice package that allows one to setup a virtual printer that will generate a PDF from anything sent to it. Obviously this package is not necessary, but it can be quite useful.<br />
<br />
Find generated PDF documents in a sub-directory located at {{ic|/var/spool/cups-pdf}}. Normally, the subdirectory is named after the user who performed the job. A little tweak helps you to find your printed PDF documents more easily. Edit {{ic|/etc/cups/cups-pdf.conf}} by changing the line<br />
#Out /var/spool/cups-pdf/${USER}<br />
<br />
to<br />
<br />
Out /home/${USER}<br />
<br />
This package can be installed by the following command:<br />
# pacman -S cups-pdf<br />
<br />
After installing the package, set it up as if it were for any other printer by using the web interface. For the Device, select '''CUPS-PDF (Virtual PDF Printer)'''; Make/Manufacturer, choose '''Generic'''; Model/Driver, select '''Generic postscript color printer''' or '''Generic Cups-PDF Printer'''. Alternatively, provide the PPD file from [http://www.physik.uni-wuerzburg.de/~vrbehr/cups-pdf/cups-pdf-CURRENT/extra/CUPS-PDF.ppd this link].<br />
<br />
=== Print to PostScript: CUPS-PDF virtual printer trick ===<br />
<br />
Printing to PDF in most applications like OpenOffice is no problem; just hit the button. Yet when printing out to postscript, matters take a little more work. For applications like OpenOffice where printing to kprinter is nebulous at best, there has to be another way&mdash;and there is. The CUPS-PDF (Virtual PDF Printer) actually creates a PostScript file and then creates the PDF using the ps2pdf utility. To print to postscript, what needs to be done is capturing the intermediate postscript file created by CUPS-PDF. This is easily accomplished with by selecting the "print to file" option in the print dialog. (choose either .ps or .eps as the extension) After selecting the "print to file" checkbox simply enter the file name and click "print".<br />
<br />
===Configuring CUPS-PDF virtual printer===<br />
#Set up the CUPS daemon using the instructions on this page.<br />
#Install {{Pkg|cups-pdf}} from the [[Official Repositories|official repositories]].<br />
#Access the cups print manager: http://localhost:631 and select:<br />
Administration -> Add Printer<br />
Select CUPS-PDF (Virtual PDF), choose for the make and driver:<br />
Make: Generic<br />
Driver: Generic CUPS-PDF Printer<br />
<br />
Now to print to PostScript, just print as usual, in the print dialog choose "CUPS-PDF" as the printer, then select the checkbox for "print to file", hit print, enter the filename.ps and click save. This is handy for faxes, etc...<br />
<br />
==Troubleshooting==<br />
The best way to get printing working is to set 'LogLevel' in {{ic|/etc/cups/cupsd.conf}} to:<br />
LogLevel debug<br />
<br />
And then viewing the output from {{ic|/var/log/cups/error_log}} like this:<br />
# tail -n 100 -f /var/log/cups/error_log<br />
<br />
The characters at the left of the output stand for:<br />
*D=Debug<br />
*E=Error<br />
*I=Information<br />
*And so on<br />
<br />
These files may also prove useful:<br />
*{{ic|/var/log/cups/page_log}} - Echoes a new entry each time a print is successful<br />
*{{ic|/var/log/cups/access_log}} - Lists all cupsd http1.1 server activity<br />
<br />
Of course, it is important to know how CUPS works if wanting to solve related issues:<br />
# An application sends a .ps file (PostScript, a script language that details how the page will look) to CUPS when 'print' has been selected (this is the case with most programs).<br />
# CUPS then looks at the printer's PPD file (printer description file) and figures out what filters it needs to use to convert the .ps file to a language that the printer understands (like PJL, PCL), usually GhostScript.<br />
# GhostScript takes the input and figures out which filters it should use, then applies them and converts the .ps file to a format understood by the printer.<br />
# Then it is sent to the back-end. For example, if the printer is connected to a USB port, it uses the USB back-end.<br />
<br />
Print a document and watch {{ic|error_log}} to get a more detailed and correct image of the printing process.<br />
<br />
===Problems resulting from upgrades===<br />
''Issues that appeared after CUPS and related program packages underwent a version increment''<br />
<br />
====CUPS stops working====<br />
The chances are that a new configuration file is needed for the new version to work properly. Messages such as "404 - page not found" may result from trying to manage CUPS via localhost:631, for example.<br />
<br />
To use the new configuration, copy {{ic|/etc/cups/cupsd.conf.default}} to {{ic|/etc/cups/cupsd.conf}} (backup the old configuration if needed) and restart CUPS to employ the new settings.<br />
<br />
====All jobs are "stopped"====<br />
If all jobs sent to the printer become "stopped", delete the printer and add it again.<br />
Using the [http://localhost:631 CUPS web interface], go to Printers > Delete Printer.<br />
<br />
To check the printer's settings go to ''Printers'', then ''Modify Printer''. Copy down the information displayed, click 'Modify Printer' to proceed to the next page(s), and so on.<br />
<br />
====All jobs are "The printer is not responding"====<br />
On networked printers, you should check that the name that CUPS uses as its connection URI resolves to the printer's IP via DNS, e.g.<br />
If your printer's connection looks like this:<br />
lpd://BRN_020554/BINARY_P1<br />
<br />
then the hostname 'BRN_020554' needs to resolve to the printer's IP from the server running CUPS<br />
<br />
====The PPD version is not compatible with gutenprint====<br />
Run:<br />
# /usr/sbin/cups-genppdupdate<br />
<br />
And restart CUPS (as pointed out in gutenprint's post-install message)<br />
<br />
===Other===<br />
<br />
=====CUPS permission errors=====<br />
*Some users fixed 'NT_STATUS_ACCESS_DENIED' (Windows clients) errors by using a slightly different syntax:<br />
smb://workgroup/username:password@hostname/printer_name<br />
<br />
*Sometimes, the block device has wrong permissions:<br />
# ls /dev/usb/<br />
lp0<br />
# chgrp lp /dev/usb/lp0<br />
<br />
====HPLIP printer sends "/usr/lib/cups/backend/hp failed" error====<br />
Make sure dbus is installed and running. If the error persists, try starting avahi-daemon.<br />
<br />
Try adding the printer as a Network Printer using the http:// protocol. Generate the printer URI with {{ic|hp-makeuri}}.<br />
<br />
{{Note|There might need to set permissions issues right. Follow indications here: [[CUPS#Device node permissions]].}}<br />
<br />
====HPLIP printer claims job is complete but printer does nothing====<br />
This happens on HP printers when you select the (old) hpijs driver (e.g. the Deskjet D1600 series). Instead, use the hpcups driver when adding the printer.<br />
<br />
Some HP printers (e.g HP LaserJet) require their firmware to be downloaded from the computer every time the printer is switched on. If there is an issue with udev (or equivalent) and the firmware download rule is never fired, you may experience this issue.<br />
As a workaround, you can manually download the firmware to the printer. Ensure the printer is plugged in and switched on, then enter<br />
hp-firmware -n<br />
<br />
====hp-toolbox sends an error, "Unable to communicate with device"====<br />
If running hp-toolbox as a regular user results in:<br />
# hp-toolbox<br />
# error: Unable to communicate with device (code=12): hp:/usb/<printer id><br />
or, "{{ic|Unable to communicate with device"}}", then it may be needed to [[Groups#Group management|add the user to the lp and sys groups]].<br />
<br />
This can also be caused by printers such as the P1102 that provide a virtual cd-rom drive for MS-Windows drivers. The lp dev appears and then disappears. In that case try the '''usb-modeswitch''' and '''usb-modeswitch-data''' packages, that lets one switch off the "Smart Drive" (udev rules included in said packages).<br />
<br />
This can also occur with network attached printers if the [[Avahi|avahi-daemon]] is not running.<br />
<br />
====CUPS returns '"foomatic-rip" not available/stopped with status 3' with a HP printer====<br />
If receiving any of the following error messages in {{ic|/var/log/cups/error_log}} while using a HP printer, with jobs appearing to be processed while they all end up not being completed with their status set to 'stopped':<br />
Filter "foomatic-rip" for printer "<printer_name>" not available: No such file or director<br />
or:<br />
PID 5771 (/usr/lib/cups/filter/foomatic-rip) stopped with status 3!<br />
make sure {{pkg|hplip}} has been [[pacman|installed]], in addition to [[#Packages|the packages mentioned above]]. See [https://bbs.archlinux.org/viewtopic.php?id=65615 this forum post] for more information.<br />
<br />
====Printing fails with unauthorised error====<br />
If the user has been added to the lp group, and allowed to print (set in {{ic|cupsd.conf}}), then the problem lies in {{ic|/etc/cups/printers.conf}}. This line could be the culprit:<br />
AuthInfoRequired negotiate<br />
<br />
Comment it out and restart CUPS.<br />
<br />
====Print button greyed-out in GNOME print dialogs====<br />
:''<small>Source: [https://bbs.archlinux.org/viewtopic.php?id=70418 I can't print from gnome applications. - Arch Forums]</small>''<br />
<br />
Be sure the package: '''libgnomeprint''' is installed<br />
<br />
Edit {{ic|/etc/cups/cupsd.conf}} and add<br />
# HostNameLookups Double<br />
<br />
Restart CUPS:<br />
# systemctl restart cups<br />
<br />
====Unknown supported format: application/postscript====<br />
Comment the lines:<br />
application/octet-stream application/vnd.cups-raw 0 -<br />
from {{ic|/etc/cups/mime.convs}}, and:<br />
application/octet-stream<br />
in {{ic|/etc/cups/mime.types}}.<br />
<br />
====Finding URIs for Windows Print Servers====<br />
<br />
Sometimes Windows is a little less than forthcoming about exact device URIs (device locations). If having trouble specifying the correct device location in CUPS, run the following command to list all shares available to a certain windows username:<br />
$ smbtree -U ''windowsusername''<br />
This will list every share available to a certain Windows username on the local area network subnet, as long as Samba is set up and running properly. It should return something like this:<br />
{{bc| WORKGROUP<br />
\\REGULATOR-PC <br />
\\REGULATOR-PC\Z <br />
\\REGULATOR-PC\Public <br />
\\REGULATOR-PC\print$ Printer Drivers<br />
\\REGULATOR-PC\G <br />
\\REGULATOR-PC\EPSON Stylus CX8400 Series EPSON Stylus CX8400 Series}}<br />
What is needed here is first part of the last line, the resource matching the printer description. So to print to the EPSON Stylus printer, one would enter:<br />
smb://username.password@REGULATOR-PC/EPSON Stylus CX8400 Series<br />
as the URI into CUPS. Notice that whitespaces are allowed in URIs, whereas backslashes get replaced with forward slashes.<br />
If it won't work try '%20' instead of spaces.<br />
<br />
====Print-Job client-error-document-format-not-supported====<br />
Try installing the foomatic packages and use a foomatic driver.<br />
<br />
====/usr/lib/cups/backend/hp failed====<br />
Change<br />
SystemGroup sys root<br />
to<br />
SystemGroup lp root<br />
in {{ic|/etc/cups/cupsd.conf}}<br />
<br />
<br />
Following steps 1-3 in the Alternative CUPS interfaces below may be a better solution, since newer versions of cups will not allow the same group for both normal and admin operation.<br />
<br />
===="Unable to get list of printer drivers"====<br />
Try to remove Foomatic drivers.<br />
<br />
====lp: Error - Scheduler Not Responding====<br />
If you get this error when printing a document using:<br />
<br />
$ lp document-to-print<br />
<br />
Try setting the CUPS_SERVER environment variable:<br />
<br />
$ export CUPS_SERVER=localhost<br />
<br />
If this solves your problem, make the solution permanent by adding the export line above to ~/.bash_profile.<br />
<br />
====CUPS prints only an empty and an error-message page on HP LaserJet====<br />
<br />
There is a bug that causes CUPS to fail when printing images on HP LaserJet (in my case 3380). The bug has been reported and fixed by [https://bugs.launchpad.net/ubuntu/+source/cups-filters/+bug/998087 Ubuntu].<br />
The first page is empty, the second page contains the following error message:<br />
ERROR:<br />
invalidaccess<br />
OFFENDING COMMAND:<br />
filter<br />
STACK:<br />
/SubFileDecode<br />
endstream<br />
...<br />
<br />
In order to fix the issue, use the following command (as superuser):<br />
lpadmin -p <printer> -o pdftops-renderer-default=pdftops<br />
<br />
===="Using invalid Host" error message====<br />
<br />
Try to add "ServerAlias *" into cupsd.conf<br />
<br />
====Printer doesn't print with an "Filter failed" message on CUPS web interface (HP printer)====<br />
<br />
Change the permissions of the printer USB port:<br />
<br />
Get the bus and device number from lsusb, then set the permission using:<br />
<br />
# chmod 0666 /dev/bus/usb/<bus number>/<device number><br />
<br />
====Printer is not recognized by CUPS====<br />
<br />
If your printer is not listed in the "Add Printers" page of the CUPS web interface, nor by lpinfo -v, try the following (suggested in [https://bbs.archlinux.org/viewtopic.php?pid=1037279#p1037279 this thread]):<br />
<br />
# Remove {{ic|usblp}} from blacklist<br />
# Load {{ic|usblp}} module<br />
modprobe usblp<br />
# Stop cups (sudo systemctl stop cups)<br />
# Add the following udev rule in the following new rule /etc/udev/rules.d/10-cups_device_link.rules<br />
KERNEL=="lp[0-9]", SYMLINK+="%k", GROUP="lp"<br />
# Reload udev rules<br />
sudo udevadm control --reload-rules<br />
# Unplug and re-plug the printer <br />
# Wait a few seconds and then start cups again (sudo systemctl start cups)<br />
<br />
==See also==<br />
* [http://localhost:631/documentation.html Official CUPS documentation], ''locally installed''<br />
* [http://www.cups.org/ Official CUPS Website]<br />
* [http://www.linuxprinting.org/ Linux Printing], ''[http://www.linuxfoundation.org The Linux Foundation]''<br />
* [http://www.gentoo.org/doc/en/printing-howto.xml Gentoo's Printing Guide], ''[http://www.gentoo.org/doc/en Gentoo Documentation Resources]''<br />
* [https://bbs.archlinux.org/ Arch Linux User Forums]<br />
* [http://wiki.gotux.net/tutorials/software/hp-printer Install HP Printers Easy Way]</div>Zibi92https://wiki.archlinux.org/index.php?title=DokuWiki&diff=247389DokuWiki2013-02-15T09:31:32Z<p>Zibi92: /* Installing Plugins */</p>
<hr />
<div>[[Category:Office]]<br />
[[es:Dokuwiki]]<br />
[[zh-TW:Dokuwiki]]<br />
"DokuWiki is a standards-compliant, simple-to-use wiki which allows users to create rich documentation repositories. It provides an environment for individuals, teams and companies to create and collaborate using a simple yet powerful syntax that ensures data files remain structured and readable outside the wiki."<br />
<br />
"Unlimited page revisions allows restoration to any earlier page version, and with data stored in plain text files, no database is required. A powerful plugin architecture allows for extension and enhancement of the core system. See the features section for a full description of what DokuWiki has to offer."[http://wiki.splitbrain.org/wiki:dokuwiki]<br />
<br />
In other words, DokuWiki is a wiki written in PHP and requires no database.<br />
<br />
[http://www.dokuwiki.org/ Like to see a running example?]<br />
<br />
== Initial Notes ==<br />
DokuWiki should work on any web server which supports PHP 5.1.2 or later. As the requirements may change over time, you should consult the [http://www.dokuwiki.org/requirements requirements page] for DokuWiki for additional details.<br />
<br />
It is strongly recommend to read through the appropriate sections of [http://www.dokuwiki.org/security DokuWiki's security page] for your web server. Most popular web servers are covered but there are generic instructions as well.<br />
<br />
The package in [community] unpacks DokuWiki at {{ic|/srv/http/dokuwiki}} and changes ownership to the "http" user. This should work fine for most popular web servers as packaged for Arch.<br />
<br />
== Installation ==<br />
<br />
# Install your web server of choice (e.g. [[Apache]] or [[lighttpd]]) and configure it for [[PHP]]. As mentioned above, DokuWiki has no need for a database server so you may be able to skip those steps when setting up your web server.<br />
# Install {{Pkg|dokuwiki}} from [community] with [[pacman]].<br />
# Configure web server for dokuwiki (see section below)<br />
# With your web browser of choice, open <nowiki>http://&lt;your-server&gt;/dokuwiki/install.php</nowiki> and continue the installation from there.<br />
<br />
Alternatively, if you would like to install from tarball, you can read from http://www.dokuwiki.org/Install. Generally the procedure is the same as above. Instead of using pacman, you will need to [http://www.splitbrain.org/projects/dokuwiki download the tarball], unpack it to your server's document root (e.g. {{ic|/srv/http/dokuwiki}}), and chown to the appropriate user (e.g. "http").<br />
<br />
== Configuration ==<br />
<br />
=== Apache ===<br />
<br />
Firstly, create the file {{ic|/etc/httpd/conf/extra/dokuwiki.conf}} with the following contents:<br />
<br />
{{bc|<br />
Alias /dokuwiki /usr/share/webapps/dokuwiki<br />
<Directory /usr/share/webapps/dokuwiki/><br />
Options +FollowSymLinks<br />
AllowOverride All<br />
order allow,deny<br />
allow from all<br />
php_admin_value open_basedir "/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps/dokuwiki/:/var/lib/dokuwiki/"<br />
</Directory><br />
}}<br />
<br />
Include the newly created file in the Apache configuration by placing the following line at the end of {{ic|/etc/httpd/conf/httpd.conf}}:<br />
{{bc|<br />
Include conf/extra/dokuwiki.conf<br />
}}<br />
<br />
Make sure the folders {{ic|/etc/webapps/dokuwiki}} and {{ic|/var/lib/dokuwiki}} are owned by user and group "http". You may relocate these directories if you like as long as you update the references in {{ic|/etc/httpd/conf/extra/dokuwiki.conf}} respectively.<br />
<br />
Afterwards restart Apache:<br />
# systemctl restart httpd.service<br />
<br />
Then finish the installation by running the ''dokuwiki/install.php'' script in your browser.<br />
<br />
=== lighttpd Specific Configuration ===<br />
<br />
Edit the {{ic|/etc/lighttpd/lighttpd.conf}} file as per the [http://www.dokuwiki.org/install:lighttpd dokuwiki instructions] (might contain updated information).<br />
<br />
Under the line:<br />
{{bc|1= <br />
$HTTP["url"] =~ "\.pdf$" {<br />
server.range-requests = "disable"<br />
}<br />
}}<br />
<br />
add this: <br />
{{bc|1=<br />
# subdir of dokuwiki<br />
# comprised of the subdir of the root dir where dokuwiki is installed<br />
# in this case the root dir is the basedir plus /htdocs/<br />
# Note: be careful with trailing slashes when uniting strings.<br />
# all content on this example server is served from htdocs/ up.<br />
#var.dokudir = var.basedir + "/dokuwiki"<br />
var.dokudir = server.document-root + "/dokuwiki"<br />
<br />
# make sure those are always served through fastcgi and never as static files<br />
# deny access completly to these<br />
$HTTP["url"] =~ "/\.ht" { url.access-deny = ( "" ) }<br />
$HTTP["url"] =~ "/_ht" { url.access-deny = ( "" ) }<br />
$HTTP["url"] =~ "^" + var.dokudir + "/bin/" { url.access-deny = ( "" ) }<br />
$HTTP["url"] =~ "^" + var.dokudir + "/data/" { url.access-deny = ( "" ) }<br />
$HTTP["url"] =~ "^" + var.dokudir + "/inc/" { url.access-deny = ( "" ) }<br />
$HTTP["url"] =~ "^" + var.dokudir + "/conf/" { url.access-deny = ( "" ) }<br />
}}<br />
<br />
''These entries give some basic security to DokuWiki.'' lighttpd does not use .htaccess files like Apache. You CAN install with out this, but I would NEVER recommend it.<br />
<br />
{{bc|1=<br />
alias.url += ("/dokuwiki" => "/usr/share/webapps/dokuwiki/")<br />
}}<br />
Add alias somewhere in lighttpd or fastcgi conf file<br />
<br />
Restart lighttp:<br />
# /etc/rc.d/lighttpd restart<br />
<br />
== Post Installation ==<br />
=== Cleaning Up ===<br />
'''After configuring the server remove the install.php file!'''<br />
# rm /srv/http/dokuwiki/install.php<br />
<br />
=== Installing Plugins ===<br />
Many community created plugins can be found [http://www.dokuwiki.org/plugins here]<br />
<br />
They can be added through the web interface (as well as updated) through the Admin menu. Some plugins cannot be downloaded, if they go over ssl (e.g. git). Uncomment following line in {{ic|/etc/php/php.ini}}:<br />
{{bc|1= <br />
extension=openssl.so<br />
}}<br />
<br />
=== Backing Up ===<br />
It is very trivial to backup DokuWiki, since there is no database. All pages are in plain text, and require only a simple tar, or rsync. <br />
<br />
A quick breakdown of the directories of interest in the current (2008-05-05) version:<br />
/dokuwiki/data/ => All User Created Data<br />
/dokuwiki/lib/plugins/ => All User Added Plugins<br />
<br />
== Further Reading ==<br />
<br />
The [http://www.dokuwiki.org/ DokuWiki main site] has all of the information and help that you could possibly need.<br />
<br />
== See Also ==<br />
[http://wiki.gotux.net/config:dokuwiki DokuWiki HowTo Install and Upgrade]</div>Zibi92https://wiki.archlinux.org/index.php?title=Network_configuration&diff=246783Network configuration2013-02-08T07:37:30Z<p>Zibi92: </p>
<hr />
<div>[[Category:Networking]]<br />
[[Category:Getting and installing Arch]]<br />
[[cs:Configuring Network]]<br />
[[es:Configuring Network]]<br />
[[fr:Connexions reseau]]<br />
[[it:Configuring Network]]<br />
[[ja:Network Configuration]]<br />
[[nl:Configuring Network]]<br />
[[pt:Configuring Network]]<br />
[[ro:Configurare retea]]<br />
[[ru:Configuring Network]]<br />
[[sk:Configuring Network]]<br />
[[tr:Ağ_Yapılandırması]]<br />
[[zh-CN:Configuring Network]]<br />
{{Article summary start}}<br />
{{Article summary text|A simple guide for setting up and troubleshooting network.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Networking overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Jumbo Frames}}<br />
{{Article summary wiki|Firewalls}}<br />
{{Article summary wiki|Samba}}<br />
{{Article summary wiki|Wireless Setup}}<br />
{{Article summary end}}<br />
<br />
== Check the connection ==<br />
<br />
Many times, the basic installation procedure has created a working network configuration. To check if this is so, use the following command:<br />
<br />
{{Note|The {{ic|-c 3}} option calls it three times. See {{ic|man ping}} for more information.}}<br />
<br />
{{hc|$ ping -c 3 www.google.com|2=<br />
PING www.l.google.com (74.125.224.146) 56(84) bytes of data.<br />
64 bytes from 74.125.224.146: icmp_req=1 ttl=50 time=437 ms<br />
64 bytes from 74.125.224.146: icmp_req=2 ttl=50 time=385 ms<br />
64 bytes from 74.125.224.146: icmp_req=3 ttl=50 time=298 ms<br />
<br />
--- www.l.google.com ping statistics ---<br />
3 packets transmitted, 3 received, 0% packet loss, time 1999ms<br />
rtt min/avg/max/mdev = 298.107/373.642/437.202/57.415 ms}}<br />
<br />
If it works, then you may only wish to personalize your settings from the options below.<br />
<br />
If the previous command complains about unknown hosts, it means that your machine was unable to resolve this domain name. It might be related to your service provider or your router/gateway. You can try pinging a static IP address to prove that your machine has access to the Internet.<br />
<br />
{{hc|$ ping -c 3 8.8.8.8|2=<br />
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.<br />
64 bytes from 8.8.8.8: icmp_req=1 ttl=53 time=52.9 ms<br />
64 bytes from 8.8.8.8: icmp_req=2 ttl=53 time=72.5 ms<br />
64 bytes from 8.8.8.8: icmp_req=3 ttl=53 time=70.6 ms<br />
<br />
--- 8.8.8.8 ping statistics ---<br />
3 packets transmitted, 3 received, 0% packet loss, time 2002ms<br />
rtt min/avg/max/mdev = 52.975/65.375/72.543/8.803 ms}}<br />
<br />
{{Note|{{ic|8.8.8.8}} is a static address that is easy to remember. It is the address of Google's primary DNS server, therefore it can be considered reliable, and is generally not blocked by content filtering systems and proxies.}}<br />
<br />
If you are able to ping this address, you may try adding this nameserver to your {{ic|/etc/resolv.conf}} file.<br />
<br />
== Set the hostname ==<br />
<br />
A [[Wikipedia:Hostname|hostname]] is a unique name created to identify a machine on a network. To set the hostname: <br />
# hostnamectl set-hostname '''myhostname'''<br />
<br />
{{Note|You no longer need to edit {{ic|/etc/hosts}}, {{pkg|nss-myhostname}} will provide host name resolution, and is installed on all systems by default.}}<br />
<br />
To set the hostname temporarily (until a reboot), use the {{ic|hostname}} command from {{Pkg|inetutils}}:<br />
<br />
# hostname ''myhostname''<br />
<br />
== Device Driver ==<br />
<br />
=== Check the driver status ===<br />
<br />
Udev should detect your network interface card ([[Wikipedia:Network_interface_controller|NIC]]) and automatically load the necessary module at start up. Check the "Ethernet controller" entry (or similar) from the {{ic|lspci -v}} output. It should tell you which kernel module contains the driver for your network device. For example:<br />
<br />
{{hc|$ lspci -v|<br />
02:00.0 Ethernet controller: Attansic Technology Corp. L1 Gigabit Ethernet Adapter (rev b0)<br />
...<br />
Kernel driver in use: atl1<br />
Kernel modules: atl1}}<br />
<br />
Next, check that the driver was loaded via {{ic|dmesg <nowiki>|</nowiki> grep ''module_name''}}. For example:<br />
<br />
$ dmesg | grep atl1<br />
...<br />
atl1 0000:02:00.0: eth0 link is up 100 Mbps full duplex<br />
<br />
Skip the next section if the driver was loaded successfully. Otherwise, you will need to know which module is needed for your particular model.<br />
<br />
=== Load the device module ===<br />
<br />
Google for the right module/driver for the chipset. Once you know which module to use, you can [[Kernel modules#Loading|load it]] with:<br />
<br />
# modprobe ''module_name''<br />
<br />
If udev is not detecting and loading the proper module automatically during bootup, you can add it to a {{ic|*.conf}} file from the {{ic|/etc/modules-load.d/}} folder so that you do not need to {{ic|modprobe}} it every time you boot. For example, if {{ic|tg3}} is the network module:<br />
<br />
# tee /etc/modules-load.d/tg3.conf <<< "tg3"<br />
<br />
Other common modules are {{ic|8139too}} for cards with a Realtek chipset, or {{ic|sis900}} for cards with a SiS chipset.<br />
<br />
== Network Interfaces ==<br />
<br />
=== Persistent device names ===<br />
<br />
For motherboards that have integrated NICs, it is important to know which one is considered the primary NIC (e.g. {{ic|eth0}}) and which is considered the secondary NIC (e.g. {{ic|eth1}}). Many configuration issues are caused by users incorrectly configuring the network settings for {{ic|eth0}}, when in fact, they have their Ethernet cable plugged into {{ic|eth1}}.<br />
<br />
[[Udev]] is responsible for which device gets which name. With udev and modular network drivers, the network interface numbering is not persistent across reboots by default, because the drivers are loaded in parallel and, thus, in random order. Configuring your network connection is hard if you do not know if your card will be called {{ic|eth0}} or {{ic|eth1}}. You can fix this using {{ic|ifrename}}. See [[Rename network interfaces]]. It is also possible to manually create udev rules that assign interface names based on the interface's MAC address. See [[Udev#Network device]].<br />
<br />
{{Note|Systemd v197 introduced [http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames Predictable Network Interface Names], which automatically assigns static names to network devices. Interfaces are now prefixed with en (ethernet), wl (WLAN), or ww (WWAN) followed by an automatically generated identifier, creating an entry such as {{ic|enp0s25}}. This behavior may be disabled by adding a symlink:<br />
<br />
# ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules<br />
<br />
Users upgrading from an earlier systemd version will have a blank rules file created automatically.}}<br />
<br />
=== Get current device names ===<br />
<br />
Current NIC names can be found via sysfs<br />
<br />
{{hc|$ ls /sys/class/net|<br />
lo eth0 eth1 firewire0}}<br />
<br />
=== Enabling and disabling network interfaces ===<br />
<br />
You can activate or deactivate network interfaces using:<br />
<br />
# ip link set eth0 up<br />
# ip link set eth0 down<br />
<br />
To check the result:<br />
<br />
{{hc|$ ip link show dev eth0|<br />
2: eth0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP mode DEFAULT qlen 1000<br />
[...]}}<br />
<br />
== Configure the IP address ==<br />
<br />
You have two options: a dynamically assigned address using [[Wikipedia:Dynamic Host Configuration Protocol|DHCP]], or an unchanging "static" address.<br />
<br />
=== Dynamic IP address ===<br />
<br />
==== Manually run DHCP Client Daemon ====<br />
<br />
Please note that {{ic|dhcpcd}} is not {{ic|dhcpd}}.<br />
<br />
{{hc|# dhcpcd eth0|<br />
dhcpcd: version 5.1.1 starting<br />
dhcpcd: eth0: broadcasting for a lease<br />
...<br />
dhcpcd: eth0: leased 192.168.1.70 for 86400 seconds}}<br />
<br />
And now, {{ic|ip addr show dev eth0}} should show your inet address.<br />
<br />
For some people, {{ic|dhclient}} (from the {{Pkg|dhclient}} package) works where {{ic|dhcpcd}} fails.<br />
<br />
==== Run DHCP at boot ====<br />
<br />
If you simply want to use DHCP for your Ethernet connection, you can use {{ic|dhcpcd@.service}} (provided by the {{Pkg|dhcpcd}} package).<br />
<br />
To enable DHCP for {{ic|eth0}}, simply use:<br />
<br />
# systemctl start dhcpcd@eth0<br />
<br />
You can enable the service to automatically start at boot with:<br />
<br />
# systemctl enable dhcpcd@eth0<br />
{{Note| There is an [https://bugs.freedesktop.org/show_bug.cgi?id&#61;53954 open bug with the default service file] which means that you may have to edit it manually to correctly start your wired interface.}}<br />
<br />
If the dhcpd service starts before your network card module ({{bug|30235}}), manually add your network card to {{ic|/etc/modules-load.d/*.conf}}. For example, if your Realtek card needs {{ic|r8169}} to be loaded, create:<br />
<br />
{{hc|/etc/modules-load.d/realtek.conf|<br />
r8169}}<br />
<br />
{{Tip|To find out which modules are used by your network card, use {{ic|lspci -k}}.}}<br />
<br />
If you use DHCP and you do '''not''' want your DNS servers automatically assigned every time you start your network, be sure to add the following to the last section of {{ic|dhcpcd.conf}}:<br />
<br />
{{hc|/etc/dhcpcd.conf|<br />
nohook resolv.conf}}<br />
<br />
To prevent {{ic|dhcpcd}} from adding domain name servers to {{ic|/etc/resolv.conf}}, use the {{ic|nooption}} option:<br />
<br />
{{hc|/etc/dhcpcd.conf|<br />
nooption domain_name_servers}}<br />
<br />
Then add your own DNS name server to {{ic|/etc/resolv.conf}}.<br />
<br />
You may use the {{Pkg|openresolv}} package if several different processes want to control {{ic|/etc/resolv.conf}} (e.g. {{Pkg|dhcpcd}} and a VPN client). No additional configuration for {{Pkg|dhcpcd}} is needed to use {{Pkg|openresolv}}.<br />
<br />
{{Note|It is possible to have a static IP address using {{Pkg|dhcpcd}}. Simply edit your {{ic|/etc/conf.d/dhcpcd}} file to look something like this (where {{ic|x.x.x.x}} is your desired IP address):<br />
<br />
{{bc|1=DHCPCD_ARGS="-q -s x.x.x.x"}}}}<br />
<br />
=== Static IP address ===<br />
<br />
There are various reasons why you may wish to assign static IP addresses on your network. For instance, one may gain a certain degree of predictability with unchanging addresses, or you may not have a DHCP server available.<br />
<br />
{{Note|If you share your Internet connection from a Windows machine without a router, be sure to use static IP addresses on both computers to avoid LAN issues.}}<br />
<br />
You need:<br />
<br />
* Static IP address<br />
* [[Wikipedia:Subnetwork|Subnet mask]]<br />
* [[Wikipedia:Broadcast_address|Broadcast address]]<br />
* [[Wikipedia:Default_gateway|Gateway]]'s IP address<br />
<br />
If you are running a private network, it is safe to use IP addresses in 192.168.*.* for your IP addresses, with a subnet mask of 255.255.255.0 and a broadcast address of 192.168.*.255. The gateway is usually 192.168.*.1 or 192.168.*.254.<br />
<br />
==== Manual assignment ====<br />
<br />
You can assign a static IP address in the console:<br />
<br />
# ip addr add <IP address>/<subnet mask> dev <interface><br />
<br />
For example:<br />
<br />
# ip addr add 192.168.1.2/24 dev eth0<br />
<br />
{{Note|The subnet mask was specified using [[Wikipedia:CIDR_notation|CIDR notation]].}}<br />
<br />
For more options, see {{ic|man ip}}.<br />
<br />
Add your gateway like so:<br />
<br />
# ip route add default via <default gateway IP address><br />
<br />
For example:<br />
<br />
# ip route add default via 192.168.1.1<br />
<br />
If you the get the error "No such process", it means you have to run {{ic|ip link set dev eth0 up}} as root.<br />
<br />
====Manual connection at boot using systemd====<br />
This section details how to manually connect using [[systemd]].<br />
<br />
=====Using [[dhcpcd]]=====<br />
Create the file {{ic|/etc/systemd/system/network.service}} using your editor of choice. This example uses [[wpa_supplicant]].<br />
{{hc|/etc/systemd/system/network.service|<nowiki><br />
[Unit]<br />
Description=Network Connectivity<br />
Wants=network.target<br />
Before=network.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/sbin/ip link set dev wlan0 up<br />
ExecStart=/usr/sbin/wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf<br />
ExecStart=/sbin/dhcpcd wlan0<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
# systemctl enable network<br />
<br />
To test, reboot or stop all other network daemons and run as root:<br />
# systemctl start network<br />
<br />
=====Using a static IP address=====<br />
Create the file {{ic|/etc/conf.d/network}} using your editor of choice. This file will store your interface and static IP address settings.<br />
{{hc|/etc/conf.d/network|<nowiki><br />
interface=wlan0<br />
address=192.168.0.10<br />
netmask=24<br />
broadcast=192.168.0.255<br />
gateway=192.168.0.1<br />
</nowiki>}}<br />
<br />
Create the file {{ic|/etc/systemd/system/network.service}} using your editor of choice. This example uses a static IP address and [[wpa_supplicant]].<br />
{{hc|/etc/systemd/system/network.service|<nowiki><br />
[Unit]<br />
Description=Wireless Static IP Connectivity<br />
Wants=network.target<br />
Before=network.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
EnvironmentFile=/etc/conf.d/network<br />
ExecStart=/sbin/ip link set dev ${interface} up<br />
ExecStart=/usr/sbin/wpa_supplicant -B -i ${interface} -c /etc/wpa_supplicant.conf # Remove this for wired connections<br />
ExecStart=/sbin/ip addr add ${address}/${netmask} broadcast ${broadcast} dev ${interface}<br />
ExecStart=/sbin/ip route add default via ${gateway}<br />
<br />
ExecStop=/sbin/ip addr flush dev ${interface}<br />
ExecStop=/sbin/ip link set dev ${interface} down<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
Do not forget to enable it!<br />
# systemctl enable network<br />
<br />
To test, reboot or make sure all other network daemons are stopped and then run as root<br />
# systemctl start network<br />
<br />
==== Calculating addresses ====<br />
<br />
You can use {{ic|ipcalc}} provided by the {{Pkg|ipcalc}} package to calculate IP broadcast, network, netmask, and host ranges for more advanced configurations. For example, I use ethernet over firewire to connect a windows machine to arch. For security and network organization, I placed them on their own network and configured the netmask and broadcast so that they are the only 2 machines on it. To figure out the netmask and broadcast addresses for this, I used ipcalc, providing it with the IP of the arch firewire nic 10.66.66.1, and specifying ipcalc should create a network of only 2 hosts.<br />
<br />
{{hc|$ ipcalc -nb 10.66.66.1 -s 1|2=<br />
Address: 10.66.66.1<br />
<br />
Netmask: 255.255.255.252 = 30<br />
Network: 10.66.66.0/30<br />
HostMin: 10.66.66.1<br />
HostMax: 10.66.66.2<br />
Broadcast: 10.66.66.3<br />
Hosts/Net: 2 Class A, Private Internet}}<br />
<br />
== Load configuration ==<br />
<br />
To test your settings either reboot the computer or reload the relevant systemd services:<br />
<br />
# systemctl restart dhcpcd@eth0<br />
<br />
Try pinging your gateway, DNS server, ISP provider and other Internet sites, in that order, to detect any connection problems along the way, as in this example:<br />
<br />
$ ping -c 3 www.google.com<br />
<br />
== Additional settings ==<br />
<br />
=== ifplugd for laptops ===<br />
<br />
{{Pkg|ifplugd}} in [[Official Repositories]] is a daemon which will automatically configure your Ethernet device when a cable is plugged in and automatically unconfigure it if the cable is pulled. This is useful on laptops with onboard network adapters, since it will only configure the interface when a cable is really connected. Another use is when you just need to restart the network but do not want to restart the computer or do it from the shell.<br />
<br />
By default it is configured to work for the {{ic|eth0}} device. This and other settings like delays can be configured in {{ic|/etc/ifplugd/ifplugd.conf}}.<br />
<br />
Enabling {{ic|net-auto-wired.service}} should start ifplugd on bootup if you have {{Pkg|netcfg}} installed, otherwise you can use {{ic|ifplugd@eth0.service}}.<br />
<br />
=== Bonding or LAG ===<br />
<br />
You will need {{Pkg|netcfg}} from the [[Official Repositories]], as well as the {{AUR|netcfg-bonding}} package from the [[AUR]].<br />
<br />
Edit/create the following files:<br />
<br />
{{hc|/etc/network.d/bonded|2=<br />
CONNECTION="bonding"<br />
INTERFACE="bond0"<br />
SLAVES="eth0 eth1"<br />
IP="dhcp"<br />
DHCP_TIMEOUT=10}}<br />
<br />
{{hc|/etc/modules-load.d/bonding.conf|<br />
bonding}}<br />
<br />
Set up netcfg to use the bond0 interface.<br />
<br />
Start your network:<br />
$ systemctl enable netcfg@bonded<br />
<br />
{{Note|To change the bonding mode (default is round robin) to, e.g, dynamic link aggregation:<br />
<br />
Create {{ic|/etc/modprobe.d/bonding.conf}}:<br />
<br />
{{hc|/etc/modprobe.d/bonding.conf|2=<br />
options bonding mode=4<br />
options bonding miimon=100}}<br />
<br />
For more information about the different bonding policies (and other driver settings) see the [http://sourceforge.net/projects/bonding/files/Documentation/ Linux Ethernet Bonding Driver HOWTO].}}<br />
<br />
To activate the new bonded ports modprobe {{ic|bonding}}, stop {{ic|network}} and start the {{ic|net-profiles}} service:<br />
<br />
# modprobe bonding<br />
# systemctl stop network<br />
# systemctl start net-profiles<br />
<br />
To check the status and bonding mode:<br />
<br />
$ cat /proc/net/bonding/bond0<br />
<br />
=== IP address aliasing ===<br />
<br />
IP aliasing is the process of adding more than one IP address to a network interface. With this, one node on a network can have multiple connections to a network, each serving a different purpose.<br />
<br />
To use IP aliasing from [[netcfg]], change {{ic|POST_UP}} and {{ic|PRE_DOWN}} commands in your network profile to set up the additional IP addresses manually. See [https://bbs.archlinux.org/viewtopic.php?pid=1036395#p1036395 here] for details.<br />
<br />
==== Example ====<br />
<br />
You will need {{Pkg|netcfg}} from the [[Official Repositories]].<br />
<br />
Prepare the configuration:<br />
<br />
{{hc|/etc/network.d/mynetwork|2=<br />
<br />
CONNECTION='ethernet'<br />
DESCRIPTION='Five different addresses on the same NIC.'<br />
INTERFACE='eth0'<br />
IP='static'<br />
ADDR='192.168.1.10'<br />
GATEWAY='192.168.1.1'<br />
DNS=('192.168.1.1')<br />
DOMAIN=''<br />
POST_UP='x=0; for i in 11 12 13 14; do ip addr add 192.168.1.$i/24 brd 192.168.1.255 dev eth0 label eth0:$((x++)); done'<br />
PRE_DOWN='for i in 11 12 13 14; do ip addr del 192.168.1.$i/24 dev eth0; done'}}<br />
<br />
The simply execute: <br />
<br />
$ systemctl enable net-auto-wired.service<br />
<br />
=== Change MAC/hardware address ===<br />
<br />
See [[MAC Address Spoofing]].<br />
<br />
== Troubleshooting ==<br />
<br />
=== Swapping computers on the cable modem ===<br />
<br />
Most domestic cable ISPs (videotron for example) have the cable modem configured to recognize only one client PC, by the MAC address of its network interface. Once the cable modem has learned the MAC address of the first PC or equipment that talks to it, it will not respond to another MAC address in any way. Thus if you swap one PC for another (or for a router), the new PC (or router) will not work with the cable modem, because the new PC (or router) has a MAC address different from the old one. To reset the cable modem so that it will recognise the new PC, you must power the cable modem off and on again. Once the cable modem has rebooted and gone fully online again (indicator lights settled down), reboot the newly connected PC so that it makes a DHCP request, or manually make it request a new DHCP lease.<br />
<br />
If this method does not work, you will need to clone the MAC address of the original machine. See also [[Configuring Network#Change MAC/hardware address|Change MAC/hardware address]].<br />
<br />
=== The TCP window scaling issue ===<br />
<br />
TCP packets contain a "window" value in their headers indicating how much data the other host may send in return. This value is represented with only 16 bits, hence the window size is at most 64Kb. TCP packets are cached for a while (they have to be reordered), and as memory is (or used to be) limited, one host could easily run out of it.<br />
<br />
Back in 1992, as more and more memory became available, [http://www.faqs.org/rfcs/rfc1323.html RFC 1323] was written to improve the situation: Window Scaling. The "window" value, provided in all packets, will be modified by a Scale Factor defined once, at the very beginning of the connection.<br />
<br />
That 8-bit Scale Factor allows the Window to be up to 32 times higher than the initial 64Kb.<br />
<br />
It appears that some broken routers and firewalls on the Internet are rewriting the Scale Factor to 0 which causes misunderstandings between hosts.<br />
<br />
The Linux kernel 2.6.17 introduced a new calculation scheme generating higher Scale Factors, virtually making the aftermaths of the broken routers and firewalls more visible.<br />
<br />
The resulting connection is at best very slow or broken.<br />
<br />
==== How to diagnose the problem ====<br />
<br />
First of all, let's make it clear: this problem is odd. In some cases, you will not be able to use TCP connections (HTTP, FTP, ...) at all and in others, you will be able to communicate with some hosts (very few).<br />
<br />
When you have this problem, the {{ic|dmesg}}'s output is OK, logs are clean and {{ic|ip addr}} will report normal status... and actually everything appears normal.<br />
<br />
If you cannot browse any website, but you can ping some random hosts, chances are great that you're experiencing this issue: ping uses ICMP and is not affected by TCP issues.<br />
<br />
You can try to use Wireshark. You might see successful UDP and ICMP communications but unsuccessful TCP communications (only to foreign hosts).<br />
<br />
==== How to fix it (The bad way) ====<br />
<br />
To fix it the bad way, you can change the tcp_rmem value, on which Scale Factor calculation is based. Although it should work for most hosts, it is not guaranteed, especially for very distant ones.<br />
<br />
# echo "4096 87380 174760" > /proc/sys/net/ipv4/tcp_rmem<br />
<br />
==== How to fix it (The good way) ====<br />
<br />
Simply disable Window Scaling. Since Window Scaling is a nice TCP feature, it may be uncomfortable to disable it, especially if you cannot fix the broken router. There are several ways to disable Window Scaling, and it seems that the most bulletproof way (which will work with most kernels) is to add the following line to {{ic|/etc/sysctl.conf}} (see also [[sysctl]])<br />
<br />
net.ipv4.tcp_window_scaling = 0<br />
<br />
==== How to fix it (The best way) ====<br />
<br />
This issue is caused by broken routers/firewalls, so let's change them. Some users have reported that the broken router was their very own DSL router.<br />
<br />
==== More about it ====<br />
<br />
This section is based on the LWN article [http://lwn.net/Articles/92727/ TCP window scaling and broken routers] and a Kernel Trap article: [http://kerneltrap.org/node/6723 Window Scaling on the Internet].<br />
<br />
There are also several relevant threads on the LKML.<br />
<br />
=== Realtek no link / WOL issue ===<br />
<br />
Users with Realtek 8168 8169 8101 8111(C) based NICs (cards / and on-board) may notice an issue where the NIC seems to be disabled on boot and has no Link light. This can usually be found on a dual boot system where Windows is also installed. It seems that using the offical Realtek drivers (dated anything after May 2007) under Windows is the cause. These newer drivers disable the Wake-On-LAN feature by disabling the NIC at Windows shutdown time, where it will remain disabled until the next time Windows boots. You will be able to notice if this issue is affecting you if the Link light remains off until Windows boots up; during Windows shutdown the Link light will switch off. Normal operation should be that the link light is always on as long as the system is on, even during POST. This issue will also affect other operative systems without newer drivers (eg. Live CDs). Here are a few fixes for this issue:<br />
<br />
==== Method 1 - Rollback/change Windows driver ====<br />
<br />
You can roll back your Windows NIC driver to the Microsoft provided one (if available), or roll back/install an official Realtek driver pre-dating May 2007 (may be on the CD that came with your hardware).<br />
<br />
==== Method 2 - Enable WOL in Windows driver ====<br />
<br />
Probably the best and the fastest fix is to change this setting in the Windows driver. This way it should be fixed system-wide and not only under Arch (eg. live CDs, other operative systems). In Windows, under Device Manager, find your Realtek network adapter and double-click it. Under the Advanced tab, change "Wake-on-LAN after shutdown" to Enable.<br />
<br />
In Windows XP (example)<br />
Right click my computer<br />
--> Hardware tab<br />
--> Device Manager<br />
--> Network Adapters<br />
--> "double click" Realtek ...<br />
--> Advanced tab<br />
--> Wake-On-Lan After Shutdown<br />
--> Enable<br />
<br />
{{Note|Newer Realtek Windows drivers (tested with ''Realtek 8111/8169 LAN Driver v5.708.1030.2008'', dated 2009/01/22, available from GIGABYTE) may refer to this option slightly differently, like ''Shutdown Wake-On-LAN --> Enable''. It seems that switching it to {{ic|Disable}} has no effect (you will notice the Link light still turns off upon Windows shutdown). One rather dirty workaround is to boot to Windows and just reset the system (perform an ungraceful restart/shutdown) thus not giving the Windows driver a chance to disable LAN. The Link light will remain on and the LAN adapter will remain accessible after POST - that is until you boot back to Windows and shut it down properly again.}}<br />
<br />
==== Method 3 - Newer Realtek Linux driver ====<br />
<br />
Any newer driver for these Realtek cards can be found for Linux on the realtek site. (untested but believed to also solve the problem).<br />
<br />
==== Method 4 - Enable ''LAN Boot ROM'' in BIOS/CMOS ====<br />
<br />
It appears that setting ''Integrated Peripherals --> Onboard LAN Boot ROM --> Enabled'' in BIOS/CMOS reactivates the Realtek LAN chip on system boot-up, despite the Windows driver disabling it on OS shutdown.<br />
<br><small>This was tested successfully multiple times with GIGABYTE system board GA-G31M-ES2L with BIOS version F8 released on 2009/02/05. YMMV.</small><br />
<br />
=== DLink G604T/DLink G502T DNS issue ===<br />
<br />
Users with a DLink G604T/DLink G502T router, using DHCP and have firmware v2.00+ (typically users with AUS firmware) may have issues with certain programs not resolving the DNS. One of these programs are unfortunatley pacman. The problem is basically the router in certain situations is not sending the DNS properly to DHCP, which causes programs to try and connect to servers with an IP address of 1.0.0.0 and fail with a connection timed out error<br />
<br />
==== How to diagnose the problem ====<br />
<br />
The best way to diagnose the problem is to use Firefox/Konqueror/links/seamonkey and to enable wget for pacman. If this is a fresh install of Arch Linux, then you may want to consider installing {{ic|links}} through the live CD.<br />
<br />
Firstly, enable wget for pacman (since it gives us info about pacman when it is downloading packages)<br />
Open {{ic|/etc/pacman.conf}} with your favourite editor and uncomment the following line (remove the # if it is there)<br />
<br />
XferCommand=/usr/bin/wget --passive-ftp -c -O %o %u<br />
<br />
While you are editing {{ic|/etc/pacman.conf}}, check the default mirror that pacman uses to download packages.<br />
<br />
Now open up the default mirror in an Internet browser to see if the mirror actually works. If it does work, then do {{ic|pacman -Syy}} (otherwise pick another working mirror and set it to the pacman default). If you get something similar to the following (notice the 1.0.0.0),<br />
<br />
<nowiki>ftp://mirror.pacific.net.au/linux/archlinux/extra/os/i686/extra.db.tar.gz</nowiki><br />
=> '/var/lib/pacman/community.db.tar.gz.part'<br />
Resolving mirror.pacific.net.au... 1.0.0.0<br />
<br />
then you most likely have this problem. The 1.0.0.0 means it is unable to resolve DNS, so we must add it to {{ic|/etc/resolv.conf}}.<br />
<br />
==== How to fix it ====<br />
<br />
Basically what we need to do is to manually add the DNS servers to our {{ic|/etc/resolv.conf}} file. The problem is that DHCP automatically deletes and replaces this file on boot, so we need to edit {{ic|/etc/conf.d/dhcpcd}} and change the flags to stop DHCP from doing this.<br />
<br />
When you open {{ic|/etc/conf.d/dhcpcd}}, you should see something close to the following:<br />
<br />
DHCPCD_ARGS="-t 30 -h $HOSTNAME"<br />
<br />
Add the {{ic|-R}} flag to the arguments, e.g.,<br />
<br />
DHCPCD_ARGS="-R -t 30 -h $HOSTNAME"<br />
<br />
{{Note|1=If you are using {{Pkg|dhcpcd}} >= 4.0.2, the {{ic|-R}} flag has been deprecated. Please see the [[#For DHCP assigned IP address]] section for information on how to use a custom {{ic|/etc/resolv.conf}} file.}}<br />
<br />
Save and close the file; now open {{ic|/etc/resolv.conf}}. You should see a single nameserver (most likely 10.1.1.1). This is the gateway to your router, which we need to connect to in order to get the DNS servers of your ISP. Paste the IP address into your browser and log in to your router. Go to the DNS section, and you should see an IP address in the Primary DNS Server field; copy it and paste it as a nameserver '''ABOVE''' the current gateway one.<br />
<br />
For example, {{ic|/etc/resolv.conf}} should look something along the lines of:<br />
<br />
nameserver 10.1.1.1<br />
<br />
If my primary DNS server is 211.29.132.12, then change {{ic|/etc/resolv.conf}} to:<br />
<br />
nameserver 211.29.132.12<br />
nameserver 10.1.1.1<br />
<br />
Now restart the network daemon by running {{ic|systemctl restart dhcpcd@<interface>}} and do {{ic|pacman -Syy}}. If it syncs correctly with the server, then the problem is solved.<br />
<br />
==== More about it ====<br />
<br />
This is the whirlpool forum (Australian ISP community) which talks about and gives the same solution to the problem:<br />
<br />
http://forums.whirlpool.net.au/forum-replies-archive.cfm/461625.html<br />
<br />
=== Check DHCP problem by releasing IP first ===<br />
<br />
Problem may occur when DHCP get wrong IP assignment. For example when two routers are tied together through VPN. The router that is connected to me by VPN may assigning IP address. To fix it. On a console, as root, release IP address:<br />
<br />
# dhcpcd -k<br />
<br />
Then request a new one:<br />
<br />
# dhcpcd<br />
<br />
Maybe you had to run those two commands many times.<br />
<br />
<br />
=== No eth0 with Atheros AR8161 ===<br />
<br />
With the Atheros AR8161 Gigabit Ethernet card, the ethernet connection is not working out-of-the-box (with the installation media of Jan 2013). The module "alx" needs to be loaded but is not present.<br />
<br />
The driver from [http://linuxwireless.org/en/users/Download/stable/#compat-wireless_stable_releases compat-wireless] (that should become [https://backports.wiki.kernel.org/index.php/Releases compat-drives] from linux 3.7) need to be installed. You need the firmware version with '''pc''' in the filename to have the ethernet drivers.<br />
<br />
$ wget http://www.orbit-lab.org/kernel/compat-wireless-3-stable/v3.6/compat-wireless-3.6.8-1-snpc.tar.bz2<br />
$ tar xjf compat-wireless-3.6.8-1-snpc.tar.bz2<br />
$ cd compat-wireless-3.6.8-1-snpc<br />
$ ./scripts/driver-select alx<br />
$ make<br />
$ sudo make install<br />
$ sudo modprobe alx</div>Zibi92https://wiki.archlinux.org/index.php?title=Disable_PC_speaker_beep&diff=246366Disable PC speaker beep2013-02-05T01:17:35Z<p>Zibi92: </p>
<hr />
<div>[[Category:Sound]]<br />
[[bg:Disable PC Speaker Beep]]<br />
[[cs:Disable PC Speaker Beep]]<br />
[[es:Disable PC Speaker Beep]]<br />
[[ja:Disable PC Speaker Beep]]<br />
[[ko:Disable PC Speaker Beep]]<br />
[[ru:Disable PC Speaker Beep]]<br />
[[uk:Disable PC Speaker Beep]]<br />
[[zh-CN:Disable PC Speaker Beep]]<br />
== Introduction ==<br />
<br />
The computer often seems to make beep noises or other sounds at various times, whether we want them or not. They come from various sources, and as such, you may be able to configure if or when they occur.<br />
<br />
Further, the sounds from the computer can be heard from the built-in case speaker, or the speakers which are plugged into the sound card. This article deals primarily with the former.<br />
<br />
The sounds are caused by the BIOS (Basic Input/Output System), the OS (Operating System), the DE (Desktop Environment), or various software programs. The BIOS is a particularly troublesome problem because it is kept inside an EPROM chip on the motherboard, and the only direct control the user has is by turning the power on or off. Unless the BIOS setup has a setting you can adjust or you wish to attempt to reprogram that chip with the proper light source, it is not likely you will be able to change it at all. BIOS-generated beep sounds are not addressed here, except to say that unplugging your computer case speaker will stop all such sounds from being heard. (Do so at your own risk.)<br />
<br />
However, everything else which can cause a sound to come out of the computer case speaker can be handled with the suggestions listed below.<br />
<br />
One should also note that the option of turning off a particular instance of a sound, while leaving the others operational, is possible if one can identify which portion of the environment is the source of the particular sound generation. This can make a very customized selection of attention-getting sounds possible. Please feel free to add your findings to this wiki page when you find particular examples of settings combinations which may be useful for other users.<br />
<br />
==Globally==<br />
The PC speaker can be disabled by [[Kernel modules#Removal|unloading]] the {{ic|pcspkr}} module:<br />
# rmmod pcspkr<br />
<br />
[[Kernel modules#Blacklisting|Blacklisting]] the {{ic|pcspkr}} module will prevent [[udev]] from loading it at boot:<br />
<br />
# echo "blacklist pcspkr" > /etc/modprobe.d/nobeep.conf<br />
<br />
== Locally ==<br />
<br />
=== In X ===<br />
<br />
$ xset -b<br />
<br />
You can add this command to a startup file, such as [[xprofile]] to make it permanent.<br />
<br />
=== In console ===<br />
<br />
You can add this command in {{ic|/etc/profile}} or a dedicated file like {{ic|/etc/profile.d/disable-beep.sh}} (must be executable):<br />
setterm -blength 0<br />
<br />
Another way is to add or uncomment this line in {{ic|/etc/inputrc}} or {{ic|~/.inputrc}}:<br />
set bell-style none<br />
<br />
=== Using ALSA ===<br />
{{Tip|For most Intel's cards, if you do not see PC Speaker in alsamixer's default device, then try selecting "HDA Intel PCH" device by pressing F6. It is listed as "Beep" there. This is because PulseAudio proxy controls may not list all PC Speakers.}}<br />
Try muting the PC Speaker:<br />
$ amixer set 'PC Speaker' 0% mute<br />
<br />
For certain sound cards, it is the PC Beep:<br />
$ amixer set 'PC Beep' 0% mute<br />
<br />
Or merely Beep:<br />
$ amixer set 'Beep' 0% mute<br />
<br />
You can also use alsamixer for a console GUI<br />
$ alsamixer<br />
<br />
Scroll to PC beep and press 'M' to mute. Save your alsa settings:<br />
# alsactl store<br />
<br />
{{Note|Not every sound card creates a PC Speaker or PC Beep slider control in alsamixer.}}<br />
<br />
=== In GNOME/Metacity ===<br />
<br />
In Gconf set '''{{ic|/apps/metacity/general/audible_bell}}''' to '''{{ic|false}}:'''<br />
$ gconftool-2 -s -t string /apps/metacity/general/audible_bell false<br />
<br />
=== GTK+ ===<br />
<br />
Append this line to your .gtkrc-2.0 and to the [Settings] section of $XDG_CONFIG_HOME/gtk-3.0/settings.ini:<br />
gtk-error-bell = 0<br />
<br />
==See also==<br />
* Have a look at these {{ic|man}} pages for further information: {{ic|xset(1)}}, {{ic|setterm(1)}}, {{ic|readline(3)}}.<br />
* [[Kernel modules]]</div>Zibi92