zoukankan      html  css  js  c++  java
  • 在GoDaddy上部署SubText

     

    引子:

    本人原先使用的虚拟主机是一家叫海意互联的公司提供的,半年里面出现了好几次问题,基本都是Server Application Unavailable,每次都要联系他们才能恢复,这个问题我在平时也经常碰到,因为我们公司的项目有些是1.1,有些是2.0,如果将1.1的项目和2.0的项目使用一个进程池部署的话,可能就会出现Server Application Unavailable错误。所以我怀疑他们的服务器上的不同版本framework的应用程序是混在一起部署的。前天,同样的情况又发生了,于是我又向他们反映,说这样的情况出现了很多次了,问他们是不是将1.1和2.0混在一起部署。那人很不耐烦,我问进程池的问题,他说“我想忙其他的,有空再和你讨论这些”。经我一番追问,按照他的说法,他们的”进程池是随机分配的,几个网站一个进程池”。我说那这样会产生问题,可以参考这里。想不到他态度极其恶劣,引用他的原话”对于你的问题,不好意思,我不想回答。请不要搞得好像我们欠你的一样,对于处理凡是,我看也不用你来教”,“很简单,你觉得我们这里不行,那你就换其他人的空间就是了。”。要知道,我是付钱的啊!对于这种公司,我真是无语了。。。我想这种公司,这种对待客户的态度,估计被淘汰是迟早的事吧,现在虚拟主机满天飞。。。

     

    正文:

    好,你说换,我马上就换给你看。。。我想估计国内的虚拟主机都不太靠谱,我决定搞个国外的试试。。。经过一番比较,还是觉得GoDaddy的比较好,4.99刀一个月,一年折合人民币的话大概400左右(按照汇率1:7来算)。提供的功能还是比较满意的,列举主要几点:

    空间:
    Disk Space:10 GB
    Monthly Data Transfer :300 GB
    FTP Users:50

    数据库:(同时有3种数据库)
    MS Access:Yes
    MS SQL:1X200M
    MYSql:2X200M

    域名:
    External Domains:Unlimited
    Subdomains:25

    支持语言:
    Frontpage Server Ext.                
    Server Side Includes (SSI)                
    ASP                
    ASP.NET v1.0/2.0/3.0/3.5                
    ASP.NET AJAX                
    PHP4 or PHP5°

    特别提一下,这个空间还支持虚拟目录,所以可以同时部署很多应用程序。

    更详细的功能列表请参考:http://www.godaddy.com/Hosting/Legacy.aspx 注意,请选择正确的Operating System,.net的话,当然要选Windows:

    image 

    对于我这么一个小博客来说,这些是绰绰有余了,马上申请了2个月(先试试看,因为先前在now.cn申请了空间,结果subtext部署不上去。。。),一共9刀多,信用卡付钱马上开通使用。

    以下是博客迁移过程,遇到了一些问题,现在记录下来,希望对遇到同样问题的朋友有所帮助。

    1. 首先要用GoDaddy的Wizard对空间做一些基本设置,很简单,按照提示照做就行。

    2. 将域名转向到新的空间。

    3. 用FTP把所有文件从海意互联搬到GoDaddy。GoDaddy空间开通以后,ftp帐号会在右边页面的panel显示:

    image

    4. 用GoDaddy的向导创建数据库。

    5. 迁移数据库。

    这里要详细说一下迁移数据库的问题,可能由于安全原因,GoDaddy是不支持恢复从其他数据库备份的文件的。但是GoDaddy提供了一个很好的接口——通过DataBase Publish Wizard 来发布数据库。我从海意把数据库下载下来,在本地的sql server上恢复好,然后用DataBase Publish Wizard发布,在这个过程中,遇到了一个问题,由于本地的数据库的Collation是ChineseXXX而GoDaddy上的是SQL_LatinXXX,所以在发布过程中会遇到Collation不匹配而失败,所以如果遇到这个错误,则需要用DataBase Publish Wizard先生成Schema的脚本,拿到GoDaddy的DataBase Web Administration上运行。之后再用DataBase Publish Wizard发布数据。

    image

    6. 修改Web.Config,将ConnectionString指向新的数据库。

    7. 运行网站,可能会遇到报错,我遇到了两个问题:

    (a)

      

    Configuration Error

    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
    Parser Error Message: This configuration section cannot be used at this path.  This happens when the site administrator has locked access to this section using <location allowOverride="false"> from an inherited configuration file.
    Source Error:

    这个问题是由于GoDaddy的Trust Level是Medium,所以,要把WebConfig里的<trust level="Full" originUrl=".*" />注释掉。

    (b)

    Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
    
    Stack Trace:
    
    [SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
       System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
       System.Security.CodeAccessPermission.Demand() +59
       System.Reflection.Assembly.VerifyCodeBaseDiscovery(String codeBase) +118
       System.Reflection.Assembly.get_CodeBase() +32
       System.Web.Handlers.ScriptResourceHandler.GetCodeBaseWithAssert(Assembly assembly) +31
       System.Web.Handlers.ScriptResourceHandler.GetLastWriteTime(Assembly assembly) +36
       System.Web.Handlers.ScriptResourceHandler.GetAssemblyInfoInternal(Assembly assembly) +58
       System.Web.Handlers.ScriptResourceHandler.GetAssemblyInfo(Assembly assembly) +59
       System.Web.Handlers.RuntimeScriptResourceHandler.System.Web.Handlers.IScriptResourceHandler.GetScriptResourceUrl(Assembly assembly, String resourceName, CultureInfo culture, Boolean zip, Boolean notifyScriptLoaded) +336
       System.Web.UI.ScriptManager.GetScriptResourceUrl(String resourceName, Assembly assembly) +114
       System.Web.UI.ScriptRegistrationManager.RegisterClientScriptResource(Control control, Type type, String resourceName) +115
       System.Web.UI.ScriptManager.RegisterClientScriptResource(Control control, Type type, String resourceName) +9 

    这个问题是由于SubText自带了一个1.0的Ajax Extension,在有3.5 framework的机器上需要用GAC里的那个,因为那个是full trusted的。

    所以要在Web.Config里加上:

    <configuration>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
            <bindingRedirect oldVersion="1.0.61025.0" newVersion="3.5.0.0"/>
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    </configuration>

    8. 解决了上述问题之后,网站就运行起来了!

    因为是国外的空间,速度具体还没测过,大家可以试试看:www.jinweijie.com,另外我还尝试着部署了一个应用在虚拟目录下:http://www.jinweijie.com/astreeview/astreeviewdemo/astreeviewdemo1.aspx

    总结:在GoDaddy上部署subtext是稍微有些困难的,国外很多朋友也遇到过很多的问题,主要集中在trust level和数据库发布上,所以今天记一笔,希望遇到同样问题的朋友有帮助。

    ps: 另外,借此机会向 火星人.Net 同学说声抱歉,上次可能在回复里说了一些伤到你的话 :)

  • 相关阅读:
    发现个atan2的正确使用方式
    Forward+ Shading架构
    fatal: unable to connect to gitee.com: gitee.com[0: 180.97.125.228]: errno=Unknown error 解决方案
    HDFS HA(高可用性)集群规划
    如何使用RTP引擎对语音编码进行转码
    关于 Angular 应用 tsconfig.json 中的 target 属性
    浅谈 Orbeon form builder 的权限控制
    关于 Angular 应用 tsconfig.json 中的 lib 属性
    orbeon form 通过 url 的方式同第三方应用集成的开发明细
    orbeon form 的配置介绍
  • 原文地址:https://www.cnblogs.com/jinweijie/p/deploy_subtext_on_godaddy.html
Copyright © 2011-2022 走看看