Analysis on the advantages and disadvantages of Microsoft System and Linux system, many people can not say why, because the market is still the use of the Microsoft System is a little higher, especially private computers and home notebooks, most of the use of Microsoft's system, plus Microsoft's system has been upgrading, according to the needs of users to update, Very focused on the user experience, so the market system is mostly occupied by the Microsoft System. Even so, the Linux system still has its foothold, such as some enterprises and large servers in the most used or Linux system, so it seems that the Linux system is more suitable for large companies of the computer. The following small series for you to analyze the Linux system in the enterprise server how to use?
1. Basic command
1.1 File operations
(1) NEW: Touch FileName (example: Create a file named D in the TMP directory, command: TOUCH/TMP/D). (2) Cut: My old file name new file name (example: Cut the file D under TMP to root directory rename to E, command: my/tmp/d/root/e) O (3) Copy paste: Cp-rf File Source Replication Destination (example: Copy root directory to TMP directory, Command: CP one rf/root//tmp/. To copy all files in the root directory to the TMP directory, command: CP one rf/root/*/tmp/can complete operation) 0 (4) Delete: RM an RF directory name or file name (example: delete all files under the TMP directory, command: RM a rf/tmp/*).
1.2 Finding files
(1) Search according to filename: Find path a name file name (example: to find a file named grub.conf from the boot directory, command: Find/boot a name grub.conf). (2) According to the owner lookup: Find path a user name (example: to find all files belonging to root from the root directory, command: FIND/-USR root). (3) Find the currency nd path-size file size according to file size (example: to find files that have a file size smaller than lok from the root directory, command: Find/-size-1ok). (4) Comprehensive search: for example, from the boot directory to find files belonging to root and larger than L OM, and copy the found files to the TMP directory, command: Findlboot/-user root a size l om a execcp-rf{}/tmp.
1.3 Compressed Files
(1) Compression: Compressed in tar format (example: Compress the files in the/root/boot/etc directory into the F.tar under the root directory, command: TAR-CVF/F.TAR/ROOT/BOOT/ETC can complete the operation). Compress in Gap format (example: Compress the files in the/root/boot/etc directory into the f.tar.gz under the root directory, command: Tar a zcvf/f.tar.gz/root/boot/etc). To compress in bzip2 format (example: To compress files in the/root/boot/etc directory into f.tar.bz2 under the root directory, command: Tar one jzvf/f.tar.bz2/root/boot/etc) O (2) Extract: Extract files in tar format ( Example: Extract F.tar to}p directory, command: Tar one Xvf/f.tar c/tmp). Extract files in g}p format (example: Extract f.tar.gz to the TMP directory, command: Tar one zxvf/f. Tar. GZ c/tmp). Extract files in bzip2 format (example: Extract f.tar.bz2 to the TMP directory, command: tar-jxvf/f. tar. bz2 c/tmp).
2, build the FTP server
FTP Server is a file sharing server, can upload download files, usually have anonymous login and username password login two ways.
2.1 Anonymous Logins
Query installation: RPM One Qa}grep vsftpd, installation: Yum install YVSFTPD, open service: Chkconfig vsftpd on, edit profile: vi/etc/vsftpd/vsftpd. conf ( Anonymous_enable=yes, remove #: #anon_upload_enable去掉 #: #anon_mkdir_write_enable =yes), save after editing:: W, restart services: Service Vsftpdrestart, Modify permissions: chmod o w/var/ftp/pub, set selinux permissions: Setsebool one pallow_ftpd_anon_write=1 a Chcon Rw_t/var/ftp/pub.
2.2 Authentication Login
Edit profile: vi/etc/vsftpd/vsftpd. conf (anonymous_enable=no;chroot local_user=yes) Save after Edit:: w Restart services: Service vsftpd restart, Set SELinux permissions: Setsebool a pftp_home_dir=1.
3. Build Samba Server
Samba server is a Windows operating system and Linux operating system file sharing server, upload download files, usually have anonymous login and username password login two ways.
3.1 Anonymous Logins
Create a shared directory: mkdir/m, query is installed: RPM one Qalgrepsamba, installation: Yum install Ysamba, open service: Chkconfig SMB on, edit profile: Vi/etc/samba/smb. Conf (remove semicolon:; Interfaces=loeth0 192 168.0.5 Remove the semicolon:; hosts Allow=192.168.0.security=share in
Add: [Ziliao 1] Next line: path=/m/next line: Public=yes next line Veritable=yes,
Save after editing:: W, restart services: Service SMB Restart, modify permissions: Chmodo x/m, set SELinux permissions: Chcon one R a T samba_share_t/m, Mount: Vi/etc/fstab (//192. 168. 0.5/ziliao 1/mnt/anonymouscifs username=anonymous,password= "" 00).
3.2 Authentication Login
Create a shared directory: mkdir/n, add Users: Useradd smb01 usesradd smb02, set user password: passwd smb01 (set password is 111111 passwd smb02 (set password is 222222), Set the password to log on to the Samba server: SMBPASSWD a SMB01 (set password is 333333) one smbpasswd a smb02 (set the password to 444444), edit the configuration file: Vi/etc/samba/smb. Conf (Security=user in
Add: [Ziliao2] Next line: path=/n Next: Valid USERS=SMB01,SMB02 Next: Readlist=smb01 Next: Write List=smb02, save after editing:; W, restart Services: Service SMB Restart, modify permissions: chmod o w/n, set selinux permissions: Chcon one R a T samba_share_t/n, Mount: Vi/etc/fstab (//192.168.0.5/ ZILIAO2/MNT/SMBL cifs username=smbol,password= "333333" 00 Next line://192.168.0. 5/ZILIAO2/MNT/SMB2CIFSUSERNAME=SMB02, password= "444444" 00).
4, build Apache server
The Apache server is a Web server that is used for Web site publishing and can usually be logged in directly or through user name password authentication. The Authentication logon configuration process is relatively complex, with an emphasis on authenticating access. Query is installed: RPM a qalgrephttpd, installation: Yum install a Y httpd, open the service: Chkconfig Httpdon, edit the configuration file: vi/etc/httpd/conf/httpd. Conf (292 lines is the location of the home page, the default is/var/www/html, you can not modify the 343 line order AlLow deny and the following two lines: AlLow from Ip,deny to control the access from the IP, can be modified as necessary; Add the following statement to the space between lines 340 and 343: AuthType basic Next: AuthName "Please login:" Next line: AuthUserFile "ietc/httpd/. HTPASSWD Next line: Require valid-user,402 row is the home page name, the default is index.html, you do not need to modify. Generates an authentication file: htpasswd-c/etc/httpd/. HTPASSWD WEB01, restart Services: Service httpd Restart, modify permissions: Chmod a x/var/www/html/index.html, set SELinux permissions: Chcon one t httpd sys_ Content T/var/www/html/index. Html.
5, mail server
5.1 Send mail
Query installation: RPM One qalgrep postfix, installation: Yum install Ypostfix, open service: Chkconfig postfix on, edit profile: Vi/etc/postfix/main. CF (75 line is the host name minus # =mail. Test. COM, 83 lines is the domain name removed # =test. COM, 99 lines is outward when the letter is identified as an external identity to remove # myorigin= $myorigin, 113 line is the listening port to remove # inet Interfaces=all at the same time 116 lines add #, 164 lines Add # 165 line to remove the # number, Line 264 is access control remove # mynetworks=192.168.0.0/24,172.24.0.0/16, restart Service: services postfix restart.
5.2 Offline mail delivery
Query installation: Rpm-qalgrep dovecot, installation: Yum instally dovecot, open service: Chkconfig dovecot on, edit profile: v1/etc/dovecot/dovecot.conf ( 25 lines minus #, add the following statement on line 26: maillocation space = Space mbox: one/mail/: inbox=/var/mail/%u) Restart Service: Services dovecot restart.
5.3 Online Mail
Installation: Yum install-y mutt, view mailbox: Mutt-f Pop://root@mail. Test. Com.
Even if the Microsoft system in the market share so high, still can not erase the advantages of Linux system, the above small series is introduced in the Linux system on the use of large servers advantage, or very comfortable!