"SMTP Record & Apache service"

Source: Internet
Author: User
Tags domain server

"supplement, continuation"

1. "configure empty shell messages to accept" "mta"
"front: In/etc/named.rfc1912.zones to add a mail-acceptable domain hxl.org (corresponding to the write in your database), the domain is located in the IP is your machine, because to be forwarded from your machine"
"configure VIM/ETC/POSTFIX/MAIN.CF for this machine"
Myhostname =maillinux.linux.com
MyDomain = linux.com
98 Myorigin = hxl.org [source Name of the document being sent]
113 Inet_interfaces = All
Local_transport = error:localdelivery disabled [itself as an empty shell, will not accept the other machine turned over the mail.]
164 Mydestination = [do not accept native mail]
313 Relayhost = 172.25.254.161 [ip forwarding mail to]
[restart service]
"configuring file vim/etc/postfix/main.cf for 161 hosts"
Mynetworks = 172.25.254.0/24 [accept mail from users of this network segment]
[restart service]

650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M00/8B/44/wKiom1hIMfGx40NXAAEZ42WP_N8538.png "style=" float: none; "title=" 15.png "alt=" wkiom1himfgx40nxaaez42wp_n8538.png "/>

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M00/8B/40/wKioL1hIMfHQVni0AAEBrLu9DGw877.png "style=" float: none; "title=" 16.png "alt=" wkiol1himfhqvni0aaebrlu9dgw877.png "/>

650) this.width=650; "src=" http://s2.51cto.com/wyfs02/M01/8B/44/wKiom1hIMfHSVvyqAABqBma8FcI655.png "style=" float: none; "title=" 17.png "alt=" wkiom1himfhsvvyqaabqbma8fci655.png "/>

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M02/8B/40/wKioL1hIMfLxu6gXAAEsLDQ5tHI412.png "style=" float: none; "title=" 18.png "alt=" wkiol1himflxu6gxaaesldq5thi412.png "/>

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M01/8B/40/wKioL1hIMfLBJQxKAABolOrFV30512.png "style=" float: none; "title=" 19.png "alt=" wkiol1himflbjqxkaabolorfv30512.png "/>

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M00/8B/44/wKiom1hIMfLDYsEIAAB2-BzLBeE685.png "style=" float: none; "title=" 20.png "alt=" wkiom1himfldyseiaab2-bzlbee685.png "/>

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M02/8B/44/wKiom1hIMfOBaj_yAAERjMr-qoU160.png "style=" float: none; "title=" 21.png "alt=" wkiom1himfobaj_yaaerjmr-qou160.png "/>


Test
Send a message with 160 to some users in the database (mail [email protected]), Although MX is set to 160, but messages received after sending can be seen in The/home/vmail/of 161. This is for 160 forwards 161 success.



***************************************
Apache Service ******************
***************************************
1. "modify the HTTP publishing directory"
"front:"
By default, The HTTP read file is in/var/www/html/, and the index.html file is read first, which can be modified in the main configuration File. Create THE/WWW/HXL directory as your new change directory.

"master Configuration file:/etc/httpd/conf/httpd.conf"
Vim/etc/httpd/conf/httpd.conf "modified as follows"
DocumentRoot "/www/hxl" [this is the added directory, comment out the original access directory on the previous line]
121 <directory "/www/hxl" > [directory Certification license]
122 Requireall Granted
123 </Directory>

[heavy duty service Systemctl Relode httpd.service]
[test]: Create a new file in your new directory (index.html), so you open the browser by default to see the contents of this File.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/8B/40/wKioL1hIMiqRqCTdAACxRjkRTUY165.png "style=" float: none; "title=" 24.png "alt=" wkiol1himiqrqctdaacxrjkrtuy165.png "/>

650) this.width=650; "src=" http://s2.51cto.com/wyfs02/M02/8B/40/wKioL1hIMirhJaETAABUnri6ZuA706.png "style=" float: none; "title=" 25.png "alt=" wkiol1himirhjaetaabunri6zua706.png "/>


2. "set IP Access rights"
[add in the above operation]
DocumentRoot "/www/hxl"
121 <directory "/www/hxl" >
122 Requireall Granted
123 Order allow,deny [allow parameter setting]
124 Allow from 172.25.254.160 [allowed]
Block Deny from all [forbidden]
126 </Directory>
[test]: In addition to 160, other IPs will not be able to access your Apache Service.

3. "set Password Access rights"
1) generate users, Their encrypted characters, and enter passwords in The/etc/httpd/directory.
First generation htpasswd-cm Htpasswdfile admin
Add Htpasswd-m htpasswdfile HXL
2) Change the configuration file
122<directory "/www/hxl" >
123 allowoverride All (this means that the following configuration is in effect for the Switch)
124 Authuserfile/etc/httpd/htpasswdfile [authentication Encrypted character file]
AuthName "please input Usernameand password" [certification tips]
126 AuthType Basic [authentication type]
127 Require User Hxl [allowed users]
127 Require Valid-user [allow all users]
128</directory>
[test]: Open the browser to access the network also, enter the account (hxl), password (123) can enter the Page.

650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M01/8B/44/wKiom1hIMmHBbffFAABUnri6ZuA912.png "style=" float: none; "title=" 25.png "alt=" wkiom1himmhbbfffaabunri6zua912.png "/>

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M00/8B/44/wKiom1hIMmGAjzlsAAB9ZBq4a60268.png "style=" float: none; "title=" 26.png "alt=" wkiom1himmgajzlsaab9zbq4a60268.png "/>

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M00/8B/40/wKioL1hIMmHSpEBXAADRIGs5a8Y606.png "style=" float: none; "title=" 27.png "alt=" wkiol1himmhspebxaadrigs5a8y606.png "/>

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M01/8B/40/wKioL1hIMmLhGVqgAACtl7UD1fM088.png "style=" float: none; "title=" 28.png "alt=" wkiol1himmlhgvqgaactl7ud1fm088.png "/>

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M01/8B/44/wKiom1hIMmKRPVjXAABVyFYkJg8556.png "style=" float: none; "title=" 29.png "alt=" wkiom1himmkrpvjxaabvyfykjg8556.png "/>


4. "create A virtual host configuration that stores information from different domains"
implementation, when another machine accesses you, music.hxl.com can correctly find the information page of the music Related.
1) add in/etc/hosts in the access machine
172.25.254.160 www.hxl.com hxl.com news.hxl.com music.hxl.com
2) create the following files in the host
Mkdir/var/www/virtual/news.hxl.com/html-p
Mkdir/var/www/virtual/music.hxl.com/html-p
3) by default, The Master profile accesses the conf.d/*.conf file, so the associated configuration file is written to/etc/httpd/conf.d/. There are three configuration files that need to be established: default log entry file: default.conf; about music domain: music.conf; about news field: News.conf.
cd/etc/httpd/conf.d/
Vim default.conf [below]
1 <virtualhost _default_:80>
2 documentroot/var/www/html
3 Customlog "logs/default.log" combined
4 </Virtualhost>

Vim news.conf [below, Music is not the same as this file name, CP change it on the line]
1<virtualhost *:80>
2 servername news.hxl.com
3 documentroot/var/www/virtual/news.hxl.com/html
4 Customlog "logs/news.log" combined
5 </Virtualhost>
6 <directory "/var/www/virtual/news.hxl.com/html" >
Requireall granted
7 </Directory>

[test] the access machine accesses the music.hxl.com in a browser and can see information about the HTML file under the music domain.

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M01/8B/40/wKioL1hIMpPhdAXlAAA1TQvA5Ic299.png "style=" float: none; "title=" 30.png "alt=" wkiol1himpphdaxlaaa1tqva5ic299.png "/>

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M02/8B/44/wKiom1hIMpSCDeYkAABEVxLCKmY731.png "style=" float: none; "title=" 32.png "alt=" wkiom1himpscdeykaabevxlckmy731.png "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/8B/44/wKiom1hIMpWhe2WeAABDOp2bo4w808.png "style=" float: none; "title=" 33.png "alt=" wkiom1himpwhe2weaabdop2bo4w808.png "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/8B/40/wKioL1hIMpbyiFxaAABB1yy9K0U004.png "style=" float: none; "title=" 34.png "alt=" wkiol1himpbyifxaaabb1yy9k0u004.png "/>

650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M00/8B/44/wKiom1hIMpfAT5veAABrd0Tc5Dc074.png "style=" float: none; "title=" 35.png "alt=" wkiom1himpfat5veaabrd0tc5dc074.png "/>

650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M02/8B/40/wKioL1hIMpeQ8fV_AABF_CGSL7U700.png "style=" float: none; "title=" 36.png "alt=" wkiol1himpeq8fv_aabf_cgsl7u700.png "/>


5. "https, Configure your own HTTPS encryption"

1. You can use an automatic download version of the HTTPS settings, "mod_ssl" this, when you visit https, you can click on the download, get someone else's Configuration.

2. Manually configure a free version of your Own.
Yum crypto-utils [SSL certificateand Key Management utilities]

Genkey Host name (www.hxl.com)


650) this.width=650; "src=" http://s2.51cto.com/wyfs02/M00/8B/42/wKioL1hIxLyBFM0LAACXRt7ZOac964.png "title=" 1.png " alt= "wkiol1hixlybfm0laacxrt7zoac964.png"/>

650) this.width=650; "src=" http://s2.51cto.com/wyfs02/M01/8B/46/wKiom1hIxOTzG5GrAABhRnGAnGQ279.png "title=" 2.png " alt= "wkiom1hixotzg5graabhrngangq279.png"/>

[record the location of the generated certificate (web.example.com.crt) and the associated private key (web.example.com.key)]

650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M01/8B/42/wKioL1hIxO7xGy19AACridH0gTI956.png "title=" 3.png " alt= "wkiol1hixo7xgy19aacridh0gti956.png"/>
[continue using the dialog box and select the appropriate key size.] (default 2048-bit Key-bit Recommended value)]


650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M02/8B/46/wKiom1hIxQKwCmJ_AAB_DLMpHao594.png "title=" 4.png " alt= "wkiom1hixqkwcmj_aab_dlmphao594.png"/>[slow to generate random numbers, tap keyboard and move mouse acceleration]

650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M02/8B/42/wKioL1hIxRCwDyIwAACdB1bpdZ0129.png "title=" 6.png " alt= "wkiol1hixrcwdyiwaacdb1bpdz0129.png"/>[refuses to send a certificate request (CSR) to a certification authority (CA)]

650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M00/8B/46/wKiom1hIxSGApqT0AACdB1bpdZ0775.png "title=" 6.png " alt= "wkiom1hixsgapqt0aacdb1bpdz0775.png"/>[deny Encrypting private key]



650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M02/8B/46/wKiom1hIxS3RVz7PAACdpovM6U8944.png "title=" 7.png " alt= "wkiom1hixs3rvz7paacdpovm6u8944.png"/>

[provides the appropriate identity for the Server. Common name must exactly match the host name of the domain Server. (note that any comma should be escaped with a leading backslash [\])]

3. Write the key and certificate to/etc/httpd/conf.d/ssl.conf after generating the key and certificate
Sslcertificatefile/etc/pki/tls/certs/www.hxl.com.crt
107 Sslcertificatekeyfile/etc/pki/tls/private/www.hxl.com.key
Test
Open the test machine browser
https://172.25.254.160
I understand the risks Add Exception ... Location:https://172.25.254.160/[download Certificate from this place]
Then click on the lock to view the certificate details here Organization (O) and other information is generated by your own production Information. Ok
650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M00/8B/40/wKioL1hIMrTAVj9mAADZ94QUY_Q241.png "title=" 38.png "alt=" Wkiol1himrtavj9maadz94quy_q241.png "/>

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M02/8B/42/wKioL1hIxUKh1asdAAFA33UAgHY227.png "title=" 9.png " alt= "wkiol1hixukh1asdaafa33uaghy227.png"/>


"SMTP Record & Apache service"

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.