From: http://www.fixdown.com/Article/Article/1747.htmauthor: anonymousdate: 2004-02-19
I. Implementation of dynamic domain names 1. Dynamic domain name basic construction Linux server is a system engineering, involving hardware purchase, software installation, domain name application, network service providing, etc. The premise here is the application of the domain name, because for users who are virtual dial-up Internet, those used are dynamic IP addresses, others can't contact you.
The solution is to use the dynamic domain name resolution tool. By running a special client program, once the dial user is online, the current dynamic IP address will be sent to a special dynamic domain resolution server, and then the dynamic domain name resolution server can be timely. Update your own database and point a "fixed" domain name to the temporary IP address. This way, no matter how much IP address is now, we can always access our Linux servers through a fixed domain name.
It should be noted that the IP address owned by the computer should be a public IP address, which is an IP address used by the Internet, not an intranet (LAN) IP address.
2. Dynamic domain name analysis (1) Register a dynamic domain name
We can register a user account to Komai.com http://www.comexe.cn/register.php. Then click on the "Domain Name Management" page, register a suitable name (such as MyName), you will get a second-level domain name for MyName.kmip.net, then click "Submit" button, if the domain name is not registered by others, you can take effect immediately.
Note: This article assumes that the user has fully installed Red Hat Linux 9.0 and uses the KDE desktop system.
(2) Install the dynamic domain name analysis tool
After the registration is successful, we can download the dynamic domain resolution tool in http://www.comexe.cn/client/linux_i.tar.gz (eg, version number "public network VER 2.00 Build 104"). The download is a compressed file, build a directory in the system, such as / usr / local / comXe, extract the downloaded file to this directory.
[root @ ahpeng root] # CD / TMP
[root @ ahpeng TMP] # tar -xvzf linux_i.tar.gz
[root @ ahpeng TMP] # CP pipclient / usr / local / comexe / pipclient
(3) Configure the client
After decompression, get an execution file PipClient. Switch to the directory and run the following command:
[root @ ahpeng comexe] # ./ pipclient
The first time the PipClient will be required to enter configuration information:
[root @ ahpeng comexe] # ./ pipclient
USAGE: PIPCLIENT -H -C -W / HOME / PIPCLIENT
-H: Help Message.
--C: do configuration.
-W
Do Configuration Now.
Input User Name:
Here, enter the following configuration information by screen prompt:
Input user name: // User name registered in Komai.com
Input Password: // Komai.com User Password
Input Domain: // Domain Name
INPUT OFFLINE URL OR OFFLINE IP (ENTER for None): // Domain Name Offline URL. If you don't, press the Enter key directly. Here to pay attention to offline function to Komai's second-level domain name (such as abc.dns0755.net, abc.kmip.net) is invalid HAS Another Domain? (Y / n): // If you want to resolve multiple domain names, press "Y" ", Input domain name and its offline URL
The following prompt should appear after configuration:
030827 155904: MESG:
COMEXE DDNS (Public IP) Ver 2.00A Build 102
Copyright 2003 Shenzhen COMEXE Communication Technology Co. Ltd.
All rights reserved.
http://www.comexe.cn
030827 155904: MESG: Service starts.
030827 155904: Info: Connected to: 210.22.12.54: 9994
030827 155904: Info: Connected to: 210.22.12.54: 9993
030827 155904: MESG: Sign in success! Export IP is: xxx.xxx.xxx.xxx
030827 155904: Info: xxx.xxx.xxx.xxx n 20
You can now use the Ctrl C combination key to exit. If you want to modify the configuration in the future, you can run the following command at the Terminal Command Window:
[root @ ahpeng comexe] #. / pipclient -c
3. Internal network mapping so-called intranet (local area network), is only one host (may be a proxy server or router) to connect to the Internet, with a public network address, assuming A1. Other computers are connected to the Internet, assume that A2, only internal network addresses, and external network computers can not access A2 directly.
To allow external users to access Linux servers, there are usually three solutions:
(1) If A1 is Windows host
If A1 is a Windows host, you can consider installing port mapping tools, such as PortTunnel, access access to A1 specific ports to A2 specific ports.
(2) If you use a router
If you use a router, or have the ADSL MODEM with routing, you can set it directly on the router. Here is the AboveCable wireless router as an example:
First enter "192.168.100.100" in the browser address bar, enter the router setting interface, enter the password to enter the management interface. Expand the "Redirect Rule → Virtual Host" on the left side of the page, then fill in the service port in the right page, the server IP address, so the external network is accessed to the router's specific port, will be transferred to the port of the specified server .
(3) Download client program
Log in to http://www.coomexe.cn/helptruehost.php Download a special client program, but this requires a certain fee, and the bandwidth is limited (transferred through a dedicated server), it can realize the internal network user Provide services.
4. When the built-in firewall is constructed, there is a very easy negligent problem, that is, there is no correctly configuring the system's built-in firewall, which may cause the "customer" unable to access our Linux servers, so you must perform the firewall. Configuration. Click the Main Menu → System Settings → Security Level menu item to open the Security Level Configuration dialog, as shown in Figure 1. Select the "custom" option, then select the service you want, such as WWW, FTP, SMTP (SMTP), etc., finally click the "OK" button.
-------------------------------------------------- ------------------------------ LSW Reply to: 2004-02-18 12:03:58 II, Setting up Web Server Apache It is the wide range of Web Server Tool Suite. Here we will detail how to install, launch, and configure the Apache server in the Red Hat Linux 9.0 environment. 1. Install the Apache server When installing the Red Hat Linux 9.0, you will be prompted to install the APACHE server. If you cannot determine if it is already installed, you can enter the following command at the Terminal Command window:
[root @ ahpeng root] rpm -qa | GREP HTTPD
If the result is displayed as "HTTPD-2.0.40-21", the system has already installed the Apache server.
If you do not select the Apache server when installing the Red Hat Linux 9.0, you can click the "Main Menu → System Settings → Add Delete Application" menu item in the graphical environment. Server option, and then click the "Update" button, follow the screen prompt to insert the installation CD to start the installation.
In addition, you can also insert the first installation disc, locate the httpd-2.0.40-21.i386.rpm installation package under / redhat / rpms, and then run the following command at the Terminal Command window:
[root @ ahpeng rpms] rpm -ivh httpd-2.0.40-21.i386.rpm
Install the Apache server, you can run the following command at the Terminal Command window:
[root @ ahpeng root] /etc/rc.d/init.d/httpd start
Restart Apache Service:
[root @ ahpeng root] /etc/rc.d/init.d/httpd restart
Close Apache Service:
[Root @ ahpeng root] /etc/rc.d/init.d/httpd stop
After confirming that the Apache service has been launched, we can enter the following address in the web browser, if you can see the default Apache home page, the Apache server is working properly.
HTPP: // WebserveraddRess
The Webserveraddress here refers to the IP address or domain name of the web server. That is to say that WebserveradDress should be replaced with the IP address or domain of the actual web server.
2. Configure the httpd.conf file in the early Apache server version, its configuration content is dispersed in httpd.conf, srm.conf, access.conf three files. The new version of the Apache server is unified in httpd.conf. For the default installed Red Hat Linux, this profile is located in the / etc / httpd / conf directory, if the TAR.GZ version is installed, the file is located in the / usr / local / apache / conf directory.
With httpd.conf, we can make a global configuration of the Apache server, the parameters definitions of the main or preset servers, and the settings of the virtual host. httpd.conf is a text file, we can modify using text editing tools such as VI, Kate. We are not difficult to find out by analyzing the httpd.conf configuration file:
This configuration file is divided into several section, such as Section 1: Global Environment (First Section: Global Environment); Section 2: 'Main' Server Configuration (Second Section: Primer Server Configuration), etc. Each section has several configuration parameters, which express the "Configure Parameter Name Specific Value", and each configuration parameter has a detailed English interpretation (with # 号).
To help you understand, here is the most common configuration parameters of httpd.conf:
(1) DocumentRoot
This parameter specifies the path to the Apache server to store the web page. The default requires the connection to the HTTP service to provide the main directory in this directory. The following is the default value of Apache:
Documentroot "/ var / www / html"
(2) MaxClients
This parameter limits the highest value of Apache to provide services, namely the number of connected to the same time cannot exceed this value. Once the number of connections reaches this limit, the Apache server is no longer available to other connections, so that the system performance is greatly reduced. This example assumes that the maximum number of connections is 150:
MaxClients 150
(3) Port
This parameter is used to specify the listening port of the Apache server. In general, the standard HTTP service default port number is 80, and this value is generally not changed. This example is 80 ports:
Port 80
(4) ServerName
This parameter allows the user to set the host name by itself to replace the true name of the Apache server host. This name must be a host name that has been registered on the DNS server. If the current host does not have a registered name, you can also specify an IP address. This example sets the server name as Peter. Vicp.net:
Servername peter.vicp.net
(5) MaxkeepaliveRequests
When using the Persistent Connection function, you can use this parameter to determine the upper limit of the number of requirements that can be issued each time. If this value is 0, there is no limit. It is recommended to use a higher value as much as possible to fully utilize the high performance of Apache. In this case, the number of requirements that can be issued each time is 100:
MaxkeepaliveRequests 100
(6) MaxRequestSperChild
This parameter limits the number of requests that can be processed each child process, once this sub-process will be suspended to avoid long-term occupation apache (or the library used by the Apache server). Prevent overload caused by memory or other system resources.
It should be noted that the value of this parameter does not include the number of requests issued by the connection. For example, if a sub-process is responsible for a request, the request will then keep the 10 requests required to connect the connection function. At this time, the Apache server will only deal with only 1 requirement for this sub-process. Non-11 requirements.
The following settings can process up to 10 requirements:
MaxRequestSperChild 10
(7) MaxSpareServers and MinSpareServers
The HTTP daemon of the web service is provided, and the number will change with the number of connections. The Apache server uses dynamic adjustment methods to maintain a sufficient number of HTTP daemon to handle current loads, that is, maintain a certain free HTTP daemon to wait for new connection requests.
Apache will check how many HTTP daemons are waiting for the connection request. If the idle HTTP daemon is more than the value specified by the MaxSpareServers parameter, apache will terminate some idle processes; if the idle http daemon is less than the value specified by the MINSPARSERVERS parameter Then Apache will generate a new HTTP daemon. This example sets the highest idle daemon to 20, set the lowest idle daemon to 5: maxSpareServers 20
MinSpareServers 5
Of course, this is just some of the basic settings of Apache, and everyone can make flexible modification according to their own actual situation to give full play to the potential of Apache. If you fail to take effect immediately after modifying the configuration file, you can restart the Apache service.
Note: Be sure to back up before modifying!
3. Graphical configuration interface graphical configuration is intuitive, simple, enough to cope with daily management maintenance of the Apache server. We can access the Apache Configuration dialog box by clicking the "ApacheConf" command in the "Main Menu → System Settings → Server Settings → HTTP Server" menu item or enter the "ApacheConf" command directly in the Run Commands dialog. You can see that the configuration dialog has 4 tabs.
(1) "Main" tab
In the Server Name box, you can enter the name of the server, equivalent to the "ServerName" field in the httpd.conf file. In the Network Optical Email Address box, you can enter the administrator's email address, equivalent to the "ServerAdmin" field in the httpd.conf file. Click Add (or "Edit" button in the "Available Address" option group, we can add or modify the server's IP address and port.
(2) "Virtual Host" tab
The so-called virtual hosting service refers to a multi-web server that will be virtually virtual. With the "virtual host" service provided by the Apache server, we can use a computer to provide multiple web services.
To set up a virtual host service with Apache usually use two solutions: the virtual host based on the IP address and the name-based virtual host. The implementation method of the virtual host based on the IP address has a serious shortcomings. Each time a virtual host, an IP address must be added. So here you introduce how to create a name-based virtual host.
Assuming an IP address of an Apache server is 210.79.81.212, the host name is www.companyname.net, and it has two aliases: sales.companyname.net, marketing.companyname.net. Although the IP address of these three websites is the same, it is directed to 210.79.81.212, but since the name-based virtual host is set, you can point to different web pages.
When setting, click the Add button on the Virtual Host tab, select the "Name-based virtual host" option in the "Host Information" drop-down list box of the Open Configuration dialog box, then enter the appropriate data IP Address, host name, etc., remember, add a suitable alias, as shown in Figure 2.
The setting content of the other two tabs of the "Apache Configuration" dialog is basically equivalent to the httpd.conf parameter configuration introduced in the previous, and it will not be introduced here.
-------------------------------------------------- ------------------------------ LSW Reply to: 2004-02-18 12:04:28 Third, set up the FTP server FTP File Transfer Protocol, file transfer protocol. It is one of the most popular data transfer methods on the Internet. With the FTP protocol, we can perform two-way data transfer between the FTP server and the FTP client, which can download data from the FTP server to the local client, but upload data from the client to the remote FTP server.
1. Installing the VSFTPD server vsftpd is one of the best FTP server tools in Linux. The VS is the abbreviation of "Very Secure". It can be seen that its maximum advantage is safe, in addition to this, it also has volume Small, customizable, high efficiency. If you choose to completely install Red Hat Linux 9.0, the system will be installed by default to the VSFTPD server. We can verify the following command in the Terminal Command window:
[root @ ahpeng root] rpm -qa | GREP VSFTPD
If the result is displayed as "VSFTPD-1.1.3-8", the system has already installed the VSFTPD server. If you do not select the VSFTPD server when installing Red Hat Linux 9.0, you can click the "Main Menu → System Settings → Add Remove Application" menu item in the graphical environment, make sure "FTP" in the "Package Management" dialog box appears. Server option, and then click the "Update" button, follow the screen prompt to insert the third installation CD to start the installation.
Alternatively, you can also insert the third installation disc, locate the VSFTPD-1.1.3-8.i386.rpm installation package under / redhat / rpms, and then run the following command in the Terminal Command window:
[root @ ahpeng rpms] rpm -ivh vsftpd-1.1.3-8.i386.rpm
2. Start / restart / stop vsftpd service Starting from Red Hat Linux 9.0, vsftpd only starts the VSFTPD service by default, the method is to run the following command at the Terminal Command window:
[root @ ahpeng root] /etc/rc.d/init.d/vsftpd start
Restart the vsftpd service:
[root @ ahpeng root] /etc/rc.d/init.d/ vsftpd restart
Turn off VSFTPD service:
[root @ ahpeng root] /etc/rc.d/init.d/ vsftpd stop
After confirming that the VSFTPD service has been launched, we can enter "ftp ftpaddres" in any Windows host's DOS command window (instead of ftpaddres), pay attention to the username, the password is FTP (FTP is The mapping user account of anonymous user) is as described below:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
F: / peter> ftp ftpaddress
Connected to fTPAddress
220 (vSFTPD 1.1.3) // VSFTPD response request
User (ftpaddress: (none): ftp // Enter user account FTP
331 Please Specify The Password.
Password: // Enter password ftp
230 Login Successful. Have fun.
FTP>
3. VSFTPD is configured in Red Hat Linux 9.0, a total of 3 profiles, which are:
vsftpd.ftpusers: located in the / etc directory. It specifies which user accounts cannot access FTP servers, such as root, etc.
vsftpd.user_list: Located in the / etc directory. The user account in this file cannot access the FTP server by default, and access is only allowed if the userlist_enable = no option is enabled in the vsftpd .conf configuration file.
vsftpd.conf: Located in the / etc / vsftpd directory. It is a text file, we can modify it with a text editing tool such as Kate, VI, from defining user login control, user rights control, timeout setting, server function option, server performance option, server response message, etc. FTP server Configuration. (1) User login control
Anonymous_enable = YES allows an anonymous user to log in.
No_on_password = YES, no password is required when logging in anonymous user.
Local_enable = YES allows local users to log in.
Deny_EMAIL_ENABLE = YES, you can create a file to save some of the blacklists of some anonymous emails to prevent these people from using DOS attacks.
Banned_Email_File = / etc / vsftpd.banned_emails, when you enable Deny_Email_enable, the desired email blacklist save the path (default to /etc/vsftpd.banned_emails).
(2) User rights control
Write_enable = YES, open the global upload permission.
Local_umask = 022, the UMASK of the upload file of the local user is set to 022 (the system default is 077, which is generally changed to 022).
Anon_upload_enable = YES, allowing anonymous users to have uploaded rights, which is obvious, and Write_enable = YES must be enabled to use this. At the same time, we must also establish a directory that allows FTP users to read and write (earlier, FTP is an anonymous user account).
Anon_mkdir_write_enable = yes allows an anonymous user to have the right to create a directory.
Chown_uploads = yes, enabled this, the owner user of an anonymous upload file will change to another user account, note that not specifying the ROOT account is the owner user who is an anonymous upload file!
Chown_username = Whoever, when chamfered, the owner user account specified, where the Whoever is naturally replaced with the appropriate user account.
Chroot_list_enable = YES, you can use a list to qualify which local users can only act in their own directory, if chroot_local_user = YES, then the user specified in this list is unrestricted.
Chroot_list_file = / etc / vsftpd.chroot_list, if chroot_local_user = yes, specify the save path (default /etc/vsftpd.chroot_list).
NOPRIV_USER = ftpsecure, specify a secure user account, allowing the FTP server to use independent users that are completely isolated and without privilege. This is a VSFTPD system recommendation option.
Async_abor_enable = yes, it is highly recommended not to enable this option, otherwise it will cause an error!
ASCII_UPLOAD_ENABLE = YES; ASCII_DOWNLOAD_ENABLE = YES, By default, the server pretends to accept the ASCII mode request but is actually ignored, and the two options to enable the above-mentioned two options can truly implement the transmission of ASCII mode.
Note: Enabling the ASCII_DOWNLOAD_ENABLE option allows malicious remote users to consume the I / O resource of the FTP server with the command of "size / big / file" in the ASCII mode.
These ASCII mode setting options are allocated to upload and download, so we can allow the upload of the ASCII mode (which can prevent malicious files such as uploading scripts, without crashing) without the risk of rejecting service attacks. (3) User connection and timeout option
iDle_session_timeout = 600, you can set the default idle timeout, the user will be kicked by the server more than this time.
DATA_CONNECTION_TIMEOUT = 120, set the default data connection timeout time.
(4) Server logs and welcome information
DirMessage_enable = YES allows display information to display information to display the contents of the Message_File file below each directory.
FTPD_BANNER = Welcome To Blah FTP Service, you can customize the FTP user to log in to the server.
XFerLog_enable = YES, enable record upload / download activity logging.
XFerLog_File = / var / log / vsftpd.log, you can customize the saving path and file name of the log file, default /var/log/vsftpd.log.
-------------------------------------------------- ------------------------------ LSW Reply to: 2004-02-18 12:05:114, Extreme Mail Server The server is a service that is a website, where we can set the postmail from the Red Hat Linux 9.0 to set the postmail.
1. Installing Sendmail If it is fully installed with Red Hat Linux 9.0, the system has been built with Sendmail 8.12.8-4 servers. If you cannot determine if sendmail has been installed, you can enter the following command at the Terminal Command window:
[root @ ahpeng root] rpm -qa | grep sendmail
If the result is displayed as "Sendmail-8.12.8-4", the system has already installed the Sendmail server. If you do not select the Sendmail server when installing Red Hat Linux 9.0, you can click the "Main Menu → System Settings → Add Remove Application" menu item in the graphical environment. Make sure "email in the" Package Management "dialog open Server option, and then click the "Update" button, follow the screen prompt to insert the first installation CD to start the installation.
In addition, you can also insert the first installation disc, position the sendmail-8.12.8-4.i386.rpm installation package under the / redhat / rpms directory, and then start the following command in the Terminal Command window:
[root @ AHPENG RPMS] # rpm -ivh sendmail-8.12.8-4.i386.rpm
Install Sendmail-CF.8.12.8-4.i386.rpm, Sendmail-DOC. 8.12.8-4.i386.rpm in a similar method, located in the / redhat / rpms directory of the third installation disc.
2. Start / restart / stop the Sendmail service After installing the Sendmail server, the simplest startup method is to run on the terminal command window as follows:
[root @ ahpeng root] /etc/rc.d/init.d/sendmail start
The following results should appear, indicating that the mail server has started successfully:
Start sendmail: [OK]
Start SM-Client: [OK]
In addition to the above, we can also control the operation of the mail server using the parametric sendmail command, for example:
[root @ ahpeng root] # sendmail -bd -q1Hsendmail's command parameters The meaning of command parameters is as follows:
-b: Specifies Sendmail to run in the background and listen to the request of port 25.
-d: Specifies that Sendmail is run in Daemon mode (daemon).
-q: When sendmail cannot send mail to the destination, it saves the message in the queue. This parameter specifies the time saved in the queue. The 1h in the example is preserved for 1 hour.
Run the following command in the Terminal Command window to restart the Sendmail service:
[root @ ahpeng root] # / etc / rc.d / init.d / sendmail restart
Turn the following command to turn off the Sendmail service at the Terminal Command Window:
[root @ ahpeng root] # / etc / rc.d / init.d / sendmail stop
We can also run the following command at the Terminal Command Window to detect the operation status of the Sendmail server:
[root @ ahpeng root] # /etc/rc.d/init.d/sendmail status
The system should be displayed:
Sendmail (PID 3251) is running ...
3. Configure the configuration of Sendmail Sendmail is very complicated. Its configuration file is Sendmail.cf, located in the / etc / mail directory. Since Sendmail.cf's syntax is difficult to understand, few people will directly modify the file directly to configure the Sendmail server. We generally generate the desired Sendmail.cf files through the M4 macro. A template file is also required during creation, and the system has a sendmail.mc template file in the / etc / mail directory.
We can generate a Sendmail.cf file according to a simple, intuitive Sendmail.mc template without having to edit the sendmail.cf file directly. The purpose of custom sendmail.cf files can be customized by modifying the Sendmail.mc template. Here you will introduce the steps to create a Sendmail.cf file:
(1) Backup original sendmail.cf file
Run the following command at the Terminal Command Window:
Cp /etc/mial/sendmail.cf /etc/mail/sendmail.cf.bak
(2) Generate sendmail.cf files
Generate a Sendmail.cf profile according to the Sendmail.mc template file and export it to / etc / mail / directory:
M4 /etc/mail/sendmail.mc> /etc/mail/sendmail.cf
(3) Restart the Sendmail service
[root @ ahpeng root] /etc/rc.d/init.d/sendmail restart
Obviously, it is more convenient to create a Sendmail.cf file with the M4 macro compilation tool, and it is not easy to errors, and some of the damage caused by some of the security vulnerabilities or extensions can be avoided. The general content of a Sendmail.mc template is as follows:
DIVERT (-1) DNL
......
INCLUDE ('/ usr / share / sendmail-cf / m4 / cf.m4') DNL
VersionID ('setup for red hat linux ") DNL
Ostype ('Linux') DNL
......
DNL #
DNL Define ('Smart_Host', 'SMTP.YOUR.Provider')
DNL #
Define ('confdef_user_id', '' 8:12 ') DNL
Define ('Conftrusted_User', 'SMMSP') DNL
DNL Define ('confauto_rebuild') DNL ...
Here you introduce the syntax composition of the Sendmail.MC template:
DNL: Used to annotate each, and the DNL command is also used to identify an end of a command.
Divert (-1): Located at the top of the MC template file, the purpose is to make M4 program more streamlined when the M4 program is output.
Ostype ('OperationsystemType'): Defines the operating system type used, obviously here should use Linux instead of OperationsystemType, note that you should have a corresponding operating system type with a reverse number and a positive quotation.
Define: Defines some global settings. For the Linux system, after setting OSTYPE, you can define some of the global parameters below. If you are not defined, you will use the default value. Here is two simple examples: Define ('alias_file', '/ etc / aliases')
Define the save path of an alias file (ALIA file), default is / etc / aliases
Define ('status_file', '/ etc / mail / statistics ")
Sendmail's status information file.
The above is just some simple syntax interpretations of sendmai.mc, more parameter meanings and their configuration information can be found at http://www.sendmail.org/m4/tweaking_config.html.
4. Email the email account for the new user is relatively simple to open an email account for the new user, and simply add a user in the Linux system. Click the Main Menu → System Settings → User and Groups menu item, open the Red Hat User Manager dialog box, click the Add User button, specify the username in the "Created User" dialog box appearing The login password is as shown in Figure 3.
Suppose we add a user peter (password for Peter) so that the user has an email address peter@yourdomain.com (here yourindomain.com replaced by your own domain name).
The above process can also be implemented at the terminal command window to implement:
[root @ ahpeng root] #adduser peter -p peter
5. Set alias for the email account, some users want to use multiple email addresses, is it necessary to create multiple mail accounts? We can use an alias (alias) to solve this problem.
For example, user peter wants to have the following 3 email addresses:
Peter @ YourDomain.com, Dearpeter @ YourDomain.com, Truepeter @ YourDomain.com.
We can implement such alias settings by the following steps:
Add an account Peter; then use the VI, or Kate, etc. Wait-on / etc / aliases, plus two lines:
Dearpeter: Peter
Truepeter: Peter
Save this / etc / aliases exit.
However, this is not allowed to accept the new alias, we must run the newaliase command in the Terminal Command window to request Sendmail to re-read the / etc / aliases file. If everything is correct, you should see the following response message:
[root @ ahpeng root] # newaliases
/ etc / aliases: 63 aliases, longest 10 bytes, 625 bytes Total
In this way, messages sent to Peter can use 3 email addresses, while Peter only needs to use an email account peter@yourdomain.com to receive all emails sent to the above 3 addresses. 6. Specify the mailbox capacity limit When a mail server provides a mail service for many people, unlimited emails will easily stuff the server's hard drive, resulting in a hard disk burden. If you don't want to provide users with unlimited space, you can use the "Mail Limit" to give the user a limited temporary space.
In fact, it is implemented using disk quota functionality. The temporary storage space of the email is in the / var / spool / mail directory, as long as the disk quota settings the maximum space that can be used in this directory.
7. Support POP and IMAP function until now, we can already send mail with Outlook Express, or log in to the server with the mail, the PINE command is charged, and the mail is managed. But you can't download emails from the server with clients such as Outlook Express, because Sendmail does not have POP3 (IMAP) features, so we must install themselves.
(1) POP and IMAP server installation
When installing Red Hat Linux 9.0, you can choose to install the POP and IMAP servers, you can verify the following command at the Terminal Command window:
[root @ ahpeng root] # rpm -qa iMap
IMAP-2001A-18
If not installed, you can put the second installation disc into the CD-ROM, and then run the following command at the Terminal Command window:
[root @ ahpeng root] #CD / MNT / CDROM / RedHat / RPMS
[root @ ahpeng root] # rpm -ivh IMAP-2001A-18.I386.rpm
Since Red Hat Linux 9.0 has been packaged into a separate kit with POP and IMAP, install the IMAP-2001A-18.i386.rpm, it will install both servers at the same time.
(2) Start POP and IMAP services
To successfully start the POP and IMAP server, first determine these services exist in the / etc / service file, make sure the following services do not add # 注释 (if any, you must remove the comment).
IMAP 143 / TCP IMAP2 # Interim Mail Access Proto V2
IMAP 143 / UDP IMAP2
POP2 109 / TCP POP-2 PostOffice # POP VERSION 2
POP2 109 / UDP POP-2
POP3 110 / TCP POP-3 # Pop Version 3
POP3 110 / UDP POP-3
Modify the / etc / service file, then customize the corresponding service configuration file:
Start POP3 Service: You must modify the /etc/xinetd.d/ipop3 file, change the "disable = yes" to "Disable = No" and save the file. Finally, you must restart the xinetd program to read the new configuration file so that the setting content takes effect:
[root @ ahpeng root] # / etc / rc.d / init.d / xinetd reload
Start the IMAP service: You must modify the /etc/xinetd.d/imap file, change the "disable = yes" to "Disable = no", save the file. Finally, you must restart the xinetd program to read the new configuration file so that the setting content takes effect:
[root @ ahpeng root] # / etc / rc.d / init.d / xinetd reload
After setting up, you can set the mail account in Outlook Express. You can use the Sendmail server to send and receive mail, so because the mail server is in the local LAN, so the speed is very fast. -------------------------------------------------- ------------------------------ LSW Reply to: 2004-02-18 12:05:42 Five, Linux Neighbor Samba Windows Accesses the LAN Host through the network neighbor, and can access the Windows host in the LAN through the Samba client under Linux, or provide files, printer services to the Windows host through the Samba server. For the convenience, here the Windows host's computer name is Peter, and the name of the Linux host is redhat.
1. Install the SAMBA component If you choose to install the Red Hat Linux 9.0, the system will be installed by default to the SAMBA component. We can verify the following command in the Terminal Command window:
[root @ ahpeng root] rpm -qa | grep samba
If the result appears the five packages shown below, it means that it is already installed:
Samba-swat-2.2.7a-7.9.0
Samba-2.2.7a-7.9.0
RedHat-config-samba-1.0.4-1
Samba-Common-2.2.7A-7.9.0
Samba-Client-2.2.7A-7.9.0
If you do not have a Samba package, you can insert the first installation disc, then click the "Main Menu → System Settings → Add / Remove Application" menu item, open the Package Management dialog box, in this conversation Find the "Windows File Server" option in the box, make sure this option is selected, and then click the "Update" button to start installing.
You can also insert the first installation CD into the CD-ROM, then enter the following command at the Terminal Command window:
[root @ ahpeng root] # cd / mnt / cdrom / redhat / rpms
[root @ ahpeng rpms] # rpm -ivh samba *
[root @ ahpeng rpms] # rpm -ivh redhat-config-samba-1.0.4-1.noarch.rpm
2.Linux Host Access the Windows Host After installing Samba, there is a basis for accessing to Windows. Here first describes how to use the character command to access the shared resources of the Windows host.
(1) Query the shared resources of the host
You can use the "SMBCLIENT -L WindowsHostName command (here WindowsHostName replaced by Windows hostname). This example is to query the shared resource on the Windows Host Peter, you can enter the "SMBCLIENT -L Peter" command at the terminal window, and then use the Windows host's shared resource.
(2) Connect the shared directory of host
You can use the "SMBCLIENT // WindowsHostName / ShareName" command to connect to a shared folder on the Windows host. If the shared folder requires a username and password, you can use the "SMBCLIENT // WindowsHostName / ShareName -u UserName" command. For example, to connect to the shared directory Share on the Windows host Peter, we can enter the "smbclient // peter / share" command on the terminal window and then enter the car.
If the connection is successful, the "SMB: />" prompt can appear, enter the appropriate command at the command prompt, you can operate the connected shared directory.
About 40 commands supported by the SMB can be easily deleted, renamed, switches the directory, etc. of the shared directory. If you want to list the specific contents under Share "Share", you can use the ls command. To delete the Test.txt file, you can use the "Del Test.txt" command. (3) Mapping network drive
We know that Windows can map the shared directory into a network driver so that the shared directory can be used as a local folder. Under Linux, you can use the SMBMount command. The specific command parameters are "smbmount // windowshostname / sharename / mnt / smbdir" (here's ShareName refers to the name of the Windows shared resource name, SMBDIR refers to the name of the mount point). Suppose you want to map the shared folder Share of the Windows Host Peter to / MNT / Winshare directory, the specific steps are:
First create a directory in / mnt directory, assume that it is / mnt / winshare;
Then open the terminal command window and run "smbmount // peter / share / mnt / winshare";
Now open the / mnt / winshare directory in the file manager to see the content of the shared directory! To uninstall the map directory, you can use the umount command.
(4) Access Windows host with Nautilus
With the file manager Nautilus under the GNOME desktop, we can use the graphical interface to access the Windows host. Here you should pay attention to the Nautilus just provide a graphical interface to the Windows host, and the specific underlying operation is done by means of the Samba client.
In the GNOME desktop environment, click the Main Menu → Network Server menu item to view a list of workgroups with the Nautilus File Manager. Double-click the Workgroup name to see the Windows host under this.
Double-click on a Windows host icon, you can see the shared folder of the host, you can see that this is almost the same as the network neighbors under WINDOWS.
Since Nautilus itself is the file manager of Red Hat Linux, we can call files, delete files, create directory, etc. in Windows shared directory (for Windows 2000 / XP hosts).
3.Windows Host Access Linux Host To allow the Windows host to access the Linux virtual machine, you must start Samba services on the Linux virtual machine. Before starting, you also need to configure the properties of the Samba service, such as specifying the shared directory of the Linux virtual machine, the workgroup name, etc.
(1) Configure Samba Server
In previous versions of Red Hat Linux, we must directly modify Samba configuration files SMB.conf, or use SWAT to make a full range of SAMBAs. Red Hat Linux 9.0 introduces a graphical Samba server configuration tool that allows us to easily configure the Samba server. Log in as a root user, click the Main Menu → System Settings → Server Settings → Samba Server menu item, you can open the Samba Server Configuration dialog. You can also enter "RedHat-Config-Samba" on the Terminal Command window to access the Samba Server Configuration dialog.
First configure the basic settings and security options of the Samba server, click the "Preferences → Server Settings" menu item on the Configuration dialog to open the server setting dialog.
Basic Settings: In the "Basic" tab of the dialog, we can specify the workgroup name where the Linux host is located, you need to note that the working group name here is not necessarily the same as the WINDOWS host.
Safety settings: Then make Samba Server Security Settings, there are 4 options here. "Verify Mode" Representative If the Windows host is not in the NT domain, you should select "Share" verification mode, so that only the user name, password is required when the specified share is connected to the Samba server; "Verify Server" Representative " Share "Verification mode, there is no need to enable this setting;" Encrypted Password "option should be" Yes ", which prevents hackers from intercepting crypto clear text;" guest account "representative When Vocal users want to log in to Samba servers, they A valid user must be mapped to the server. Select one of the existing usernames on the system as a guest Samba account. When the user logs into the Samba server using the guest account, they have the same privileges as this user.
Add shared directory: Click the "Add" button on the Samba Configuration dialog toolbar. On the "Basic" tab in the open dialog, the specified (shared) directory is a directory that exists, for example, can specify / TMP, and then specify the basic permissions of the directory to read or read / write. On the Access tab, you can specify that all users are allowed to access, or only certain users are allowed.
(2) Start Samba Server
Open the terminal command window, enter the "/ sbin / service smb start" command, you can appear the following prompt information, indicating that the Samba service has started.
# / sbin / service SMB Start
Start SMB Services [OK]
Start NMB service [OK]
Next, open "Network Neighbors" in Windows, you can see the Samba server we just set up!