Sqlserver2008+IIS7.5 自动安装恢复及发部WEB
2013-03-13 16:52
239 查看
本文意在方便的部署一个WEB程序,故学写一个SHELL(俗称一下)
注:本次实验为 WINDOWS SERVER2008R2+Sqlserver2008(developer)+IIS7.5+ASP.NET
有啥米问题QQ:285979593留言哒
@echo offset current_path=%~dp0set hostname=WIN-S43U30SI4GQset INSTALLSQLDATADIR=c:\MSSQL2008set INSTANCENAME=fkfjset PASSWORD=IBM-Password2012set restoredbname=dayunoatargetset disk=%~dp0oatarget.bakREM --------------------------------IIS变量set sitename=dayunset siteport=80set sitephysicalpath=c:\oa:initmkdir %INSTALLSQLDATADIR%mkdir %sitephysicalpath%if exist c:\setup.txt (goto setup) else goto check:setupfor /f %%i in (c:\setup.txt) do (ECHO %%iif "%%i" == "STEP1" (goto STEP1)if "%%i" == "STEP2" (goto STEP2)if "%%i" == "STEP3" (goto STEP3)if "%%i" == "STEP4" (goto STEP4)if "%%i" == "STEP5" (goto STEP5))goto exitREM ------------------------------------------------------NET组件安装:STEP1echo STEP2> c:\setup.txtreg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v autoinstall /d "%current_path%auto_install.bat" /fServerManagerCmd -install NET-Framework -allSubFeaturesSetup.exe /QSshutdown -r -t 0goto exitREM ------------------------------------------------------数据库安装:STEP2echo STEP3>c:\setup.txtSetup.exe /QS /ACTION=Install /SkipRules=VSShellInstalledRule /IAcceptSQLServerLicenseTerms="True" /FEATURES=SQLEngine,IS,SSMS /INSTANCENAME=%INSTANCENAME% /INSTALLSQLDATADIR="%INSTALLSQLDATADIR%" /SQLSVCACCOUNT="NT AUTHORITY\SYSTEM" /SAPWD="IBM-Yunsoft2012" /SQLSYSADMINACCOUNTS="%hostname%\ADMINISTRATOR" /AGTSVCACCOUNT="NT AUTHORITY\SYSTEM"ping 127.1 -n 10 >nul 2>nulshutdown -r -t 0goto exitREM ------------------------------------------------------数据库恢复:STEP3echo STEP4>c:\setup.txtping 127.1 -n 20 >nul 2>nulosql -E -S .\%INSTANCENAME% -Q "restore database %restoredbname% from disk = '%disk%' with move 'UCMLOASESTarget' to '%INSTALLSQLDATADIR%\MSSQL10_50.%INSTANCENAME%\MSSQL\DATA\UCMLOAEnv_090527.mdf',move 'UCMLOASESTarget_log' to '%INSTALLSQLDATADIR%\MSSQL10_50.%INSTANCENAME%\MSSQL\DATA\UCMLOAEnv_090527_log.ldf'"pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;IIS-ASP;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-ManagementScriptingTools;IIS-ManagementService;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;IIS-LegacySnapIn;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPIping 127.1 -n 20 >nul 2>nulshutdown -r -t 0goto exitREM ------------------------------------------------------开启数据库SA权限及IIS安装:STEP4echo STEP5>c:\setup.txtreg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10_50.FKFJ\MSSQLServer /v LoginMode /t REG_DWORD /d 2 /fping 127.1 -n 20 >nul 2>nulosql -E -S .\fkfj -Q "ALTER LOGIN sa WITH PASSWORD ='%PASSWORD%'"osql -E -S .\fkfj -Q "ALTER LOGIN sa ENABLE"net stop mssql$fkfjnet start mssql$fkfjpkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;IIS-ASP;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-ManagementScriptingTools;IIS-ManagementService;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;IIS-LegacySnapIn;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPIshutdown -r -t 0goto exitREM ------------------------------------------------------拷贝文件及IIS发布:STEP5echo FINISH>c:\setup.txtrobocopy %current_path%BPObject %sitephysicalpath% /EC:\Windows\System32\inetsrv\appcmd.exe add site /name:"%sitename%" /bindings:http://localhost:%siteport% /physicalpath:%sitephysicalpath%C:\Windows\System32\inetsrv\appcmd.exe set apppool /apppool.name:DefaultAppPool /enable32BitAppOnWin64:truenet start aspnet_stategoto exitREM ------------------------------------------------------:checkecho 配制文件不存在echo STEP1>c:\setup.txtgoto initREM ------------------------------------------------------:exit
相关文章推荐
- 前端自动打包工具webpack的安装和使用
- 如果制作一个web项目安装部署包,并自动安装一些必备的组件?
- web 自动安装ca证书
- 让web程序也能自动安装
- 自动抄表系统web版技术笔记 ---环境安装调试篇
- web自动安装脚本(apache/nginx+php+mysql)
- CentOS安装配置svn,并配置SVN自动更新Web目录
- winpe下硬盘不存在,自动安装恢复ghost不存在
- Web 安装包实现IE的自动安装
- 在Windows Azure Web Site上为Node.js自动安装NPM包
- 解决webview闪屏,加载html富文本,设置字体view自动恢复
- web打包自动安装IIS和数据库
- web打包自动安装IIS和数据库
- Windows7 Eclipse中Maven的安装,配置,自动生成web.xml
- java 自动创建数据库,安装web项目的类
- 在Windows Azure Web Site上为Node.js自动安装NPM包
- web打包自动安装IIS和数据库
- linux服务器安装svn与自动更新上传文件到web目录
- 在Windows Azure Web Site上为Node.js自动安装NPM包
- Ghost安装Win7/XP后自动恢复IP的批处理代码(ip备份恢复)