2010年3月31日

记一次向MOSS服务器场中添加一台机器的经过

我有一个MOSS的服务器场, service pack的版本已经打到了SP2. 现在我多了一台机器, 于是我想把这台机器加入到MOSS的场中, 以便增强一下性能.

 

首先面临的问题就是安装.

原则上来说, 应该使用split stream的安装方式. 即: 把现有服务器场上安装了的所有的service pack, hot fix都解压, 然后按照它们发布的顺序依次拷贝到Updates文件夹下面.

这样做, 就创建出来了一个带有完整补丁的安装源了. 在新机器上用这样的源安装, 然后就可以加入服务器场了.

 

我比较懒, 没有这样做. 所以, 就遇到了问题. 安装了RTM版的MOSS之后, 新服务器会运行Configuration Wizard, 这里会报错, 因为RTM的机器是无法加入到SP2的服务器场中的.

 

MOSS的安装分两步走, 第一步是安装部署二进制文件, 第二步是configuration wizard. 那, 第二步的成功以第一步为前提. 那么如果我们只安装service pack, 一直不运行wizard, 是不是也可以最后让服务器成功地加入到sp2的服务器场中呢?

 

于是我尝试出了这第二种安装方式.

1. 在新服务器上安装RTM版的MOSS, 注意安装结束之后, 不要运行wizard, 退出弹出的wizard.

2. 安装service pack.

3. 安装完所有的service pack后, 加入服务器场.

4. 成功.

 

呵呵.

posted @ 2010-03-31 23:00 中道学友 阅读(84) 评论(0) 编辑

查看SharePoint 2007中站点的存储空间和配额

今天一个朋友问起我, 如何查看它的站点的空间使用情况.

 

首先, 你需要在管理中心中给站点指定一个配额(Quota).

 

1. 在管理中心中先建立一个quota template.

2. 点击Site collection quotas and locks. 选中一个site collection.

3. 给这个站点集指定一个quota template.

4. 然后在站点集的网站设置页面中, 就可以看到如下的链接: Storage space allocation出现了.

SiteSettingsStorageSpaceAllocation

5. 点击这个链接, 你就可以进入下面的页面, 查看站点集内的任何文档库, 列表, 和文档的大小了.

StorageSpaceAllocation

通过代码, 你也可以得到相同的结果, 代码如下:

    SPSite oSite = new SPSite("http://blr3r7-19c:13774/sites/testwp");
    DataTable oDtRawData = null;

    // this line of code will return the stroage information of all the document lirbaries in this site
    oDtRawData = oSite.StorageManagementInformation(
        SPSite.StorageManagementInformationType.DocumentLibrary, 
        SPSite.StorageManagementSortOrder.Increasing, 
        SPSite.StorageManagementSortedOn.Size, 100);

    // this line of code will return the stroage information of all the lists in this site
    oDtRawData = oSite.StorageManagementInformation(
        SPSite.StorageManagementInformationType.List, 
        SPSite.StorageManagementSortOrder.Increasing, 
        SPSite.StorageManagementSortedOn.Size, 100);

    // this line of code will return the stroage information of all the Documents in this site
    oDtRawData = oSite.StorageManagementInformation(
        SPSite.StorageManagementInformationType.Document, 
        SPSite.StorageManagementSortOrder.Increasing, 
        SPSite.StorageManagementSortedOn.Size, 100);

    // if you wan to see column names, loop through all the columns and find out the names and grab the needed one. 
    foreach (DataColumn oColumn in oDtRawData.Columns)
    {
        Console.WriteLine(oColumn.ColumnName);
    }
    Console.ReadLine();

    // loop through all the rows and find out the values. Here the size will be return in bytes (size/1024 = size in KBs)
    foreach (DataRow oRow in oDtRawData.Rows)
    {
        Console.WriteLine(oRow["Title"].ToString() + " : " + oRow["Size"].ToString() + " : " + oRow["LeafName"].ToString());
    }
    Console.ReadLine();
}

 

第二种方法, 使用stsadm命令: stsadm -o enumsites -url http://testserver/

输出结果举例:

<Sites Count="1">
  <Site Url="http://testserver" Owner="domain\mossadmin" ContentDatabase="WSS_
Content_80" StorageUsedMB="8.9" StorageWarningMB="150" StorageMaxMB="200" /
>
</Sites>

 

第三种方法, 使用Object Model.

string siteCollectionURL = "http://testserver/"; // Site Collection URL
SPSiteAdministration st = new SPSiteAdministration(siteCollectionURL);
float scDiskUsage = st.DiskUsed;
float a = (scDiskUsage / (1024 * 1024));

 

注意: 这里得到的全部都是站点集的大小.

 

如何得到子站点的大小呢?

======================

方法是使用Object Model, 代码如下:

public void GetSubSiteSize()
{
    string siteCollectionURL = ""; // Site Collection URL
    SPSite oSPSite = new SPSite(siteCollectionURL);
    SPWeb oSPWeb = oSPSite.RootWeb;
    float totalSiteDiskUsage = GetWebSize(oSPWeb);
    string filePath = @"C:\MyFile.txt"; // File Path
    FileStream sb = new FileStream(filePath, FileMode.Create);
    StreamWriter sw = new StreamWriter(sb);
    sw.Write(str);
    sw.Close();
}

private float GetWebSize(SPWeb web)
{
    float total = 0;
    foreach (SPFolder folder in web.Folders)
    {
        total += GetFolderSize(folder);
    }
    
    foreach (SPWeb subweb in web.Webs)
    {
        total += GetWebSize(subweb);
        subweb.Dispose();
    }

    if (!web.IsRootWeb)
    {
        str += "Site url : " + web.Url + "\r\n";
        str += "Size : " + (total / (1024 * 1024)) + " MB" + "\r\n";
        str += "\r\n";
    }
    return total;
}

private float GetFolderSize(SPFolder folder)
{
    float folderSize = 0;

    foreach (SPFile file in folder.Files)
    {
        folderSize += file.Length;
    }

    foreach (SPFolder subfolder in folder.SubFolders)
    {
        folderSize += GetFolderSize(subfolder);
    }

    return folderSize;
}

 

参考资料:

Check quota data for a site

http://office.microsoft.com/en-us/sharepointtechnology/HA101577661033.aspx

SharePoint Quota Management

http://nextconnect.blogspot.com/2009/06/sharepoint-quota-management.html

STSADM EnumSites Operation Reports Actual Site Storage space as ZERO for an actively used site

http://www.sharepointdev.net/sharepoint--setup-upgrade-administration-operation/stsadm-enumsites-operation-reports-actual-site-storage-space-as-zero-for-an-actively-used-site-2280.shtml

SharePoint Site Size?

http://social.technet.microsoft.com/Forums/en/sharepointadmin/thread/8fd798ac-e60f-471c-ae5f-523393360cf8

WSS - How to get site size? Site collection site? Workspace site? - WSS

http://social.technet.microsoft.com/Forums/en-US/sharepointgeneral/thread/a2e84703-2be2-488d-84f5-d6f287de621d

How to find out the storage space allocation details a site through code.

http://blogs.msdn.com/sowmyancs/archive/2008/11/15/how-to-find-out-the-storage-space-allocation-details-a-site-through-code.aspx

posted @ 2010-03-31 22:00 中道学友 阅读(297) 评论(0) 编辑

WFE与Index服务器之前的通讯

在WFE上打开SSP的搜索配置页面, 可以查看爬网等与搜索相关的状态. 我们知道, WFE只是一个WEB前端, 其上并没有运行着MOSS的搜索组件, 显然, 要显示它所不知道的组件的状态, 它需要到运行着这个组件的地方去捞取数据, 然后显示给用户.

 

运行着搜索的重要组件就是Index角色的服务器. WFE是如何获取Index服务器上的爬网等信息的呢?

 

答案是WebService.

 

在Index服务器上, 可以找到名为Office Server Web Services的站点. 其中有每个SSP的search, excel services的web service入口.

IISSharedServicves

WFE就是通过这个站点暴露出来的web service来查询爬网, scope, content source等信息的.

 

注意, WFE和Index服务器之间的通讯是使用HTTPS的. 这就是为什么在这个站点上, 你会看到两个访问方式.

 3-30-2010 10-49-34 AM

 

下面的KB里描述了如果安装.net 3.5 sp1导致HTTPS的证书崩溃的解决方案. 使用的工具是SelfSSL.exe.

 

关于这个工具的简介如下:

SelfSSL version 1.0 is a command-line executable tool that you can use to generate and install a self-signed Secure Sockets Layer (SSL) certificate for Internet Information Services (IIS) 6.0. Because SelfSSL generates a self-signed certificate that does not originate from a commonly trusted source, the tool's usefulness is limited to two specific scenarios:

 

  • When you need to create a secure private channel between your server and a limited, known group of users, such as exists in a software test environment. To establish this channel, send a copy of your certificate to clients that will use the Web site, so that the clients can add your SelfSSL-generated certificate to the list of trusted certificates.
  • When you need to troubleshoot third-party certificate problems. If you run SelfSSL and successfully generate and install a certificate on IIS, then you know that IIS is functioning properly. In such a case, you might want to contact the third-party certificate issuer.
  •  

    参考资料

    =========

    SharePoint Ports, Proxies and Protocols .... Search Communication

    http://blogs.msdn.com/uksharepoint/archive/2009/01/12/ports-protocols-and-proxies-part-2-search-communication.aspx

    SharePoint 2007 and EventID 6482 - Application Server Administration job failed for service instance Microsoft.Office.Server.Search.Administration. SearchServiceInstance

    http://andreasglaser.net/post/2009/09/13/SharePoint-2007-and-EventID-6482-Application-Server-Administration-job-failed-for-service-instance-MicrosoftOfficeServerSearchAdministrationSearchServiceInstance.aspx

    You cannot browse to an SSL-secured Office SharePoint Server 2007 site or to the Search Settings page for a Shared Services Provider

    http://support.microsoft.com/kb/962928

    posted @ 2010-03-31 17:32 中道学友 阅读(65) 评论(0) 编辑

    HTTPS 简介

    Https的全称是Hypertext Transfer Protocol Secure, 它是Hypertext Transfer Protocol 协议与SSL/TLS 协议的结合, 用来提供加密和对服务器的安全验证.

     

    Https连接常被使用在World Wide Web.

     

    Https的主要思想是在不安全的网络上建立安全的通道, 从而确保偷听攻击和中间者攻击无效.

     

    Https使用的协议使用https://, 并且默认使用端口443.

     

    严格的说, https并不是一个单独的协议, 它是在encrypted Secure Sockets Layer (SSL)或Transport Layer Security (TLS) 连接之上的对HTTP的使用.

     

    服务器端设置

    ============

    为了让一台web 服务器能够接受https的连接, 管理员必须为web服务器创建一个公钥证书(public key certificate). 这个证书必须被一个受信任的证书颁发机构签名, 这样浏览器才能接受它. 这个机构证明持有证书的站点确实就是它声称的站点. 浏览器在发布之前就预带了一些由主要的证书颁发机构签名了的证书, 这样浏览器们就可以分辨由他们签名的证书了.

     

    获取证书

    ============

    权威机构签名的证书有收费的也有不收费的.

    有些机构组织也许也运行着他们自己的证书颁发机构.

     

    证书的种类

    ============

    证书分为两类:

    • CA certificates
    • Entity certificates

    CA certificate分为三类

    • cross-certificates: 发行机构和使用人不是一个实体.
    • self-issued certificates: 发行机构和使用人是一个实体.
    • self-signed certificates: 是self-issued certificates的一种, 其中的数字签名可以被证书中带有的公有密钥来验证.

    参考资料

    ===============

    Understanding Self-Issued Certificate

    http://blogs.sun.com/xuelei/entry/undertanding_self_issued_certificate

    HTTP Secure

    http://en.wikipedia.org/wiki/HTTP_Secure

    posted @ 2010-03-31 15:58 中道学友 阅读(43) 评论(0) 编辑

    技术追求准确,态度积极向上