Linux-apache Permissions limit IP port domain name +DNS domain name resolution

Source: Internet
Author: User

Happy original, Daily notes


Install the Dns,bind package first

RPM-IVH bind-***


Installation complete, modify the DNS configuration file

vim/var/named/chroot/etc/named.conf access to the master configuration file

Write the following configuration information

Options {

Directory "/var/named"

};

Configuration file Address

Zone "****.com" in {

Type Master

File "****.com.zone"

} ;


Enter spatial file modification information

The domain name is freely written by itself,

In the detailed configuration of the domain name corresponding IP, etc.

$TTL 86400

@ SOA ***.com.    Admin.***.com. (

20160910

3H

30M

1H

1D

)

@ in NS ns1. host. com.

NS1 in A 192.168.1.1

www in A 192.168.1.1

There are any COM above. Meaning is the end

The following first configuration based on different ports to achieve the same domain name with the IP different Web Access

First enter the HTTPD master profile, start the virtual host, and then listen for the ports ready to be enabled

Vim/usr/local/httpd/conf/httpd.conf

Listen port boot Port monitoring

Include conf/extra/httpd-vhosts.conf Remove the # comment to start the virtual host

Httpd.conf basically doesn't have to be open.


Go to the virtual host configuration file to modify the corresponding parameters!


<directory "/AAA" >

Order Allow,deny

Allow from all

</directory>

Give path folder permissions first

Namevirtualhost Host Address IP


<virtualhost ip:port>

ServerAdmin Mailbox

DocumentRoot "File path"

ServerName website Domain name

Serveralias Multi-domain

Errorlog "Logs/dummy-host.example.com-error_log" log file

Customlog "Logs/dummy-host.example.com-access_log" Common log file

</VirtualHost>


Configuration two different, home page path is not the same, the port is not the same can be achieved,

Access to different ports requires the addition of a domain name or IP: port

For example. www.gao.com:801

Port method is basically no, too cumbersome, who visit the site also need to add port it.



Different IPs can only be modified by IP. path. domain name. Free configuration, this method wastes resources, it is very expensive IP


Different domain name access, only need to modify the domain name, an IP can share n domain name as long as the server is good enough, is currently the mainstream configuration

The price of a domain is much cheaper than IP.


Restricting an IP host domain name, and so on, is just access to the directory. Well, that's the command.

<directory "/var/www/html" > specified directory

All allow after order Deny,allow rejected

Deny from 192.168.1.0/24 Target

</directory>


Site user login configuration, need to login to get permission to browse, for the company's internal Web site.

Create a user document first, and so on

Cd/usr/local/httpd/first into the Apache home directory

Bin/htpasswd-c/usr/local/httpd/conf/.awspwd Gao created awspwd user name is Gao

The password will be entered once, followed by a duplicate confirmation password to complete the user creation

Go to virtual configuration file modification


<directory "/aaa/gao" > specified file

Auth name "Gao.com"

AuthType Basic Type

Authuserfile/usr/local/httpd/conf/.awspwd User Files Directory

Require Valid-user allows users to log in! important

</directory>

After you have done these logins, you will need to log in before


All of these are my own ideas. If there's anything wrong, please help me.

2016-9-10


This article is from the "11627223" blog, please be sure to keep this source http://11637223.blog.51cto.com/11627223/1907037

Linux-apache Permissions limit IP port domain name +DNS domain name resolution

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.