User:Tom/RHCE EX300: Difference between revisions

From RoggeWiki
Jump to navigation Jump to search
No edit summary
Line 185: Line 185:


======SELinux Requirements for Samba Operation======
======SELinux Requirements for Samba Operation======
....
====Chapter 22 Hosting Websites with Apache====
=======Apache commands=====
apachectl    Starts, stops and checks status of the httpd process. Systemctl may also be used.
htpasswd      Create and updates files to store usernames and passwords for basic authentication of Apache users.
httpd        Server program for the Apache webservice

Revision as of 11:19, 18 February 2016

RHCSA & RHCE Red Hat Enterprise Linux 7: Training and Exam Preparation Guide (EX200 and EX300) third edition march 2015 by Asghar Ghori

RHCE

Hoofdstuk 14 Writing Shell Scripts

nl       Number lines of files
bash -x  Debug script
Command line arguments $0 $1, $#, $*, $$.
shift    Move arguments

echo -e  Enables interprestation of backslash escapes
$?       Exit code

test     Test conditions (man test) int1 -eq int2
if condition then action else action fi
if condition then action elif condition then action else action fi
for-do done
while do done
until do done

Hoofdstuk 15 Configuring Bonding, Teaming, IPv6 and Routing

modprobe bonding
modinfo bonding
uuidgen eth2
systemctl status NetworkManager
nmcli dev status
nmcli con add type bond con-name bond0 ifname bond0 mode balance-rr ip4 192.168.122.112 gw4 192.168.122.1
nmcli con add type bond-slave ifname eth1 master bond0
nmcli con up bond0
nmcli con show 
yum install teamd
modprobe team 
modinfo team
nmcli con add type team con-name team0 ifname team0 ip4 192.168.122.122/24 gw4 192.168.122.1
nmcli con add type team-slave con-name eth4 ifname eth4 master team0

IPv6 128bit 1204:bab1:21d1:bb43:23a1:9bde:87df:bac9
Zowel IPv4 als IPv6 adressen kunnen op een adapter gezet worden.
ping6
RIP    Routing Information protocol
OSPF   Open Shortest Path First
ip route, route, netstat -rn
ip route add
ip route del

Hoofdstuk 16 Synchronzing Time with NTP

ntpd used UDP over well-known port 123
NTP roles: Primary NTP server, Secondary NTP server, NTP peer, NTP client.
NTP Client can be configured as a polling, broadcast, multicast or manycast client.
Packages ntp and ntpdate
Commands ntpdate, ntpq, ntpd and ntpstat.
NTP Configuration file /etc/ntp.conf.
Key directives driftfile, logfile restrict, server, peer, broadcast, crypto, includefile, keys. See man ntp.conf.
Package system-config-date for system-config-date tool
Output ntpq -p is important

Hoofdstuk 17 Working with Firewalld and Kerberos

firewall-cmd      --state, --get-default-zone, --get-active-zones, --get-zones, --list-all, --list-all-zones 
                  --list-all -zone public, 
                  --net-zone testzone --permanent, --delete-zone testzone --permanent
                  --get-services
                  --list-services
                  --query-service
                  --list-ports --add-port --remove-port --query-port --permanent --zone
                  --list-rich-rules --add-rich-rule --remove-rich-rule --query-rich-rule --permanent --zone
                  --add-masquerade --remove-masquerade --query-masquerade --permanent --zone
                  --list-forward-ports --add-forward-port --remove-forward-port query-forward-port --permanent --zone
/etc/firewalld/
/etc/firewalld/zones/             System-defined
/usr/lib/firewalld/zones/         User-defined
Packages krb5-server krb5-workstation
Commands kinit, kdestroy, klist, passwd, kadmin, kadmin.local

Hoofdstuk 18 Tuning Kernel Parameters, Reporting System Usage and Logging Remotely

sysctl -a, sysctl -p
/proc/cmdline
/proc/sys
/etc/sysctl.conf
/usr/lib/sysctl.d/00-system.conf
/boot/grub2/grub.cfg
/proc/cmdline
df, vmstat, top
Package sysstat: cifsiostat, iostat, mpstat,nfsiostat, pidstat, sa1, sa2, sadc, sadf, sar, dstat
/etc/sysconfig/sysstat
/etc/sysconfig/sysstat.ioconf
Package dstat, dstat

Chapter 19 Sharing Block Storage with iSCSI

targetcli     for target administration, package targetclt
targetcli     saveconfig
iscsiadm      for initiator administration, package iscsi-initiator-utils
iscsiadm      -m discovery -t st -p 192.168.122.102    Locate available targets
iscsiadm      -m node -T iqn.2016-01.roggeware.nl.server2:iscsidisk1 -p 192.168.122.102 -l         Login (-l) to target (-T) in node mode (-m) at portal (-p)
iscsiadm      -m session 
systemctl enable iscsid
/etc/iscsi/iscsi.conf
/var/lib/iscsi/

Chapter 20 Sharing File Storage with NFS

yum install nfs-utils
getsebool -a|grep nfs_export
setsebool -P nfs_export_all_ro=1 nfs_export_all_rw=1
firewall-cmd --add-service nfs
firewall-cmd --reload
firewall-cmd --list-services
systemctl enable rpcbind nfs-server
/etc/exports          /common server2.example.com(rw,no_root_squash)     
/etc/fstab            server1.example.com:/common     /nfsrhcemnt   nfs _netdev,rw 0 0
/var/lib/nfs/etab
/etc/sysconfig/nfs

exportfs -avr
exportfs -u server2.example.com:/common
man exports
nfsstat
nfsiostat
mountstats

Chapter 21 Sharing File Storage with Samba

Server Message Block (SMB) now widely known as the Common Internet File System (CIFS). The Samba daemon smbd uses TCP port 445

Samba Commands
mount            Mounts a Samba share. Adds an entry to /etc/mtab
mount.cifs       Mounts a Samba share on the client.
pdbedit          Maintains a local user database in /var/lib/samba/private/smbpasswd on the server.
smbclient        Connects to a Samba share to perform FTP-like operations.
smbpasswd        Changes Samba user passwords.
testparm         Tests syntax of smb.conf file/
umount
smbclient -L //server1/common -U user10
Samba Configuration and functional files
/etc/samba/smb.conf                Samba server configuration file.
/etc/samba/smbusers                Maintains Samba and Linux user mappings.
/etc/sysconfig/samba               Contains directives used at Samba startup.
/var/lib/samba/private/smbpasswd   Maintains Samba user passwords. 
/var/log/samba                     Directory location for Samba logs.
Samba Software Packages
samba            Provides the Samba server support.
samba-client     Includes utilities for performing various operations on server and client.
samba-common     Provides Samba man pages, commands and configuration files.
samba-libs       Contains library routines used by Samba server and client.
cifs-utils       Client-side utilities for mounting and managing CIFS shares.
SELinux Requirements for Samba Operation

....

Chapter 22 Hosting Websites with Apache

==Apache commands
apachectl     Starts, stops and checks status of the httpd process. Systemctl may also be used.
htpasswd      Create and updates files to store usernames and passwords for basic authentication of Apache users.
httpd         Server program for the Apache webservice