Thông tin tài liệu
Managing Linux
®
Systems
with
Webmin
™
PRENTICE HALL
P
ROFESSIONAL TECHNICAL REFERENCE
UPPER SADDLE RIVER, NJ 07458
WWW.PHPTR.COM
Managing Linux
®
Systems
with
Webmin
™
System Administration and Module Development
Jamie Cameron
Library of Congress Cataloging-in-Publication Data
Cameron, Jamie.
Managing Linux systems with Webmin / Jamie Cameron.
p. cm.
ISBN 0-13-140882-8
1. Linux. 2. Operating systems (Computers). I. Title.
QA76.76.O63 C3545 2003
005.4’32—dc22
2003016330
Editorial and production services: TIPS Technical Publishing, Inc.
Cover design director: Jerry Votta
Cover design: Nina Scuderi
Manufacturing buyer: Maura Zaldivar
Executive Editor: Jill Harry
Editorial assistant: Brenda Mulligan
Marketing manager: Dan DePasquale
© 2004 by Jamie Cameron
Published by Pearson Education, Inc.
Publishing as Prentice Hall Professional Technical Reference
Upper Saddle River, New Jersey 07458
This material may be distributed only subject to the terms and conditions set forth in the Open Publication
License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/).
Prentice Hall PTR offers excellent discounts on this book when ordered in quantity for bulk purchases
or special sales.þ For more information, please contact: U.S. Corporate and Government Sales,
1-800-382-3419, corpsales@pearsontechgroup.com. For sales outside of the U.S., please contact:
International Sales, 1-317-581-3793, international@pearsontechgroup.com.
Company and product names mentioned herein are the trademarks or registered trademarks
of their respective owners.
Printed in the United States of America
First Printing
ISBN 0-13-140882-8
Pearson Education LTD.
Pearson Education Australia PTY, Limited
Pearson Education Singapore, Pte. Ltd.
Pearson Education North Asia Ltd.
Pearson Education Canada, Ltd.
Pearson Educación de Mexico, S.A. de C.V.
Pearson Education—Japan
Pearson Education Malaysia, Pte. Ltd.
Contents at a Glance
IINTRODUCTION
1 Introduction to Webmin 1
2 Installing Webmin 6
3 Securing Your Webmin Server 14
II S
YSTEM MODULES
4 Users and Groups 19
5 Disk and Network Filesystems 39
6 NFS File Sharing 53
7 Disk Quotas 60
8 Partitions, RAID, and LVM 68
9 Bootup and Shutdown 84
10 Scheduled Commands 93
11 Process Management 99
12 Software Packages 105
13 System Logs 113
14 Filesystem Backups 121
15 Internet Services 129
16 Network Configuration 144
17 Network Information Service 154
18 PPP Server Configuration 165
19 Firewall Configuration 173
20 Setting the Date and Time 191
21 Boot Loader Configuration 195
22 Printer Administration 205
23 Voicemail Server Configuration 215
24 Remote Shell Login 220
25 Running Custom Commands 224
26 Webmin’s File Manager 232
27 Perl Modules 244
28 Status Monitoring with Webmin 250
III S
ERVER MODULES
29 Apache Web Server Configuration 264
30 DNS Server Configuration 315
31 CVS Server Configuration 354
32 DHCP Server Configuration 361
33 Downloading Email with
Fetchmail 378
34 Managing Majordomo Mailing
Lists 388
35 The MySQL Database 405
36 The PostgreSQL Database 428
37 Configuring Sendmail 448
38 Configuring Qmail 476
39 Analyzing Log Files 491
40 The ProFTPD Server 500
41 The WU-FTPD Server 525
42 SSH Server Configuration 544
43 Windows File Sharing with
Samba 554
44 Configuring the Squid Proxy
Server 577
45 Filtering Email with Procmail 605
46 Creating SSL Tunnels 615
47 Usermin Configuration 620
IV C
LUSTER MODULES
48 Cluster Software Management 643
49 Cluster User Management 649
50 Cluster Webmin Configuration 660
VW
EBMIN MODULES
51 Webmin Configuration 669
52 Webmin Access Control 688
53 Webmin Servers 700
54 Logging in Webmin 707
VI D
EVELOPER’S GUIDE
55 Webmin Module Development 710
56 Advanced Module Development 721
57 Inside the Scheduled Cron Jobs
Module 734
58 Creating Webmin Themes 741
59 Inside the MSC Theme 747
60 The Webmin API 751
Contents
IINTRODUCTION
1 Introduction to Webmin 1
What is Webmin? 1
Who Should Use Webmin? 2
How and Why Was it Developed? 3
What is this Book About? 4
Who Should Read this Book? 4
Conventions Used in this Book 5
Acknowledgments 5
2 Installing Webmin 6
Downloading Webmin for Your System 6
Installing the RPM Package 7
Installing the tar.gz Package 8
Installing the Solaris Package 10
The Webmin User Interface 10
Uninstalling Webmin 13
Summary 13
3 Securing Your Webmin Server 14
Network Security 14
SSL Encryption 15
Requesting a Valid SSL Certificate 17
Summary 18
II SYSTEM MODULES
4 Users and Groups 19
Introduction to UNIX Users and Groups 19
The Users and Groups Module 20
Creating a New User 21
Editing an Existing User 23
Deleting a User 24
Creating a New Group 25
Editing an Existing Group 26
Deleting a Group 27
Viewing Recent and Current Logins 27
Reading Users’ Email 28
Creating Users from Batch Files 28
Configuring the Users and Groups
Module 30
Before and After Commands 34
Module Access Control 34
Other Operating Systems 37
Summary 38
5 Disk and Network Filesystems 39
Introduction to Filesystems 39
The Disk and Network Filesystems
Module 40
Mounting an NFS Network Filesystem 40
Mounting an SMBFS Windows
Networking Filesystem 43
Mounting a Local ext2 or ext3 Hard Disk
Filesystem 44
Mounting a Local Windows Hard Disk
Filesystem 45
Adding Virtual Memory 46
Automounter Filesystems 47
Editing or Removing an Existing
Filesystem 48
Listing Users of a Filesystem 48
Module Access Control 49
Configuring the Disk and Network
Filesystems Module 50
A Comparison of Filesystem Types 50
Other Operating Systems 51
Summary 52
6 NFS File Sharing 53
Introduction to File Sharing with NFS 53
The NFS Exports Module 54
Exporting a Directory 54
Editing or Deleting an NFS Export 55
NFS on Solaris 56
NFS on BSD, MacOS X and
OpenServer 57
NFS on Irix 59
Summary 59
7 Disk Quotas 60
Introduction to Disk Quotas 60
The Disk Quotas Module 61
Enabling Quotas for a Filesystem 62
Disabling Quotas for a Filesystem 62
viii Contents
Setting Quotas for a User or Group 63
Copying Quotas to Multiple Users 63
Setting Grace Times 64
Setting Default Quotas for New Users 65
Other Operating Systems 66
Configuring the Disk Quotas Module 66
Module Access Control 66
Summary 67
8 Partitions, RAID, and LVM 68
Introduction to Hard Disk Partitions 68
The Partitions on Local Disks Module 69
Adding and Formatting a New Partition 70
Creating a New Filesystem 70
Partition Labels 71
Deleting or Changing a Partition 72
Module Access Control 73
Other Operating Systems 74
Introduction to RAID 74
The Linux RAID Module 75
Introduction to LVM 77
The Logical Volume Management
Module 78
Creating a New Volume Group 79
Adding and Removing a Physical
Volume 80
Creating and Deleting a Logical
Volume 80
Resizing a Logical Volume 81
Creating a Snapshot 82
Summary 83
9 Bootup and Shutdown 84
Introduction to the Linux Boot Process 84
The Bootup and Shutdown Module 85
Configuring an Action to Start at
Bootup 85
Starting and Stopping Actions 86
Adding a New Action 87
Rebooting or Shutting Down Your
System 89
Configuring the Bootup and Shutdown
Module 89
Other Operating Systems 89
The SysV Init Configuration Module 91
Summary 92
10 Scheduled Commands 93
Introduction to Cron Jobs 93
The Scheduled Cron Jobs Module 93
Creating a New Cron Job 94
Editing a Cron Job 95
Controlling Users’ Access to Cron 96
Module Access Control Options 96
Configuring the Scheduled Cron Jobs
Module 96
Other Operating Systems 97
The Scheduled Commands Module 97
Creating a New Scheduled Command 98
Summary 98
11 Process Management 99
Introduction to Processes 99
The Running Processes Module 99
Viewing, Killing, or Reprioritizing a
Process 101
Searching for Processes 102
Running a Process 103
Module Access Control Options 103
Other Operating Systems 104
Summary 104
12 Software Packages 105
Introduction to Packages 105
The Software Packages Module 107
Installing a New Package 107
Finding and Removing a Package 109
Updating on Debian Linux 110
Updating on Red Hat Linux 111
Other Operating Systems 111
Summary 112
13 System Logs 113
Introduction to Logging 113
The System Logs Module 115
Adding a New Log File 115
Editing or Deleting a Log File 117
Module Access Control 118
Other Operating Systems 119
Summary 120
Contents ix
14 Filesystem Backups 121
Introduction to Backups with Dump 121
The Filesystem Backup Module 121
Adding a New Backup 122
Making a Backup 124
Editing or Deleting a Backup 125
Restoring a Backup 125
Configuring the Filesystem Backup
Module 126
Other Operating Systems 128
Summary 128
15 Internet Services 129
Introduction to Internet Services 129
The Internet Services and Protocols
Module 130
Enabling an Internet Service 133
Creating Your Own Internet Service 133
Creating and Editing RPC Programs 135
Configuring the Internet Services and
Protocols Module 136
Other Operating Systems 138
The Extended Internet Services
Module 139
Enabling or Editing an Extended Internet
Service 140
Creating an Extended Internet Service 141
Editing Default Options 142
Summary 143
16 Network Configuration 144
Introduction to Linux Networking 144
Viewing and Editing Network
Interfaces 146
Adding a Network Interface 147
Configuring Routing 149
Changing the Hostname or DNS Client
Settings 150
Editing Host Addresses 151
Module Access Control 152
Other Operating Systems 153
Summary 153
17 Network Information Service 154
Introduction to NIS 154
Becoming an NIS Client 155
Setting Up an NIS Master Server 157
Editing NIS Tables 159
Securing Your NIS Server 160
Setting Up an NIS Slave Server 163
Configuring the NIS Client and Server
Module 163
NIS on Solaris 163
Summary 164
18 PPP Server Configuration 165
Introduction to PPP on Linux 165
Configuring a PPP Server 166
Managing PPP Accounts 169
Restricting Access by Caller ID 171
Module Access Control 172
Summary 172
19 Firewall Configuration 173
Introduction to Firewalling with
IPtables 173
The Linux Firewall Module 175
Allowing and Denying Network
Traffic 177
Changing a Chain’s Default Action 181
Editing Firewall Rules 182
Creating Your Own Chain 182
Setting Up Network Address
Translation 183
Setting Up a Transparent Proxy 184
Setting Up Port Forwarding 185
Firewall Rule Conditions 186
Configuring the Linux Firewall
Module 189
Summary 189
20 Setting the Date and Time 191
The System Time Module 191
Changing the System Time 192
Change the Hardware Time 192
Synchronizing Times with Another
Server 193
Module Access Control 193
Other Operating Systems 193
Summary 194
x Contents
21 Boot Loader Configuration 195
Introduction to Boot Loaders 195
The Linux Bootup Configuration
Module 196
Booting a New Kernel with LILO 197
Booting Another Operating System with
LILO 198
Editing Global LILO Options 199
The GRUB Boot Loader Module 200
Booting a New Linux Kernel or BSD with
GRUB 201
Booting Another Operating System with
GRUB 202
Editing Global GRUB Options 202
Installing GRUB 203
Configuring the GRUB Boot Loader
Module 203
Summary 203
22 Printer Administration 205
Introduction to Printing on Linux 205
The Printer Administration Module 206
Adding a New Printer 206
Editing an Existing Printer 209
Managing Print Jobs 210
Configuring the Printer Administration
Module 211
Module Access Control 212
Other Operating Systems 213
Summary 214
23 Voicemail Server Configuration 215
The Voicemail Server Module 215
Configuring Your System as an Answering
Machine 216
Listening to Recorded Messages 218
Setting a Greeting Message 219
Summary 219
24 Remote Shell Login 220
The SSH/Telnet Login Module 220
Configuring the SSH/Telnet Login
Module 220
The Command Shell Module 222
The Shell In A Box Module 223
Summary 223
25 Running Custom Commands 224
The Custom Commands Module 224
Creating a New Command 225
Parameter Types 227
Creating a New File Editor 229
Module Access Control 230
Configuring the Custom Commands
Module 231
Summary 231
26 Webmin’s File Manager 232
The File Manager Module 232
Navigating Directories and Viewing
Files 232
Manipulating Files 234
Creating and Editing Files 234
Editing File Permissions 235
Creating Links and Directories 236
Finding Files 237
Editing EXT File Attributes 237
Editing XFS File Attributes 238
Editing File ACLs 239
Sharing Directories 240
Module Access Control 242
Summary 243
27 Perl Modules 244
Introduction to Perl Modules 244
Perl Modules in Webmin 245
Installing a Perl Module 245
Viewing and Removing a Perl Module 247
Configuring the Perl Modules Module 248
Summary 248
28 Status Monitoring with Webmin 250
The System and Server Status Module 250
Adding a New Monitor 252
Monitor Types 253
Setting Up Scheduled Monitoring 260
Module Access Control 262
Configuring the System and Server Status
Module 262
Summary 263
[...]... LDAP server, this module is not for you 19 SYSTEM MODULES T his chapter is devoted to the Users and Groups module, which allows you to create and manage UNIX user accounts and UNIX groups PART II C 20 Chapter 4 • Users and Groups 4.2 The Users and Groups Module The Webmin module Users and Groups that is found under the System category (as shown in Figure 4.1) can be used to create, edit, and delete all... lots more operating systems, and offered many other features The Linux distribution companies Caldera and MSC .Linux have supported the project financially, and many users have made contributions of code patches, modules, translations, and suggestions In addition to the standard modules, over 100 have been written by other people and are available to be added to Webmin on your system once you have installed... Creating, editing, and deleting UNIX login accounts on your system Exporting files and directories to other systems with the NFS protocol Setting up disk quotas to control how much space users can take up with their files Installing, viewing, and removing software packages in RPM and other formats Changing your system' s IP address, DNS settings, and routing configuration Setting up a firewall to protect... Server Module 363 Adding and Editing Subnets 365 Viewing and Deleting Leases 369 Editing Global Client Options 370 Adding and Editing Fixed Hosts 370 Adding and Editing Shared Networks 372 Adding and Editing Groups 373 Module Access Control 374 Configuring the DHCP Server Module 375 Summary 377 33 Downloading Email with Fetchmail 378 Introduction to Fetchmail 378 The Fetchmail Mail Retrieval Module. .. almost all of its modules, and how to write your own The book focuses on the standard modules that come with the Webmin package, not those written by other people Not all of the 83 standard modules are covered, however, as some are not very useful to the average administrator Although this book is written primarily for Linux users, the program behaves almost identically on other operating systems Each chapter... security H A P T E R 4 Users and Groups 4.1 Introduction to UNIX Users and Groups On Linux and other UNIX operating systems, a user is a person who can login to the system via SSH, telnet, FTP or at the console Users can also receive email and own files on the server's local filesystems Each user has a login name, a password, and a home directory in which all its files are stored Users also have several... Types 412 Viewing and Editing Table Contents 412 Deleting Tables and Databases 416 Executing SQL Commands 417 Backing Up and Restoring a Database 417 Managing MySQL Users 419 Managing Database, Host, Table, and Field Permissions 421 Module Access Control 423 Configuring the MySQL Database Server Module 424 Summary 427 428 Introduction to PostgreSQL 428 The PostgreSQL Database Server Module 429 Creating... access to the Internet • Creating and configuring virtual web sites for the Apache Web server • Managing databases, tables, and fields in a MySQL or PostgreSQL database server • Sharing files with Windows systems by configuring Samba These are just a few of the available functions Webmin lets you configure almost all of the common services and popular servers on UNIX systems using a simple web interface... most Linux distributions as standard, or can be freely downloaded and installed 1.2 Who Should Use Webmin? Webmin was written for use by people who have some Linux experience but are not familiar with the intricacies of system administration Even though it makes the process of creating UNIX users or managing the Squid proxy server easy, you must first have some idea of what a UNIX account is and what... The Procmail Mail Filter Module 606 Setting Up Sendmail 606 Creating and Editing Actions 608 Creating and Editing Variable Assignments 611 Conditional Blocks and Include Files 612 Filtering Spam with SpamAssassin 613 Configuring the Procmail Mail Filter Module 614 Summary 614 46 Creating SSL Tunnels 615 Introduction to SSL and STunnel 615 The SSL Tunnels Module 616 Creating and Editing SSL Tunnels 617 . Linux
®
Systems
with
Webmin
™
System Administration and Module Development
Jamie Cameron
Library of Congress Cataloging-in-Publication Data
Cameron, Jamie.
Managing. Commands 34
Module Access Control 34
Other Operating Systems 37
Summary 38
5 Disk and Network Filesystems 39
Introduction to Filesystems 39
The Disk and Network
Ngày đăng: 08/03/2014, 23:20
Xem thêm: Managing Linux Systems with Webmin: System Administration and Module Development docx