RHCE6 Preperation (9) – SMTP,MTA, shell script, ftp

1, Configure SMTP mail service according to the following requiremnets:— Your mail server should accept mail from remote hosts and localhost— harry must be able to receive mail from remote hosts — Mail delivered to mary should spool into the default mail spool for mary /var/spool/mail/mary install the postfix, yum install -y postfix start the postfix and make it auto on when booting, service postfix start chkconfig postfix on modify the main.cf vim /etc/postfix/main.cf the original inet_interfaces is localhost, if needs to receive the internal and external mails, needs to switch on inet_interfaces = all, and comments off localhost, as following, inet_interfaces = all #inet_interfaces = $myhostname #inet_interfaces = $myhostname, localhost #inet_interfaces = localhost harry is local user, so he can receive the external mail, mary should spool into the default mail spool for mary /var/spool/mail/mary, this one also no need to do anything.

RHCE6 Preperation (8) – http, virtual host, http limited access

1, Implement a web server for the site http://serverX.example.com,then perform the following steps:— Download ftp://instructor.example.com/pub/rhce/server.html— Rename the downloaded file to index.html— Copy this index.html to DocumountRoot of your web server — Do NOT make any modifications to the content of index.html Install the http, yum install http* start the service and make it auto start when booting, service httpd start chkconfig httpd on download the server.html to the DocumentRoot cd /var/www/html/ lftp 192.168.0.254 cd pub/rhce get server.html rename it to index.html mv server.html index.html copy to the DocumentRoot, cp index.html /var/www/html Restore the default SELinux security context, restorecon –RvF * restart the httpd service, service httpd restart Test it in the Firefox, input the server3.example.com, you will get the content of the index.html or test from the instructor computer, elinks server4.example.com 2, Extend your web server to include a virtual host for the site http://wwwX.example.com/,where X is your server number,then perform the

RHCE6 Preperation (7) – vsftp,ISCSI,SMB

1, control the FTP access the system, Clients within the example.com domain should have anonymous FTP access to your machine, Clients outside example.com should NOT have access to your FTP Service modify the /etc/hosts.allow vsftpd: .example.com modify the /etc/hosts.deny vsftpd: ALL start the vsftpd and make it auto on /etc/init.d/vsftpd start chckconfig vsftpd on 2, connect to ISCSI target from instructor.example.com, you should mount this filesystem to /mnt/iscsi directory and automatically useable at system boot time check the iscsi (iscsi-initiator-utils) installed or not, if not installed, needs to install, rpm –qa |grep iscsi-initiator-utils yum –y install iscsi-initiator-utils discover the iscsi, and after the command, it will display the iqn text for the usage in the next command, iscsiadm -m discovery -t st -p 192.168.0.254 login to iscsi server, iscsiadm -m node -T iqn.2010-09.com.example:rdisks.server3 -p 192.168.0.254 -l check the iscsi attached or not, dmesg |tail fdisk -l format the attached iscsi, by fdisk /dev/sdb, then n,p,1,

RHCE6 Preperation (6) – httpd, lvm, grep, ssh, nfs

1, install the http server, make it automatically startup yum install -y http* /etc/init.d/httpdd start chkconfig httpd on 2, create logical volume, name as lv0, lv0 belong to logical group vg0, PE size as 8M, logical volume as 40 PE, formatted as ext4, mount to /data, and make it automatically mounted when start, fdisk /dev/sda to create physical partition, label as 0x8e, make it usable by partx command,   partx -a /dev/sda   create pv, pvcreate /dev/sda4 create vg, the PE size as 8M vgcreate –s 8M vg0 /dev/sda4  create lv, name as lv0, size as 40 PE.

RHCE6 Preperation (3) – find & copy, lvm resize, swap partition create

1, find the file belong to lucy and copy to a folder, create the find folder, mkdir /tmp/findfiles find the file the owner is lucy, use the parameter -user and -exec find / -user lucy -exec cp -a {} /tmp/findfiles \; 2, enlarge the lvm, no need to umount, lvextend -L 190M /dev/mapper/vgsrv-common then extend the file system, resize2fs /dev/mapper/vgsrv-common you can also use the UI to edit the logic volume size, yum install system-config-lvm system-config-lvm In the logic volume size, click the ‘edit properties’, and drag the size bar to modify the size.