公司内部项目较多,希望搭建一个内部环境,满足以下需求:
- 每次有新的项目可以不用修改host文件,产品及测试随时查看开发进度(企业内dns解析)
- 前端开发人员不用做复杂的服务器配置(mount+virtualhost)
安装bind9
sudo apt-get install bind9 bind9-doc bind9-host bind9utils dnsutils
开启dns缓存(可选)
sudo vim /etc/bind/named.conf.options(dns缓存)
forwarders { 8.8.8.8; 202.96.134.133; 202.96.128.166; };
增加一个域名
sudo vim /etc/bind/named.conf.local
zone "shining.dev" { type master; file "/etc/bind/db.shining.dev"; };
域名配置
sudo cp /etc/bind/db.local /etc/bind/db.shining.dev
sudo vim /etc/bind/db.shining.dev
$TTL 604800 @ IN SOA localhost. root.localhost. ( 2 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS localhost. @ IN A 10.1.0.21 *.shining.dev. IN A 10.1.0.21
启动&开机自动启动bind9
sudo chkconfig bind9 on sudo service bind9 start
linux开启共享
sudo apt-get install samba
sudo vim /etc/samba/smb.conf
[share] comment = share path = /home/ning/project browseable = yes guest ok = yes writable = yes
sudo chkconfig samba on
sudo service samba start