Configuration files

From Wikislax
Revision as of 22:22, 6 December 2017 by Wikislax (talk | contribs) (Created page with "The location of the configuration files depend on the specific distribution, but is usually subdirectories of, or files in <tt>'''/etc'''</tt>, <tt>'''/usr/etc'''</tt>, <tt>''...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The location of the configuration files depend on the specific distribution, but is usually subdirectories of, or files in /etc, /usr/etc, /usr/local/etc. The files are set up by installation but can be updated later. Applying the configuration change will then be a matter of restarting the corresponding daemon. The main Slackware configuration files are :

Init configuration

File Content
/etc/inittab contains the default runlevel (3=multi-user, 4=graphical). On a live system, telinit n affords changing the level interactively.
/etc/fstab contains descriptions on the filesystems used on this computer, including the device, the mount point, the filesystem type and the opening options. Use man fstab, copy, and try !
/etc/http Directory containing the Apache configuration files such as httpd.conf.
/etc/lilo.conf used by lilo to generate a boot sector on the device or on the MBR (master boot record). If on the device and using the Windows bootloader, don't forget to copy the boot sector on a disquette so as to be able to use it from Windows.
/etc/mail Directory containing the Sendmail configuration files such as sendmail.mc and sendmail.cf. Spamassassin configuration also goes here as a subdirectory.
/etc/mail/aliases File containing a list of users that do not exist on the server and whose mail is redirected to existing users. After modifying this file the command newaliases must be ran.
# redirect news
usenet:         news
/etc/ntpd.conf Configuration for the network time protocol. Add ntp servers for your region as below. After an update, restart using /etc/rc.d/rc.ntpd restart.
# NTP server (list one or more) to synchronize with:
server 0.fr.pool.ntp.org
server 1.fr.pool.ntp.org
server 2.fr.pool.ntp.org
server 3.fr.pool.ntp.org
/etc/profile don't forget to update the paths:
MANPATH=/usr/local/share/man:/usr/local/man:/usr/man
/etc/profile.d the files contained in this directory are executed at login when executable.
/etc/ld.so.conf list of additional libraries. Needs /sbin/ldconfig after adding new libraries. Add /usr/local/lib64 here.
.bashrc Specify . /etc/profile on a line of itself to use in konsole the same environment as in the command line. This will afford colorls to work in new konsole tabs.


The /etc/rc.d directory

The /etc/rc.d directory contains the scripts used to initialize the system services at the end of the boot. To use a specific script at startup, make it user-executable. To stop using it, remove the execution rights. Depending on the situation, scripts are called with the start, stop, or restart parameter.

Network configuration

The network configuration is done during system installation but it is possible to change it later by editing the files and restarting the right daemon:

File Content
/etc/rc.d/rc.inet1.conf configuration of the network. For Xen the standard configuration uses a bridge. A bridge gathers several physical network interfaces. The bridge is configured with an IP address while the physical network interfaces are left unconfigured. After an update, restart using /etc/rc.d/rc.inet1 restart.
# Config information for eth0:
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""
. . .
# Example of how to configure a bridge:
# Note the added "BRNICS" variable which contains a space-separated list
# of the physical network interfaces you want to add to the bridge.
IFNAME[0]="br0"
BRNICS[0]="eth0"
IPADDR[0]="192.168.0.1"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""
/etc/rc.d/rc.ipforward is a script to allow forwarding of packets between the interfaces. This is useful for a computer with several interfaces, for instance a firewall. To allow forwarding, just make the script executable.
/etc/ssh/sshd_config ssh server configuration. PermitRootLogin yes affords login as root. To authorize X11Forwarding use ForwardX11 yes. After an update, restart using /etc/rc.d/rc.sshd restart.
/etc/ssh/ssh_config ssh client configuration. To authorize X11Forwarding use ForwardX11 yes and ForwardX11Trusted yes to avoid a warning using ssh and get better security.
/etc/hosts contains the addresses of the local hosts that bind cannot resolve, as they are in a private addressing plan. It is also possible to specify here addresses that will be chosen in lieu of their official address.
/etc/rc.d/rc.bind setting this script as user-executable will afford running the local computer to be its own DNS.
/etc/named.conf uncomment the query-source directive to suppress the port-unreachable packets on lo.
/etc/resolv.conf if using local bind, append a line with nameserver 127.0.0.1.
/etc/udev/rules.d/70-persistent-net.rules affords changing which interface is eth0.


Note : In case of network issue, it can be a good idea to check the configuration using ifconfig -a, netstat -f inet -rn, and route. The routes are kept from one boot to the other and it may become necessary to delete the existing routes using route flush, then reboot.


Linux basics Main Page IPTables