Sqlserver2008+IIS7.5 自动安装恢复及发部WEB

Sqlserver2008+IIS7.5 自动安装恢复及发部WEB,第1张

概述本文意在方便的部署一个WEB程序,故学写一个SHELL(俗称一下) 注:本次实验为 WINDOWS SERVER2008R2+Sqlserver2008(developer)+IIS7.5+ASP.NET 有啥米问题QQ:285979593留言哒 @echo offset current_path=%~dp0set hostname=WIN-S43U30SI4GQset INSTA
本文意在方便的部署一个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.txt Ping 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
总结

以上是内存溢出为你收集整理的Sqlserver2008+IIS7.5 自动安装恢复及发部WEB全部内容,希望文章能够帮你解决Sqlserver2008+IIS7.5 自动安装恢复及发部WEB所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/1175243.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-02
下一篇 2022-06-02

发表评论

登录后才能评论

评论列表(0条)

保存