Linux系統服務及應用(微課版)
趙凱,呂志強
相關主題
商品描述
目錄大綱
目 錄
第1章 Linux系統建立 ...................................................................................1
1.1 Linux簡介 ...........................................................................................1
1.1.1 Linux的產生與發展 ...............................................................1
1.1.2 Linux的基本特性 ...................................................................1
1.1.3 常用的Linux版本 ..................................................................2
1.2 VMware的使用 ..................................................................................3
1.2.1 虛擬機的安裝 .........................................................................3
1.2.2 RHEL的安裝 ..........................................................................5
1.3 Linux的啟動與關閉 .........................................................................10
1.3.1 引導Linux .............................................................................10
1.3.2 root口令的恢復 ....................................................................12
1.3.3 用戶登錄 ...............................................................................13
1.3.4 系統重啟與關閉 ...................................................................14
1.4 Linux網絡配置 ................................................................................15
本章小結 ....................................................................................................19
習題 ............................................................................................................19
第2章 Linux終端操作 .................................................................................20
2.1 Linux終端操作基礎 .........................................................................20
2.1.1 Linux文件及操作符 .............................................................20
2.1.2 Linux目錄結構 .....................................................................21
2.1.3 Linux的RPM包 ..................................................................22
2.1.4 Linux的tar包 ......................................................................23
2.2 目錄和文件操作命令 .......................................................................25
2.3 用戶管理命令 ...................................................................................34
2.4 系統管理命令 ...................................................................................39
本章小結 ....................................................................................................44
習題 ............................................................................................................44
第3章 Shell編程 ...........................................................................................45
3.1 文本編輯器vi簡介 ..........................................................................45
3.1.1 vi基本概念 ...........................................................................45
3.1.2 vi輸入模式 ...........................................................................45
3.1.3 刪除與修改操作 ...................................................................46
3.1.4 移動光標命令 ..................................................................................................46
3.1.5 編輯命令 ..........................................................................................................46
3.1.6 文件操作指令 ..................................................................................................47
3.2 Bash Shell編程 ............................................................................................................47
3.2.1 環境變量 ..........................................................................................................48
3.2.2 運算符 ..............................................................................................................50
3.2.3 常用命令 ..........................................................................................................53
3.2.4 if語句 ...............................................................................................................55
3.2.5 for循環結構 .....................................................................................................56
3.2.6 while和until ....................................................................................................57
3.2.7 case語句 ..........................................................................................................58
3.2.8 Bash中的函數 .................................................................................................59
3.3 Awk語言介紹 ..............................................................................................................60
3.3.1 變量 ..................................................................................................................61
3.3.2 顯示文件中指定分段內容 ..............................................................................63
3.3.3 顯示文件特定行指定段的內容 ......................................................................64
3.3.4 多條件語法 ......................................................................................................65
3.3.5 多行記錄的結構 ..............................................................................................65
3.3.6 循環結構 ..........................................................................................................67
3.3.7 數組 ..................................................................................................................68
本章小結 ...............................................................................................................................70
習題 ......................................................................................................................................71
第4章 Linux常用服務 ............................................................................................................72
4.1 遠程登錄服務 ..............................................................................................................72
4.2 Samba原理與應用 .......................................................................................................74
4.2.1 Samba的由來 ..................................................................................................74
4.2.2 Samba的組成 ..................................................................................................75
4.2.3 Samba的安裝、運行與使用 ..........................................................................76
4.2.4 用Shell程序建立smb用戶 ...........................................................................79
4.2.5 smb.conf配置文件 ..........................................................................................79
4.3 Apache Web服務器 .....................................................................................................83
4.3.1 Apache的由來與特點 .....................................................................................83
4.3.2 Apache的安裝與運行 .....................................................................................83
4.3.3 Apache的配置文件httpd.conf ........................................................................86
4.3.4 Apache目錄和文件訪問控制 .........................................................................89
4.3.5 虛擬主機 ..........................................................................................................92
4.4 DNS ..............................................................................................................................95
4.4.1 DNS的概念 .....................................................................................................95
4.4.2 DNS中的術語及求解過程 .............................................................................96
4.4.3 本地DNS服務器的結構 ................................................................................97
4.5 FTP服務器 .................................................................................................................104
4.5.1 ProFTPD匿名登錄異常分析 ........................................................................106
4.5.2 VSFTP服務器 ...............................................................................................107
本章小結 .............................................................................................................................112
習題 ....................................................................................................................................112
第5章 MySQL數據庫應用 ...................................................................................................114
5.1 MySQL數據庫的結構與建立 ..................................................................................114
5.1.1 MySQL數據庫的結構 ..................................................................................114
5.1.2 數據庫的建立 ................................................................................................115
5.2 MySQL數據庫中數據的操作 ..................................................................................121
5.2.1 表的修改操作 ................................................................................................121
5.2.2 查詢數據 ........................................................................................................123
5.3 MySQL數據庫的用戶權限 ......................................................................................125
5.3.1 用戶權限 ........................................................................................................125
5.3.2 增加新用戶 ....................................................................................................125
5.3.3 取消權限 ........................................................................................................126
5.3.4 刪除用戶 ........................................................................................................127
5.3.5 MySQL管理軟件 ..........................................................................................127
本章小結 .............................................................................................................................129
習題 ....................................................................................................................................129
第6章 PHP編程初步 .............................................................................................................131
6.1 HTML基礎 ................................................................................................................131
6.1.1 基本HTML標記 ...........................................................................................131
6.1.2 HTML頁面舉例 ............................................................................................132
6.1.3 框架 ................................................................................................................133
6.1.4 JavaScript ........................................................................................................134
6.2 PHP操作符與變量 ....................................................................................................136
6.2.1 常量 ................................................................................................................136
6.2.2 運算符 ............................................................................................................137
6.2.3 變量 ................................................................................................................138
6.3 PHP程序控制語句 ....................................................................................................142
6.3.1 條件語句 ........................................................................................................142
6.3.2 循環語句 ........................................................................................................143
6.3.3 開關控制語句 ................................................................................................144
6.3.4 中斷語句 ........................................................................................................146
6.4 文件和字符串操作 ....................................................................................................147
6.4.1 文件和字符串操作常用函數 ........................................................................147
6.4.2 基於文件操作的留言板 ................................................................................150
6.4.3 PHP在Linux中以Shell方式運行 ..............................................................152
6.5 PHP對MySQL數據庫的訪問 .................................................................................154
6.5.1 常用數據庫函數 ............................................................................................154
6.5.2 MySQL數據庫的留言板 ..............................................................................156
本章小結 .............................................................................................................................160
習題 ....................................................................................................................................160
第7章 Linux擴展服務 ..........................................................................................................161
7.1 Qmail的應用 .............................................................................................................161
7.1.1 創建Qmail主目錄和運行用戶 ....................................................................161
7.1.2 安裝Qmail .....................................................................................................162
7.1.3 調試Qmail .....................................................................................................163
7.1.4 安裝vpopmail參考 .......................................................................................166
7.1.5 郵件發送和接收實驗 ....................................................................................169
7.2 DHCP服務器建立 .....................................................................................................170
7.2.1 DHCP服務器的安裝 .....................................................................................171
7.2.2 dhcpd配置文件dhcpd.conf ...........................................................................171
7.2.3 DHCP服務器的備份與中轉 .........................................................................172
7.3 代理服務的使用 ........................................................................................................173
7.3.1 Apache代理服務 ...........................................................................................173
7.3.2 Squid代理服務 ..............................................................................................174
7.4 綜合安裝各種服務Shell程序 ..................................................................................177
7.4.1 網絡參數和啟動程序設置 ............................................................................177
7.4.2 參考安裝程序Shell腳本 ..............................................................................178
本章小結 .............................................................................................................................182
習題 ....................................................................................................................................183
第8章 Linux防火牆iptables ................................................................................................184
8.1 防火牆的任務 ............................................................................................................184
8.2 TCP的狀態與連接 ....................................................................................................185
8.2.1 狀態 ................................................................................................................185
8.2.2 TCP的三次握手過程 ....................................................................................186
8.2.3 TCP三次握手的狀態 ....................................................................................189
8.2.4 ICMP的狀態 .................................................................................................190
8.3 iptables中的表和鏈 ...................................................................................................190
8.3.1 filter表 ............................................................................................................190
8.3.2 nat表 ..............................................................................................................191
8.3.3 mangle表 .......................................................................................................191
8.3.4 iptables的流程 ...............................................................................................192
8.4 iptables中的規則 .......................................................................................................192
8.4.1 數據包的匹配方式和限制 ............................................................................193
8.4.2 非正常包的匹配 ............................................................................................193
8.4.3 常用命令 ........................................................................................................194
8.5 防火牆舉例 ................................................................................................................196
8.5.1 測試iptables防火牆的filter表中鏈的工作情況 ........................................196
8.5.2 防火牆例題分析 ............................................................................................198
本章小結 .............................................................................................................................201
習題 ....................................................................................................................................201
參考文獻.....................................................................................................................................202
附錄A iptables參考手冊........................................................................................................203
附錄B 常見TCP埠列表 ....................................................................................................211
附錄C 習題參考答案 ..............................................................................................................215