Installing RPM Packages
[Email protected] extra]# Rpm-qa | grep "^bind"
bind-chroot-9.8.2-0.17.rc1.el6_4.6.x86_64 Pseudo-root (optional)
Main:
Bind-libs-9.8.2-0.17.rc1.el6_4.6.x86_64
Bind-utils-9.8.2-0.17.rc1.el6_4.6.x86_64
Bind-9.8.2-0.17.rc1.el6_4.6.x86_64
Install packages
Yum install-y bind Bind-libs bind-utils
See if the installation was successful!
[Email protected] dns]# Rpm-qa | grep "^bind"
Bind-libs-9.8.2-0.17.rc1.el6_4.6.x86_64
Bind-9.8.2-0.17.rc1.el6_4.6.x86_64
Bind-utils-9.8.2-0.17.rc1.el6_4.6.x86_64
To see if the DNS service is running
[[Email protected] dns]# service named status (stop state)
Edit Profile Default listener port is 53
Named service's main provisioning file
Vim/etc/named.conf
Options {
Directory "/var/named";
};
Zone "Benet.com" in {
Type master;
File "Benet.com.zone";
};
Zone "116.168.192.in-addr.arpa" in {
Type master;
File "192.168.116.zone";
};
Zone "Accp.com" in {
Type master;
File "Accp.com.zone";
};
Zone Data configuration file
Cd/var/named
CP Named.localhost Benet.com.zone
Vim Benet.com.zone
Configured as follows
$TTL 86400
@ in SOA benet.com. Admin.benet.com. (
10; Serial
1D; Refresh
1H; Retry
1W; Expire
3H); Minimum
@ in NS ns1.benet.com.
NS1 in A 192.168.116.111
www in A 192.168.116.111
~
CP Benet.com.zone Accp.com.zone
Vim Accp.com.zone
Configured as follows
$TTL 86400
@ in SOA accp.com. Accp.benet.com. (
10; Serial
1D; Refresh
1H; Retry
1W; Expire
3H); Minimum
@ in NS ns1.accp.com.
NS1 in A 192.168.116.111
www in A 192.168.116.111
~
Vim 192.168.116.zone
Configured as follows
$TTL 86400
@ in SOA benet.com. Admin.benet.com. (
10; Serial
1D; Refresh
1H; Retry
1W; Expire
3H); Minimum
@ in NS ns1.benet.com.
111 in PTR ns1.benet.com.
111 in PTR www.benet.com.
111 in PTR www.accp.com.
111 in PTR ns1.accp.com.
Set permissions
chmod 777 Benet.com.zone
chmod 777 Accp.com.zone
chmod 777 192.168.116.zone
Restart named service
Service named start
Test results
Nslookup www.benet.com
Nslookup 192.168.116.111
Nslookup www.accp.com
• Domain-based Apache virtual host
Preparing directories and files
Mkdir-p/var/www/html/benetcom
Mkdir-p/var/www/html/accpcom
echo "benet.com" >/var/www/html/benetcom/index.html && echo "accp.com" >/var/www/html/accpcom/index.ht ml
Modify a virtual host profile--Configure a virtual host
vim/usr/local/httpd/conf/extra/httpd-vhosts.conf Virtual Host Master File
Configuration content
Directory permissions (allow all hosts to access)
<directory "/var/www/html" >
Order Allow,deny
Allow from all
</Directory>
Namevirtualhost 192.168.116.111
<virtualhost 192.168.116.111>
DocumentRoot "/var/www/html/benetcom"
ServerName www.benet.com
Errorlog "Logs/dummy-host.example.com-error_log"
Customlog "Logs/dummy-host.example.com-access_log" common
</VirtualHost>
<virtualhost 192.168.116.111>
DocumentRoot "/var/www/html/accpcom"
ServerName www.accp.com
Errorlog "Logs/dummy-host2.example.com-error_log"
Customlog "Logs/dummy-host2.example.com-access_log" common
</VirtualHost>
Modifying the master configuration file for Apache
Vim/usr/local/httpd/conf/httpd.conf
After configuring the virtual host, the file is included in the
387 # Virtual Hosts
388 Include conf/extra/httpd-vhosts.conf
Access in the browser separately
Www.benet.com www.accp.com
The page that appears is not as successful!!!
This article from the "Smile Habit of You" blog, declined reproduced!
DNS Service +apache Virtual host