1. Build a Samba server for sharing
Samba introduction:
Server messages Block (SMB) is a communication protocol used to share files and printers on a LAN, it provides sharing services for files, printers, and other resources between different computers in the LAN. The SMB protocol is a client/server protocol that allows a client to access shared file systems, printers, and other resources on the server. By setting "NetBIOS over TCP/IP", Samba can not only share resources with local network hosts, but also share resources with computers around the world.
I. Prepare the environment (RHEL 5.9)
Svr1, eth0 (vmnet1 only hosts ):
Static IP address 192.168.4.5/24
Do not set the default gateway or DNS address
Pc205, eth0 (vmnet1 only hosts)
Static IP address 192.168.4.205/24
Do not set the default gateway or DNS address
Prerequisites: configure the yum Library
DHCP introduction:
The original name of DHCP (Dynamic Host Configuration Protocol, Dynamic Host Configuration Protocol) is a LAN network protocol that uses UDP protocol for two purposes: an IP address is automatically assigned to an internal network or network service provider. The IP address is described in RFC 2131 as a central management method for all computers. DHCP has three ports, of which udp67 and udp68 are normal Dhcp Service ports, respectively used as DHCP server and DHCP Client Service ports; port 546 is used for dhcpv6 client, not for dhcpv4, it is a DHCP failover service, which requires special activation. DHCP failover is used for "Hot Standby.
2. Build a simple DHCP server
Lab environment: Prepare two redhat5.9 virtual machines
Virtual Machine 1:
DHCP server's first Nic IP Address: 192.168.1.254/24 Host Name: dhcpsvr network adapter: only host
Set the IP address to the static mode.
IP address of the second NIC: 192.168.4.254/24 network adapter: vmnet7
Virtual Machine 2:
Client: automatically obtain IP host name: pc205 network adapter: vmnet7
Objective: to automatically assign IP addresses from 192.168.4.10 to 192.168.4.50 to Virtual Machine 2 through the DHCP server
192.168.4.100 to 192.168.4.120
Bind an IP address based on the MAC address (192.168.4.19)
Set gateway 192.168.4.1
Set the default search domain "tarena.com"
Set the DNS server address: "202.106.0.20, 8.8.8.8"
Prerequisites: configure the yum Source
Iii. email server
Email servers are essential for large companies, because the company needs to rely on emails to transmit information internally. Mail generally uses POP3 and SMTP services, and there are many programs to build services, the well-known Microsoft and IMB all have their own mail service software. Here we create a mail server in Linux, the open-source Postfix and Dovecot are used as the mail and email receiving services respectively.
The mail server needs domain name resolution, so we need the DNS service. Then we can configure two services to send and receive emails through the mail Management Program (MUT). If necessary, we can install the Webmail system, implement mail access to web pages. The following uses squirrelmail as an example,
Tutorial topology:
DNS server host
Mail Server Host B
Win7 client host W
Configure host a (configure DNS)
The preceding file specifically describes DNS. Only the domain name to be added is written here to specify the domain name resolution of the mail server.
Mail Server Configuration (configure SMTP server)
1. prerequisites (test DNS)
2. Set the mail server host name
3. Install Postfix
The Postfix port is 25, which may be occupied by Sendmail. In this case, we need to disable the sendmail service first. You can check it first,
Skip if no
4. Modify the master configuration file
The main configuration file of Postfix contains a lot of content. We can use the postconf-N command to export non-default settings, and use this file to replace the original configuration file, in this way, the configuration file is changed from over 600 lines to over 30 lines, so that we can view the changes. Retain the original file as a backup
Mail Server Configuration (configure POP server)
1. Install Dovecot
Dovecot can be used by default. After the installation is complete, start the service.
SMTP authentication control
1. Install and start the saslauthd service
2. Adjust the Postfix configuration to enable authentication.
Build a Webmail System
You only need to start the HTTPd service.
Virtualization Conditions
Install KVM Virtualization in Linux
First, the CPU must support Virtualization (Intel is vmx and AMD is SVM)
[[Email protected] ~] # Egrep '(vmx | SVM)' -- color/proc/cpuinfo
Make sure that you enable VT in bios. If you cannot install it, you will be prompted to enable it. Go to biso to enable it.
Intel (r) virtualization technology [enabled]
To install the virtualization suite, because there are many installation packages, you should first configure the yum library and then use Yum to install the four virtual groups. After installation, you may not be able to open the four groups, check whether any error exists.
[[Email protected] ~] # Lang = en_US-utf8
[[Email protected] ~] # Yum-y groupinstall "virtualization" "virtualization client" "virtualization platform" "virtualization Tools"
After installation, start the service and set the service to run automatically upon startup.
[[Email protected] ~] #/Etc/init. d/lib1_d start
[[Email protected] ~] # Chkconfig libmongod on
Use virt-manager to enable the virtual Manager (in the graphic desktop)
[[Email protected] ~] # Virt-Manager
V. Build basic environment for DNS servers
DNS is a service that converts computer names to IP addresses in the network. In Linux, you can easily build a DNS server. We need to install the DNS Service (installation package name: BIND) to ensure security, we usually use the bind-chroot installed together as the persistent directory and root directory of DNS. You can also install the template package (caching-nameserver) of the DNS configuration file for ease of installation ). after the installation, We need to configure the DNS. We need to listen to the IP address, port, and resolved domain name. After the configuration, we can restart the service. Then we can find another one, you can also specify the DNS address for testing on the local machine.
Summary of setting up the initial server environment