8008, 8009, 8443Every time you change a context it will be restored in the next file system relabel (next reboot).To make changes permanentely run:semanage fcontext -a -t httpd_sys_content_t file1TIP:some daemons have man pages talking about the contexts and booleans used by them. take a look:[root@zeus ~]# apropos _selinuxftpd_selinux (8) - Security-Enhanced Linux policy for ftp daemonshttpd_selinux (8) - Security Enhanced Linux Policy for the httpd daemoninit_selinuxmnt (3) - initialize the global variable selinux_mntis_selinux_enabled (3) - check whether SELinux is enabledkerberos_selinux (8) - Security Enhanced Linux Policy for Kerberosnamed_selinux (8) - Security Enhanced Linux Policy for the Internet Name server (named) daemonnfs_selinux (8) - Security Enhanced Linux Policy for NFSpam_selinux (8) - PAM module to set the default security contextrsync_selinux (8) - Security Enhanced Linux Policy for the rsync daemonsamba_selinux (8) - Security Enhanced Linux Policy for Sambaypbind_selinux (8) - Security Enhanced Linux Policy for NISsemanage fcontext -a -t httpd_sys_content_t "/newweb(/.*)?"restorecon -R -v /newweb-------------Firewall iptables -p icmp -hshow all the possible icmp types :-)POSTROUTING -> SNAT --to-source x.x.x.x OR MASQUERADE----------Rsyslog/etc/rsyslog.confforwarding message to other host: Remote machine There are three ways to forward message: the traditional UDP transport, which is extremely lossy but standard, the plain TCP based trans- port which loses messages only during certain situations but is widely available and the RELP transport which does not lose messages but is currently available only as part of rsyslogd 3.15.0 and above. To forward messages to another host via UDP, prepend the hostname with the at sign ("@"). To forward it via plain tcp, prepend two at signs ("@@"). To forward via RELP, prepend the string ":omrelp:" in front of the hostname. Example: *.* @192.168.0.1------ApacheTest/Parse the config file:service httpd configtesteVirtualHostNameVirtualHost 192.168.56.200:80<VirtualHost 192.168.56.200:80>serverName site1.asdf.comDocumentRoot "/var/www/site1"</VirtualHost><VirtualHost 192.168.56.200:80>Servername site2.asdf.comDocumentRoot "/var/www/site2"</VirtualHost>Password protected<Directory "/var/www/html/protected"> AuthType basic AuthName "You are out" AuthUserFile "/var/www/html/protected/.users" Require user lutieri Options Indexes Order deny,allow</Directory>CGI ScriptsScriptAlias /bin "/var/www/site1/bin"OR<Directory "/var/www/site1/bin/">options ExecCGI Indexes</Directory>Addhandler cgi-script .lgbThe script will need to produce HTML output. Usually means that the first line in your script needs to print out which mime type the script will produce. I.E:#!/bin/bashecho "Content-type: text/html\n\n";echo "Hello, World.";Except that I found out that printing a blank line instead of content-type... also works great.----------Postfixalternatives --config mta-----------Bind[root@zeus ~]# cat /var/named/dynamic/asdf.com$TTL 1D@ IN SOA @ rname.invalid. ( 0 ; serial 1D ; refresh 1H ; retry 1W ; expire 3H ) ; minimum NS @ A 127.0.0.1site1 A 192.168.56.201site2 A 192.168.56.202Master zone[root@zeus ~]# cat /etc/named.conf---SNIP---zone "asdf.com" IN { type master; file "dynamic/asdf.com";};---SNIP---Forward zone:the directive Forwarders can also be used in the global context.zone "asdf.com" IN { type forward; forwarders { 66.33.206.206; };};--------------SambaIf you create a directory and would like to share it, run: chcon -t samba_share_t /pathAllowing home directories to be shared:[root@zeus ~]# setsebool -P samba_enable_home_dirs on[root@zeus ~]# getsebool samba_enable_home_dirssamba_enable_home_dirs --> on[root@zeus ~]# semanage boolean -l | grep samba_enable_home_dirssamba_enable_home_dirs -> on Allow samba to share users home directories.-P make the change to the boolean persistent across reboots.OR semanage boolean -m --on samba_enable_home_dirs-----------VsftpdAllow anonymoys uploadsetsebool ftp_home_dir 1chcon -t public_content_rw_t /var/ftp/pubsetsebool allow_ftpd_anon_write 1chgrp -R ftp: /var/ftp/dropboxchmod g=wx /var/ftp/dropboxcat /etc/vsftpd/vstfpd.confanonymous_enable=YES## Uncomment this to allow local users to log in.local_enable=YES## Uncomment this to enable any