Linux server configuration

zhaozj2021-02-16  62

(Transferred from LinuxSir)

One: Setting 1 of the DNS server 1. Edit /etc/named.conf// generated by named-bootconf.plOptions {directory "/ var / name"; / ** if there is a firewall bad * to talk to us, you might, to uncomment . query-source * directive below Previous versions of BIND always asked * questions using port 53, but BIND 8.1 uses an unprivileged * port by default * /// query-source address * port 53;.}; // // a caching ONLY NAMESERVER CONFIG / / CONTROLS {inet 127.0.0.1 allow {localhost;} keys {rndckey;};}; zone "." in {type hint; file "named.ca";}; zone "mydomain.com" in { TYPE MASTER; File "named.mydomain.com"; allow-update {none;};}; zone "1.168.192.in-addr.arpa" in {type master; file "named.mydomain.com.rev"; Allow-update {none;};}; zone "localhost" in {type master; file "localhost.zone"; allow-update {none;};}; zone "0.0.127.in-addr.Arpa" in { TYPE MASTER; file "named.local"; allow-update {none;};}; incrude "/etc/rndc.key";2. Edit Positive Resolution File / VAR/NAMED/Named.Mydomain.com! @ In soa my.mydomain.com. Root.my.mydomain.co m. (1997022700; Serial28800; Refresh14400; Retry3600000; Expire86400); minimumin ns my.mydomain.com.in MX 10 my.mydomain.com.my IN A 192.168.1.50www in cname my.mydomain.com.ftp in cname my.Mydomain.com.ftp .mydomain.com.smtp in cname my.mydomain.com.pop3 in cname my.mydomain.com.3. Edit reverse resolution file /var/named/named.mydomain.com.revate .ttl 86400 @ in SOA MY. Root.ns.Mydomain.com. (1997022700; Serial28800; Refresh14400; Retry3600000; Expire86400); minimum ns my.mydomain.com.50 in Ptr my.mydomain.com.4. Edit / Var / named / named .local file $ TTL 86400 @ in soa my.mydomain.com. root.my.mydomain.com. (1997022700; serial28800;

Refresh14400; Retry3600000; Expire86400); MinimumIN NS my.mydomain.com.1 IN PTR localhost.5 edit /etc/resolv.conf# MADE-BY-RP-PPPOEdomain mydomain.comnameserver 192.168.1.50search localdomain two:. WEB server Settings only to partial modifications to /etc/httpd/conf/httpd.conf, you can servers OSserverroot "/ etc / httpd" Note: Specify the Trigger Run / httpd.pidtimeout 300 Note: Define client programs and servers Overcompal of the connection Keepalive Off Note: Define whether to support a connection, multiple transfer functions MaxkeepAliveRequests 100 Note: Maximum number of requests for HTTP requests can be performed in KEEPALIVETIMEOUT 15 Note: Time MaxRequestSperChild 0 Note: Each sub-process processing service request number 0 is unlimited Listen 80User Apache Note: Specify User and Group Group ApacheServerAdmin Nangshou@mydomain.com Note: Server administrator's E_MAIL address #servername 192.168.1.50:80 Note: Server domain name, Usually no DNS needs UsecanonicalName OffDocumentroot "/ var / www / html" Note: Specify web file storage location Userdir user_www Note: For the personal home page, generally / home / user / web file directory

DirectoryIndex Index.html Index.htm Index.php Note: Specify the home page name

AccessFileName .htaccess

Alias ​​/ Manual "/ var / www / manual"

Options Indexes Followsymlinks MultiViews

ALLOWOVERRIDE NONE

ORDER ALOW, DENY

ALLOW FROM ALL

Note: The above is to set access control for files for the directory.

Scriptalias / cgi-bin / "/ var / www / cgi-bin /"

Scriptsock Run / httpd.cgid

ALLOWOVERRIDE NONE

Options none

ORDER ALOW, DENY

ALLOW FROM ALL

AdddefaultCharset GB2312 Note: Character encoding supported by the website

Note: The following is where setting virtual host services need to be configured

#NameVirtualHost 202.101.2.1 Note: Name-based virtual host must, if you do not need based on IP addresses

#

#VirtualHost Example:

# Almost Any Apache Directive May Go Into a VirtualHost Container.

# THE FIRST VIRTUALHOST Section IS Used for Requests WITHOUT A KNOWN

# Server name.

# Note: If you are a virtual host based on an IP address, you only need the following settings.

#

# ServerAdmin Webmaster@dummy-host.example.com

# DocumentRoot / www/docs/dummy-host.example.com

# Servername Dummy-Host.example.com

# Irelog logs / dummy-host.example.com-error_log

# Customlog logs / dummy-host.example.com-access_log Common

#

Note: Based on the name, an IP address corresponds to multiple domain names.

Based on IP address, every domain name has corresponding IP

Three: installation settings for DHCP servers

1. Find DHCP - *. RPM in the installation CD.

2. RPM-IVH DHCP - *. Rpm

3. Setup / system serviceu set DHCP to system self-start

4. Configuration /etc/dhcpd.conf file

Subnet 192.168.1.0 Netmask 255.255.255.0 {

Range Dynamic-bootp 192.168.1.60 192.168.1.160; Note: IP address allocation range

Option Routers 192.168.1.254; Note: Default Gateway

Option Subnet-Mask 255.255.255.0; Note: Default subnet mask

Option Domain-name "mydomain.com"; Note: Default domain name

Option Domain-Name-Servers 192.168.1.50, 202.96.134.133;

4: SetMail server settings

4.1 Set sendmail.cf

Please add the host name that you can use when you can use it when Cwlocalhost. For example, I have a machine called: ftp.mydoamin.com, and also called: email.mydomain.com, and I hope that the two names of this machine can accept, then I want to do this:

CWLocalHost ftp.mydomain.com email.mydomain.com

By the way, CW can only write into the name of this machine, do not write to other machine names, otherwise, wherever it can be sent, it must not be sent.

The above is actually a short story. If you are familiar with DNS, you can refer to this section to determine whether it is necessary to write to Dongdong after CW. Otherwise, please skip this section and write all the names used in this machine.

1. On a machine, if there are multiple names (Hostname), it is created with CNAME, such as:

$ Origin my.mydomain.com

FTP IN A 192.168.1.50

Email in cname my.mydomain.com

Then you have to indicate it on CW. The system will find its Canonical Name through DNS.

2. If a machine has multiple names, but each name is built with A Record. Such as:

$ Origin my.mydomain.com

FTP IN A 192.168.1.50

Emial in A 192.168.1.50

This situation [must] Remember to write the name you want to accept after CW. What kind of problem will there be if this forgot? Forgot that there will be from the outside machine, but the machine name that has not been written will not receive the letter, will prompt:

"Local Configuration Error".

Such as: My CW in my sendmail.cf is as follows: cw my.mydomain.com Then I will not be able to use this address: username@mydomain.com and only use username@ftp.mydomain.com, otherwise it will appear The above errors.

If you find a mistake, then you can add it.

3. If a machine has multiple interface, each interface has its own name, and it is necessary to pay. This situation also states all HostName you want to accept after CW.

FW / etc / sendmail.cw This line means where Sendmail is going to find Sendmail.cw this file, this file is important. There is also a line you may also need to change:

R $ @ # Error $ @ 5.7.1 $: "550 relaying Denied" changed

R $ - $ @ ok

Note: The middle separation is to use the "Tab" key.

4.2 Set sendmail.cw

Modify the Sendmail.cw file, set this mail server to send the name of the host, you can use your domain name, or host name.

# Sendmail.cw - Include All aliases for your machine here.

Mydomain.com

Mail.mydomain.com

my.mydomain.com

OK! A standard sendmail.cf file is set!

4.3 Setup Access

Open / etc / mail / access, you will see (note that some system Access files are no longer / etc / mail, if you can't find where you, please use where you want to find it)

# Check the /usr/doc/sendmail-8.9.3/readmail-8.9.3/readme.cf file for a description

# Of the format of this file. (Search for access_db in That file)

# T /usr/doc/sendmail-8.9.3/readme.cf is part of the sendmail-doc

# Package.

#

# By default we allow relaying from localhost ...

Localhost.localdomain relay

Localhost relays

If your IP address is 192.168.1.50, please add 192.168.1.50 relay in the last line.

The last three lines of its documents should be:

Localhost.localdomain relay

Localhost relays

192.168.1.50 relays

Plus this sentence you can send mail with Sendmail! But if you want others to use Sendmail, his IP is 202.168.25.22, which is in the last line to join 202.168.25.22 reference

The last four lines of its documents should be:

Localhost.localdomain relay

Localhost relays

192.168.1.50 relays

202.168.25.22 relay

I think, you must have a question now, if I want to set 50 people with sendmail, if I need to add 50 IP! ? Oh, don't use it, this, Sendmail takes care of multiple users, it allows you to add the entire C class address. The format is as follows:

Localhost.localdomain relay

Localhost relays

192.168.1 relay

In this way, you will use the user of this Class C address in Sendmail, if you have an account in your system, if you have an account in your system! Then run: # Makemap Hash Access.db

4.4 Setting up POP3

If you need POP3 to receive the letter, you need to open the POP3 port,

Vi /etc/inetd.conf Find

# POP-3 Stream TCP NOWAIT ROOT / USR / SBIN / TCPD IPOP3D deletes ##. Vi / etc / services look # pop-3 110 / tcp # Pop version 3 to delete ##. In this way, after Restart inetd, the POP3 110 port can be read! If still can't, check if you install the POP3 port! 4.5 SENDMAIL alias and forward

(1) About the IP address directly

Mail User @ [192.168.ip.address]

Just use [] to enclose the IP address.

(2) About Alias

Sendmail has two files aliases and aliases.db under / etc, the latter is the alias database generated by NewaliaSs. You can manually edit / etc / aliases, then run the newaliases update database (in fact newaliase is a Symlink to sendmail)

EG: Nangshou: user@mydomain.com

Alias-name: Real-user-account

The Mail Nangsh will be sent to user@mydomain.com, and others will send to Alias-name@your.domain.name will turn to real users Real-user-account

(3) About Forward

Edit a .forward file below your $ home directory, write on the destination E-mail address of Forward or the username of the unit, you can automatically send the letter forward to the appropriate address.

Eg: .forward: user@mydomain.com

Or other-user-account

Then give this person's E-mail forward to MyDoamin or Other-User-Account

(4) About Vacation

Go to find a Vacation package (such as the RPM of the redhat's Contrib), which is installed on a / usr / bin / vacation program and a man. First run the Vacation, it will edit your edit $ home / .vacation.msg file It is to send back to the other party telling him something that you don't watch now. Then edit the $ homen / .forward file, write such a sentence / username, "| / usr / bin / vacation username", Username To change your own Then then runs Vacation -i Buy $ Home / .vacation.db is fine.

(5) Some files about Sendmail

/ VAR / log / maillog sendmail log, analysis error is useful

/ var / spool / mail / $ user coming in, one file per user

/ var / spool / mqueue mail Queue, you can use the letter to be sent in Mailq

(Mailq is also SEMLINK for Sendmail)

DFXXXXXX this is the content of the letter

Qfxxxxx This is the letter from Subject and other information (anyway, one is a number, paired)

/etc/sendmail.cf sendmail configuration file, you should be careful

/etc/sendmail.cw If your machine has a lot of alias, write the name

In this file, which one can write this letter.

4.6 Limit the size of the mail

vi /etc/sendmail.cf:

Mlocal, P = / Bin / Mail, F = LSDFMRMN, S = 10, R = 20/40,

MaxSize = 1000000,

A = mail -d $ u

MProg, P = / usr / local / sendmail / smrsh, f = lsdfmeu, s = 10, r = 20/40, D = $ z: /,

MaxSize = 1000000,

转载请注明原文地址:https://www.9cbs.com/read-18346.html

New Post(0)