@echo off
echo.
set/p var= 请输入jsp主机ftp用户名 :
echo.
set/p abc= 请输入jsp主机的域名 :www.
echo.
echo 你输入的用户名是:%var%
echo.
echo 你需要绑定的域名是:www.%abc%
echo.
pause
cd C:Tomcat6conf
copy catalina.policy catalina.policy.bak
@echo. >>catalina.policy
@echo grant codeBase "file:D:/webroot/%var%/-" { >>catalina.policy
rem @echo permission java.security.AllPermission;
@echo permission java.io.FilePermission "d:\webroot\%var%\", "read"; >>catalina.policy
@echo permission java.io.FilePermission "d:\webroot\%var%\-", "read, write, delete"; >>catalina.policy
@echo }; >>catalina.policy
copy server.xml server.xml.bak
@find /v "</Service>" <server.xml >1.txt
@find /v "</Server>" <1.txt >server.xml
@find /v "</Engine>" <server.xml >1.txt
del server.xml
ren 1.txt server.xml
@echo ^<Host name="www.%abc%" appBase="D:/webroot/%var%/" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false" ^> >>server.xml
@echo ^<Alias^>%var%.hzsd08.beitesoft.com^</Alias^> >>server.xml
@echo ^<Alias^>%abc%^</Alias^> >>server.xml
@echo ^<Context crossContext="true" docBase="web" path="" reloadable="true" /^> >>server.xml
@echo ^</Host^> >>server.xml
@echo. >>server.xml
@echo ^</Engine^> >>server.xml
@echo ^</Service^> >>server.xml
@echo ^</Server^> >>server.xml
@sc stop tomcat6
@sc start tomcat6
@echo on
@echo 还需要在IIS里面操作:
@echo.
@echo 添加jsp映射到C:Tomcat6confisapi_redirect.dll
@echo 添加名为jakarta的ISAPI筛选器至C:Tomcat6confisapi_redirect.dll
@echo 添加名称为jakarta路径为C:Tomcat6conf的虚拟目录
@pause>nul