Win2003安装IIS无法复制文件-解决方法

新装了一台win2003,是通过GHO镜像安装的,安装完毕后发现系统组件很多东西用不上,就删除了,之后想安装IIS的FTP功能,结果就老提示

不管放什么I386都是这个提示,于是上网搜了一下发现已经有高人解决了这个问题

原因:由于损坏了系统内部数据库所致.修复损坏的数据文件即可正常安装,此方 法可解决无法复制staxmem.dll、iisapp.vbs、convlog.exe等文件的问题

解决:

(1) 开始 > 运行 > 输入 CMD >再输入以下命令:

1、esentutl /g %windir%/security/database/secedit.sdb (该命令参数用于查询secedit.sdb文件是否被损坏,若返回“Integrity check successful”,刚表示该文件没有被损坏,否则请执行第2步命令参数以修复secedit.sdb文件)

2、esentutl /p %windir%/security/database/secedit.sdb

(2) 接着屏幕上会输出如下信息:

Microsoft(R) Windows(R) Database Utilities

Version 5.2

Copyright (C) Microsoft Corporation. All Rights Reserved.

Initiating INTEGRITY mode…

Database: C:\WINDOWS\security\database\secedit.sdb

Temp. Database: TEMPINTEG2680.EDB

Checking database integrity.

Scanning Status (% complete)

0 10 20 30 40 50 60 70 80 90 100

|—|—|—|—|—|—|—|—|—|—|

……………………………………………

Integrity check successful.

Operation completed successfully in 0.841 seconds.

点击确定

3)插入安装盘再试一下,问题迎刃而解。

Exchange2010 sp2架构记录

本文只做架构记录,配置另起文章记录

先决条件

2008 R2 SP1版本

安装.net3.5

打上所有补丁,直到没有补丁为止

安装IIS7,安装的选择如下图

 

运行命令 dcpromo安装域

安装Microsoft Office 2010 Filter Pack  点这里下载

进入exchange2010安装目录,以次运行

setup /pl (如果域里有旧版的exchange才运行)

setup /ps (拓展域架构:重要!!)

然后运行

 setup /preparead /on:exchange

再然后

setup /p

最后

setup /pd

安装完后重启,问我为什么要这么弄?我只知道第一个是拓展AD的,为的是局域网内并存ex2003和2007,其他我还没搞懂,另外你如果不按顺序来会提示 OrganizationName  未指定的错误,但是我运行setup /PrepareAD [/OrganizationName <organization name> ]会提示未找到指定程序,谁知道OrganizationName 参数要如何指定?我是没弄懂,你懂了请告诉我

 

最后双击setup安装exchange2010 sp2

 

 

iptables下的NAT

功能需求:有5个大地址,实现NAT的时候要求建立一个地址池;要将www,ftp服务及一些端口,如:3389映射到内网。
硬件配置:服务器 eth0接外网,绑定5个大IP(118.22.66.146-150);eth1接内网,地址:116.116.116.252
下面是完整脚本及注解(红字)。

echo “1″>/proc/sys/net/ipv4/ip_forward
iptables -F
iptables -t nat -F
modprobe ip_nat_ftp 要映射FTP必需加裁此模块
iptables -t nat -A PREROUTING -d 118.22.66.150 -p tcp –dport 80 -j DNAT –to 116.116.116.99:80 将www商品映射到内网
iptables -t nat -A POSTROUTING -d 116.116.116.99 -p tcp –dport 80 -j SNAT –to 118.22.66.150 为www服务流建立回路,此处要注意,因我们是建立了一个NAT地址池,所以必需加此回路,且要指到提供服务的外网地址上。若不建立地址池,此条回路指到内网IP即可!
iptables -t nat -A PREROUTING -d 118.22.66.150 -p tcp –dport 3389 -j DNAT –to 116.116.116.99:3389
iptables -t nat -A POSTROUTING -d 116.116.116.99 -p tcp –dport 3389 -j SNAT –to 118.22.66.150
为FTP的port模式开放端口映射
iptables -t nat -A PREROUTING -d 118.22.66.150 -p tcp –dport 21 -j DNAT –to 116.116.116.99:21
iptables -t nat -A POSTROUTING -d 116.116.116.99 -p tcp –dport 21 -j SNAT –to 118.22.66.150
iptables -t nat -A PREROUTING -d 118.22.66.150 -p tcp –dport 20 -j DNAT –to 116.116.116.99:20
iptables -t nat -A POSTROUTING -d 116.116.116.99 -p tcp –dport 20 -j SNAT –to 118.22.66.150
端口重定向例子
iptables -t nat -A PREROUTING -d 118.22.66.150 -p tcp –dport 3312 -j DNAT –to 116.116.116.12:3389
iptables -t nat -A POSTROUTING -d 116.116.116.12 -p tcp –dport 3389 -j SNAT –to 118.22.66.150
NAT代理上网,使用外网地址池
iptables -t nat -A POSTROUTING -j SNAT –to 118.22.66.146-118.22.66.150

Windows7 不能连接L2TP/IPSec VPN的解决办法,以及MacOS拨上VPN后,默认路由没改的解决办法

Windows 7里连接不上L2TP/IPSec的VPN,提示无法连接主机,主机没响应。 前提是:L2TP都设置正确,协议是L2TP/IPSec,Preshared Key也填写了。 具体解决办法如下:

1. 确保服务里面“IKE and AuthIP IPSec Keying module” 和“IPSec policy agent”两个服务状态是自动,并且已经运行 2. 打开注册表,在HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PolicyAgent里添加一个DWORD(32-bit),名称是AssumeUDPEncapsulationContextOnSendRule的key,值为

2 重启电脑即可。 如果你是在公司域中,需要在VPN设置里,去掉Include Windows logon domain前面的钩即可。 如果是在MacOS中发现VPN能连上,但是默认路由还是走原来的,并没有走VPN,可以参考这篇文章,把Service Order改一下,让VPN在Wifi/Ethernet之前就好了

Keepalived+LVS+Squid

转来的,待学习待验证,好了再放注解和结果

Keepalived+LVS+Squid
Provision of proxy with load balance and high availability
Will
Two servers squid01 and squid02 have the same config in squid, each server in load balance and HA at one time(when squid01 is master it as LVS Director server and LVS Realserver1, squid02 is LVS Realserver2 Vice versa)
Install and Configure
Same Part:
OS:RHEL4_U5_i386

Soft:
keepalived-1.1.15
ipvsadm-1.24
squid-2.6.STABLE21

1. Squid:
useradd squid –M
mkdir –p /home/cache/cachedir
chown squid.squid –R /home/cache
tar jxvf squid-2.6.STABLE21.tar.bz2 –C /usr/src
cd /usr/src/squid-2.6.STABLE21/
./configure –prefix=/usr/local/squid –enable-async-io=80 –enable-icmp –enable-snmp –enable-cache-digests –enable-poll –enable-linux-netfilter  –enable-arp-acl
make && make install

2. Ipvsadm:
tar jxvf STABLE-2.1.4.tar.bz2 –C /usr/src
uname –a
#Linux squid01.2.6.9-55.ELsmp #1 SMP Fri Apr 20 17:03:35 EDT 2007 i686 i686 i386 GNU/Linux
ln -s /usr/src/kernels/2.6.9-55.EL-smp-i686/ /usr/src/linux
cd /usr/src/ipvsadm-1.24/
make && make install

3. Keepalived
tar zxvf keepalived-1.1.15.tar.gz –C /usr/src
cd /usr/src/keepalived-1.1.15
./configure –prefix=/
make && make install

Different Part:
Configure in Squid01
ifcfg-eth0:
DEVICE=eth0
ONBOOT=yes
BOOTPRO=static
IPADDR=192.168.1.190
NETMASK=255.255.255.0
GATEWAY=192.168.1.1

ifcfg-lo:0:
DEVICE=lo:0
NAME=loopback
ARP=no
ONBOOT=yes
BOOTPRO=static
IPADDR=192.168.1.193
NETMASK=255.255.255.255
NETWORK=192.168.1.0

/etc/rc.d/rc.local:
ulimit -n 65535
route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0

/etc/sysconfig/iptables:
#add:
-A RH-Firewall-1-INPUT -s 192.168.1.195 -d 224.0.0.18 -j ACCEPT
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 3128 -j ACCEPT
-A RH-Firewall-1-INPUT -m state –state NEW -m udp -p udp –dport 3130 -j ACCEPT

/etc/hosts
#add:
192.168.1.190 squid01.test squid01
192.168.1.195 squid02.test squid02

Squid.conf:
http_port 3128 transparent
icp_port 3130
acl QUERY urlpath_regex cgi-bin \?
acl all src 0.0.0.0/0.0.0.0
cache_peer squid02 sibling 3128 3130 proxy-only
acl manager proto cache_object
no_cache deny QUERY
cache_swap_high 90
cache_dir aufs /home/cache/cachedir 500 16 256
access_log /usr/local/squid/var/logs/access.log squid
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
acl our_networks src 192.168.1.0/24
acl my_proxies src 192.168.1.190 192.168.1.195
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow our_networks
http_access allow localhost
http_access deny all
http_reply_access allow all
icp_access allow my_proxies
icp_access deny !my_proxies
visible_hostname squid01
always_direct allow my_proxies
coredump_dir /home/cache/cachedir
hierarchy_stoplist cgi-bin ?
cache_effective_user squid
cache_effective_group squid

keepalived.conf:
! Configuration File for keepalived
global_defs {
notification_email {
admin@yourmail.com
}
notification_email_from keepalived@VM_squid01
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id LVS_K_Squid01
}
vrrp_sync_group VG1 {
group {
VI_1
}
}
vrrp_instance VI_1 {
state MASTER
interface eth0
lvs_sync_daemon_interface eth0
virtual_router_id 51
priority 150
advert_int 1
smtp_alert
authentication {
auth_type PASS
auth_pass P@ssWd
}
virtual_ipaddress {
192.168.1.193 dev eth0
}
notify_backup “/usr/local/etc/backup.sh BACKUP”
notify_master “/usr/local/etc/master.sh MASTER”
}
virtual_server 192.168.1.193 3128 {
delay_loop 6
lb_algo rr
lb_kind DR
nat_mask 255.255.255.0
protocol TCP
persistence_timeout 600
real_server 192.168.1.195 3128 {
! weight 1
TCP_CHECK {
connect_timeout 3
}
}
real_server 192.168.1.190 3128 {
! weight 2
TCP_CHECK {
connect_timeout 3
}
}
}

/usr/local/etc/backup.sh:
#!/bin/sh
RIP1=192.168.1.190
RIP2=192.168.1.195
VIP=192.168.1.193
GW=192.168.1.1
ssh $RIP2 “/sbin/arping -U -c 3 -s $VIP $GW &”
#RS
echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignore
echo 2 > /proc/sys/net/ipv4/conf/lo/arp_announce
echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore
echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce
sysctl –p

/usr/local/etc/master.sh:
#!/bin/sh
VIP=192.168.1.193
GW=192.168.1.1
/sbin/arping -U -c 3 -s $VIP $GW &
echo 0 > /proc/sys/net/ipv4/conf/lo/arp_ignore
echo 0 > /proc/sys/net/ipv4/conf/lo/arp_announce
echo 0 > /proc/sys/net/ipv4/conf/all/arp_ignore
echo 0 > /proc/sys/net/ipv4/conf/all/arp_announce
#Directorserver
echo 0 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/conf/all/send_redirects
echo 1 > /proc/sys/net/ipv4/conf/default/send_redirects
echo 1 > /proc/sys/net/ipv4/conf/eth0/send_redirects
sysctl –p

Configure in Squid02
ifcfg-eth0:
DEVICE=eth0
ONBOOT=yes
BOOTPRO=static
IPADDR=192.168.1.195
NETMASK=255.255.255.0
GATEWAY=192.168.1.1

ifcfg-lo:0:
DEVICE=lo:0
NAME=loopback
ARP=no
ONBOOT=yes
BOOTPRO=static
IPADDR=192.168.1.193
NETMASK=255.255.255.255
NETWORK=192.168.1.0

/etc/rc.d/rc.local:
ulimit -n 65535
route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0

/etc/sysconfig/iptables
#add:
-A RH-Firewall-1-INPUT -s 192.168.1.190 -d 224.0.0.18 -j ACCEPT
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 3128 -j ACCEPT
-A RH-Firewall-1-INPUT -m state –state NEW -m udp -p udp –dport 3130 -j ACCEPT

/etc/hosts
#add:
192.168.1.190 squid01.test squid01
192.168.1.195 squid02.test squid02

Squid.conf:
http_port 3128 transparent
icp_port 3130
acl QUERY urlpath_regex cgi-bin \?
acl all src 0.0.0.0/0.0.0.0
cache_peer squid01 sibling 3128 3130 proxy-only
acl manager proto cache_object
no_cache deny QUERY
cache_swap_high 90
cache_dir aufs /home/cache/cachedir 500 16 256
access_log /usr/local/squid/var/logs/access.log squid
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
acl our_networks src 192.168.1.0/24
acl my_proxies src 192.168.1.190 192.168.1.195
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow our_networks
http_access allow localhost
http_access deny all
http_reply_access allow all
icp_access allow my_proxies
icp_access deny !my_proxies
visible_hostname squid01
always_direct allow my_proxies
coredump_dir /home/cache/cachedir
hierarchy_stoplist cgi-bin ?
cache_effective_user squid
cache_effective_group squid

keepalived.conf:
! Configuration File for keepalived
global_defs {
notification_email {
admin@ yourmail.com
}
notification_email_from keepalived@VM_squid02
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id LVS_K_Squid02
}
vrrp_sync_group VG1 {
group {
VI_1
}
}
vrrp_instance VI_1 {
state BACKUP
interface eth0
lvs_sync_daemon_interface eth0
virtual_router_id 51
priority 150
advert_int 1
smtp_alert
authentication {
auth_type PASS
auth_pass P@ssWd
}
virtual_ipaddress {
192.168.1.193 dev eth0
}
notify_backup “/usr/local/etc/backup.sh BACKUP”
notify_master “/usr/local/etc/master.sh MASTER”
}
virtual_server 192.168.1.193 3128 {
delay_loop 6
lb_algo rr
lb_kind DR
nat_mask 255.255.255.0
protocol TCP
persistence_timeout 600
real_server 192.168.1.195 3128 {
! weight 1
TCP_CHECK {
connect_timeout 3
}
}
real_server 192.168.1.190 3128 {
! weight 2
TCP_CHECK {
connect_timeout 3
}
}
}

/usr/local/etc/backup.sh:
#!/bin/sh
RIP1=192.168.1.190
RIP2=192.168.1.195
VIP=192.168.1.193
GW=192.168.1.1
ssh $RIP1 “/sbin/arping -U -c 3 -s $VIP $GW &”
#RS
echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignore
echo 2 > /proc/sys/net/ipv4/conf/lo/arp_announce
echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore
echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce
sysctl –p

/usr/local/etc/master.sh:
#!/bin/sh
VIP=192.168.1.193
GW=192.168.1.1
/sbin/arping -U -c 3 -s $VIP $GW &
echo 0 > /proc/sys/net/ipv4/conf/lo/arp_ignore
echo 0 > /proc/sys/net/ipv4/conf/lo/arp_announce
echo 0 > /proc/sys/net/ipv4/conf/all/arp_ignore
echo 0 > /proc/sys/net/ipv4/conf/all/arp_announce
#Directorserver
echo 0 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/conf/all/send_redirects
echo 1 > /proc/sys/net/ipv4/conf/default/send_redirects
echo 1 > /proc/sys/net/ipv4/conf/eth0/send_redirects
sysctl –p
End