Some basic applications of Linux servers

Source: Internet
Author: User
Tags domain name server nslookup
Article Title: some basic applications of Linux servers. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
I have been playing linux for some time. As a beginner, I have encountered a lot of troubles. Fortunately, this is a network age. With the help of many good-hearted big brother, I have reached a very close point, during which the ups and downs are really memorable. To pay tribute to thousands of great linux programmers in the world, they have made such an excellent operating system available. This article is mainly intended for friends who are new to linux and eager to configure a server. Due to the limited level of the monks, errors are inevitable. You are welcome to testify.
Taking the company's network architecture as an example, let's talk about the configuration of linux servers. Before official configuration, let's talk about the functions that the server will implement:
  
1. Data Sharing
2. Print Sharing
3. Simulate the NT domain
4. ADSL sharing
5. Internal DNS Service
6. DHCP Service
7. FTP service
8. WWW Service
9. OPENSSH
10. Disk Quota
11. Dynamic Domain Name
  
The network architecture is as follows: [Example]
  
Www.linuxsir.org/photo/Xchen.gif
  
Network: 10.10.0.0
Server IP: 10.10.1.1
Server Subnet-mask: 255.255.0.0
Client IP: 10.10.1.10-10.10.1.100
Client Subnet-mask: 255.255.0.0
Client getway: 10.10.1.1
Client DNS: 10.10.1.2, 202.96.134.20.
  
I. preparations:
  
1. RedHat linux 7.2 CD
2. Ethernet ADSL dial-up device and your ADSL access account
3. Two NICs, preferably out-of-the-box, should be checked for irq and io without jumper.
4. Of course, other machines except the Local Machine
  
Ii. RedHat linux 7.2 installation:
  
1. We recommend that you use a graphical interface for beginners. Please use custom installation.
  
2. The system partition is as follows (10 Gb ):
Swap: 500 M
/: 2G
/Var: 1G
/Home: 2G
/Tools: 500 M
/Data: 4 GB
For more information about partition rationalization, see related articles.
  
3. if the plug-and-play Nic is detected, set the IP address and subnet mask to 10.10.1.1 and 10.10.1.2, and set subnet-mask to 255.255.0.0, so wait for the system to be installed and set up again.
  
4. It doesn't matter if you select a software package. If you have space, you can customize the software package if you have a limited space. The following is my choice for your reference:
Printing Support
Network Support
Dialup Support
SMB: windows file server
WWW: web server
DNS: DNS name server
Software Development
  
5. Okay. Now let's install it all the way next. Don't forget to create a boot disk.
  
Iii. linux Network Environment Configuration
  
1] After restarting the machine and entering the system, remove unnecessary services and keep them slow and insecure, below are some of the services that I have just installed on my machine:
Gpm/iptables/netfs/network/nfs/nfslock/portmap/syslog/xfs/xinetd
To other services, wait for us to configure and load it.
  
2] install linuxconf and configure the network.
Attach to CD 1
Mount/dev/cdrom/mnt/cdrom
Cd/mnt/cdrom/RedHat/RPMS
Rpm? Ivh linuxconf-1.25r7-3.i386.rpm
Please use setup/system services or chkconfig? Levlel 3 linuxconf on sets linuxconf as a system self-starting service.
Netconf select Host name and IP network devices for Host name and network settings:
Host name + domain: cxserver
------ First Nic ----------
Config mode: Manual
Primary name + domain: abc
Ip address: 10.10.1.2
Netmask: 255.255.0.0
Net device: eth0
Kernel Module: ne
I/O port: 0x300
Irq: 3
------ Second Nic ----------
Config mode: Manual
Primary name + domain: cxserver
Ip address: 10.10.1.1
Netmask: 255.255.0.0
Net device: eth0
Kernel Module: ne
I/O port: 0x320
Irq: 5
Select Accept to exit. After the network interfaces eth0 and eth1 are started successfully, run the ifconfig command to check the status. Run the ping command to test the connectivity. For example, ping a windows machine.
  
Iv. DNS Server Configuration
  
To make it easier for LAN users to access the server, it is necessary to configure a DNS server. After all, a name is always easier to remember than a string of numbers. Next I will configure the server 10.10.1.1 with a domain name www.cx.com, ftp.cx.com, OK. Start action:
File to be configured:
/Etc/named. conf
/Etc/resolv. conf
/Var/named. hosts
/Var/named. local
/Var/named/named.10.10
  
1] configure the/etc/named. conf file. This file is a dns boot file, and the named process needs to read it at startup.
Vi/etc/named. conf
// Generated by named-bootconf.pl
Options {
Directory "/var/named ";
// Query-source address * port 53;
};
  
Zone "." IN {
Type hint;
File "named. ca ";
};
// ---------------------- Manually Add the following two sections ------------------------------
Zone "cx.com" IN {
Type master;
File "named. hosts ";
};
  
Zone "10.10.in-addr. arpa" IN {
Type master;
File "named.10.10 ";
};
//------------------------------------------------------------------------------
Zone "0.0.127.in-addr. arpa" IN {
Type master;
File "named. local ";
};
  
// Include "/etc/rndc. key ";
  
The following three files are DNS database files. The specific parameters are not described in detail. Please refer to the relevant materials.
  
2] vi/var/named. local
  
$ TTL 86400
@ In soa ns.cx.com. root.ns.cx.com .(
1997022700; Serial
28800; Refresh
14400; Retry
3600000; Expire
86400); Minimum
In ns ns.cx.com.
  
1 in ptr localhost.
  
3] vi/var/named. hosts
@ In soa ns.cx.com. root.ns.cx.com .(
2002042302; serial
28800; refresh
14400; retry
3600000; expire
86400; minimu
)
In ns ns.cx.com.
Cx in a 10.10.1.1
Cx1 in a 10.10.1.223
Www in cname ns.cx.com.
Ftp in cname cx
  
4] vi/var/named/named.10.10
@ In soa ns.cx.com. root.ns.cx.com .(
2002042302; serial
28800; refresh
14400; retry
3600000; expire
86400; minimu
)
In ns ns.cx.com.
1 in ptr ns.cx.com.
2 in ptr ns1.cx.com.
  
5] editing the/etc/resolv. conf file
Vi/etc/resolv. conf
Domain cx.com
Nameserver 10.10.1.1
  
Okay. Let's start the service:
/Etc/rc. d/init. d/named start
Chkconfig? Level 3 named on # Set the dns service as a system service and start it on startup
Test: ping cx.cx.com
Ping www.cx.com
Ping ftp.cx.com
Or use nslookup. For usage instructions, see nslookup? Help.
  
V. DHCP server configuration
  
1] install dhcp.
Put in disc 1 or disc 2
Mount/dev/cdrom/mnt/cdrom
Cd/mnt/cdrom/RedHat/RPMS
Rpm? Ivh dhcp-2.0p15-8.i386.rpm
Please use setup/system services or chkconfig? Levlel 3 linuxconf on sets linuxconf as a system self-starting service.
  
2] configure the dhcpd. conf file.
Vi/etc/dhcpd. conf
Subnet 10.10.0.0 netmask 255.255.0.0 {
Range dynamic-bootp 10.10.2.0 10.10.2.100; # IP Address allocation range
Option routers 10.10.1.1; # Default Gateway
Option subnet-mask subnet 255.0.0; # default subnet mask
Option domain-name "cx.com"; # default domain name
Option domain-name-servers 10.10.1.1, 202.96.134.133;
}
# Last line: DNS server settings. The reason why 10.10.1.1 is put in front is to allow the client to prioritize the internal dns server for domain name resolution. If the domain name cannot be resolved, the next dns server is used for resolution. 202.96.134.133 is the primary DNS server of the ADSL Internet users in Shenzhen. use the next dns server for resolution. 202.96.134.133 is the primary DNS server of the ADSL Internet users in Shenzhen.
  
3] start the service:/etc/rc. d/init. d/dhcpd start
  
4] use: the IP address is automatically obtained regardless of Win9x or 2 K, and nothing else needs to be set.
  
Vi. ADSL and firewall configuration
  
1] Download Software: http://www.roaringpenguin.com/pppoe/rp-pppoe-3.5.tar.gz
  
2] install software:
Tar zxvf rp-pppoe-3.5.tar.gz
Cd rp-pppoe-3.5
./Go # Start Software Installation
  
3] after the software is installed, the configuration program adsl-setup will be run.
  
USER NAME
>>> Enter your PPPoE user name (XXX): ________ # Enter the ADSL user account here
  
INTERFACE
(Default eth0): _____ # Ethernet interface, eth0 or eth1
  
>>> Enter the demand value (default no): # You can leave it empty.
  
DNS
>>> Enter the DNS information here: 202.96.134.133 # the Primary Domain Name Server provided by local telecom
>>> Enter the secondary DNS server address here: # secondary Domain Name server provided by local telecom
  
PASSWORD
>>> Please enter your PPPoE password:
>>> Please re-enter your PPPoE password: # password
  
FIREWALLING
0-NONE: This script will not set any firewall rules. Y
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.