Thursday, December 22, 2011

Configure BLOB cache for SharePoint 2010 web applications

SharePoint 2010 supports disk-based BLOB Cache that controls the caching for binary large objects. If you configure BLOB for frequently used images, audio files, video files, java script files, css files etc., the performance will be improved. BLOB cache needs to be enabled in the front end web server and once configured; the configured files will be retrieved from the database and stored in a directory under Front end web server. This reduces the network traffic/load on the database server.
You need to carefully decide whether or not to use the BLOB cache. You need to carefully decide what files need to be placed under BLOB cache. For e.g. placing documents under BLOB cache in a collaboration portal will give you negative effect as the documents will be authored by users frequently.
Consider the following points for configuring the BLOB cache.
For a publishing site for which most of the visitors are anonymous or where most of the files are static content, enable the BLOB cache for as many file types as possible.
For other sites that contain lots of media assets that are read-only, or where only a small percentage of the media assets are updated, enable the BLOB cache for media files only.
Be noted that you can have only one BLOB cache per web application. Each web front end server will have its own copy of BLOB cache. In load balancing scenarios, each web server will have its own copies and the files will be added to the blob cache individually by the front end server when it serve the file for the first time.
The BLOB cache needs to specify in the web.config for each web application. By default, the BLOB caching is disabled. Open the web.config for the web application that you need to configure the BLOB cache. Normally you find the following line in the web.config of the web application.
<BlobCache location="<location>" path="<files to be cached>" maxSize="10" enabled="true" />
Modify the following attributes
location – the path to the directory where the blob files stores in the disk.
path – specifies the condition for file names that will be included in the cache. By default SharePoint will include a regular expression that matches certain extensions. In most of the cases you just need to add/remove some extentions to the list.
maxSize – the maximum size for the cache expressed in GB, 10 GB is the default
enabled - specifies whether blob cache is enabled or not. True indicates enabled
e.g.
<BlobCache location="C:\BlobCache\14" path="\.(gif|jpg|jpeg|jpe|jfif|bmp|dib|tif|tiff|ico|png|wdp|hdp|css|js|asf|avi|flv|m4v|mov|mp3|mp4|mpeg|mpg|rm|rmvb|wma|wmv)$" maxSize="10" enabled="true" />
Flush output cache
In some situations, you need to flush the output cache. You can do this by using the following PowerShell commands
$webApp = Get-SPWebApplication "<http://your web application url>"
[Microsoft.SharePoint.Publishing.PublishingCache]::FlushBlobCache($webApp)

Wednesday, December 21, 2011

Target a Web Part to a specific audience

Web Parts in Microsoft Office SharePoint Server 2007 can be targeted to appear only to people who are members of a particular group or audience.
An audience can be identified by using a SharePoint group, a distribution list, a security group, or a global audience.
  1. On the Web page that contains the Web Part, on the Site Actions menu, click Edit Page.
  2. On the Web Part, click the Web Part menu Web Part Edit Menu, and then click Modify Shared Web Part.
  3. Under Advanced, enter one or more audience names in the Target Audiences box.
When the page is rendered, the Web Part appears only to the people who are members of the audiences that you specified.

SharePoint 2003 to MOSS 2007 Upgrade: Database migration

Database migration of all the three upgrade techniques, my favorite is database migration. Database migration can be defined as “Requires the server administrator to install the new version on a separate farm or separate hardware, and then manually migrate the databases into the new environment.”
Database Migration enables moving to new farm or new hardware while SharePoint Portal Server 2003 environment is available and is untouched by upgrade. Microsoft says that database migration is a “Complex process that requires many manual steps and a higher risk of error. Requires additional manual steps to retain original URLs for sites. Search scopes must be re-created and search settings must be reapplied. Requires new server farm, and twice the amount of SQL Server storage space”. My advise is don’t be afraid and do try.
These steps are done for upgrade from WSS2.0/SharePoint 2003 to WSS3.0/MOSS 2007 in a single form environment. For different architecture, you may need some more steps. The steps are under:
· Get ready your MOSS 2007 environment.
· Run PreScan on SharePoint Portal Server 2003.
· Set the content database of SharePoint Portal Server 2003 as read only.
· Take back up of content database of SharePoint Portal Server 2003.
· Restore back up on SQL Server attached with MOSS 2007.
· Create web application in MOSS 2007.
· Remove content database of the newly created web application in MOSS 2007.
· Attach restore database with the newly created web application in MOSS 2007.
And that’s itJ.
I am not going into the details of creating MOSS 2007 environment. We will start from the second step:
Run PreScan on SharePoint Portal Server 2003:
The first step is to run PreScan.exe. For details kindly visit the following blog:
Set the content database of SharePoint Portal Server 2003 as read only:
The content database of SharePoint Portal Server 2003 ends with 1_SITE like Abc1_SITE.
The steps for setting database as read only are:
1. In Microsoft® SQL Server™ Enterprise Manager, right-click the name of the database that you want to set to read-only, and then click Properties.
2. In the Properties dialog box, click the Options tab.
3. Under Access, select the Read-only check box, and then click OK.
For Server 2005
1. In Microsoft SQL Server Management Studio, right-click the name of the database that you want to set to read-only, and then click Properties.
2. In the left pane, click Options.
3. In the right pane, under Other options, under State, next to Database Read-Only, click the down arrow, and then select True.
Take back up of content database of SharePoint Portal Server 2003:
For details kindly visit the following blog:
Let the name of the back be “Portal_Site.bak”. Wait after this. The time of database backup depends upon the system power and database size.
Restore back up on SQL Server attached with MOSS 2007:
The first step in restoring database is to create a database in SQL Server 2005. Let the newly created database name is “Portal_Site_Restore”.
1. Expand Database “Portal_Site_Restore”, right-click the database you want to restore, point to Tasks, point to Restore, and then click Database. The Restore Database dialog box appears.
2. On the General page, the name of the restoring database appears in the To database list box.
3. In the To a point in time text box (if using SQL Server 2005 Enterprise Edition), retain the default (Most recent possible).
4. To specify the source and location of the backup sets to restore, click From device, and then specify the database backup path (in our case, it is “Portal_Site.bak”) in the list box.
5. In the Select the backup sets to restore grid, select the backup path.
6. From the options tab, select “overwrite existing database”.
7. Specify the paths for .ldf and .mdf in the options tab.
8. Click OK to start the restore process.
Wait after this. The time of restoring database depends upon the system power and database size.
Create web application in MOSS 2007
In the SharePoint Central Administration, move to “Application Management” and click on “Create or extend Web application” under “SharePoint Web Application Management”.
Again click on “Create Web application”. Set the settings according to your own needs (do check the name of the web application and content database. Let the name of the web application be “http://servername:1234” and the name of the content database be “WSS_Content_1234”) and click OK. Don’t create any site collection.
Remove content database of the newly created web application in MOSS 2007
We can do that using Central Administrator or stsadm utility. I will like to do that using stsadm. Central Administration is easy. You will be able to learn that if you know how to do it using stsadm.
The command for removing content database using stsadm is ‘deletecontentdb’. The description is as under:
stsadm.exe -o deletecontentdb
-url <URL name>
-databasename <database name>
[-databaseserver] <database server name>
Parameter name
Value
Required?
Description
url
A valid URL, such as http://serverame:1234
Yes
Specifies the Web application from which the content database will be detached.
databasename
A valid database name, such as “WSS_Content_1234”
Yes
Specifies the name of content database to be detached.
databaseserver
A valid database server, such as “SQLServer1″
No
Database server name to be detached.
A typical command will be like:
stsadm.exe -o deletecontentdb -databasename WSS_Content_1234 -url http://servername:1234
Attach restore database with the newly created web application in MOSS 2007
We can do that using Central Administrator or stsadm utility. I will like to do that using stsadm. Central Administration is easy. You will be able to learn that if you know how to do it using stsadm.
The command for removing content database using stsadm is ‘addcontentdb’. The description is as under:
stsadm.exe -o addcontentdb
-url <URL name>
-databasename <database name>
[-databaseserver <database server name>]
[-databaseuser <database username>]
[-databasepassword <database password>]
[-sitewarning <site warning count>]
[-sitemax <site max count>]
Parameter name
Value
Required?
Description
url
A valid URL
Yes
URL of
the Web
application
to which
the content
database is
being
added.
databasename
A valid
database name
Yes
Database
name.
databaseserver
A valid
database
server name
No
Database
server
name. The
default
server
is used
if a
value
not
provided.
databaseuser
A valid user
name in the
form “domain\login”
No
Account
used for
SQL authentication. Must be
used in
conjunction
with the
database
password parameter.
databasepassword
A valid
SQL
password
No
The database
password parameter should only
be used
where Windows authentication is not
implemented.
sitewarning
A valid
integer
number,
such as
10
No
Integer number
of site
collections allowed in
the content
database
prior to
generating
a warning
event in the
Windows event log.
sitemax
A valid
integer
number,
such as
10
No
Specifies
the maximum
number of site collections allowed in
the content
database.
A typical command will be like:
stsadm.exe -o addcontentdb -url http://servername:1234 –databasename Portal_Site_Restore
Wait after this command. The time of adding content database depends upon the system power and database size.
 

Monday, December 12, 2011

Diff between WFE,applicationserver,database server in Sharepoint

---------------------------------------------------------------------------------
WFE Role hosts sharepoint site and handle user requests,
Database Role hosts and manage Sharepoint databases,
Application Role can host some services like Excel, Forms ...etc

----------------------------------------------------------------------------------
WFE /Web Front end server serves the web sites to the users. These servers hosts the IIS applications and servers the pages.
Application Server is a server provisioned for serving applications like Infopath forms services, Excel services etc
Database server is the Server having Microsoft SQL server installed and holds the databases for sharepoint.

The Web Front end Server is the server that is hosting IIS and serves the websites.
An Application Server  has services on it, for example, like Excel services, Project server, etc..
A database server simply hosts the SharePoint core db's and the other Content databases.. It just has SQL Server installation on it.

So you have to install Sharepoint to WFE's and App. Servers.. You dont need to install Sharepoint to the database servers on your farms.

Microsoft SQL Server 2008 Reporting Services Add-in for Microsoft SharePoint Technologies

Microsoft SQL Server 2008 Reporting Services Add-in for Microsoft SharePoint Technologies

http://www.microsoft.com/download/en/details.aspx?id=9437

Microsoft SQL Server 2005 Reporting Services Add-in for Microsoft SharePoint Technologies

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=1848

Tuesday, December 6, 2011

Adding an extra index server

OK, so Microsoft tell us SharePoint is higly scalable and although that is true, the indexing role is not scalable and cannot per se be made high available. When using multiple query servers you can obtain some high-availability since the popagated index is still available and is thus searchable. You loose the ability to index new content, though.
I want to be able to spread the load by using one index server index the MOSS farm, another to index file shares, yet another to idex Lotus Notes and so on.
Here’s how that can be done:
  1. First, add the extra server as described here (Windows Server 2003 R2) or here (Windows Server 2008 )
  2. From Central Administration -> Operations -> Services on Server select the new index server and Custom
  3. Stop Windows SharePoint Services Incoming E-Mail and  Windows SharePoint Services Web Application
  4. Start Office SharePoint Server Search. Select Use this server for indexing content, enter username and password and start the service
  5. Start Windows SharePoint Services Search.  Enter the appropriate information and start the service.  
Create a new SSP to use for search
  1. From Shared Services Administration choose New SSP
  2. Name the SSP and click Create a new Web application
  3. Create the Web App with your preferred settings (port number, user name/password, database name etc) and click OK
  4. Back in New Shared Services Provider create a new Web App for MySites or use the newly created Web App if you wnat. I choose to use the newly created Web App, although it may not be best practices.
  5. Put in your credentials and database names
  6. Remeber to specify the newly added index server as the Index Server for the SSP. Now reate the SSP by clicking OK. You may see a warning if you didn’t create a seperate MySite Web App for this SSP
  7. That’s basically it. You can now use the new SSP’s Administration Page to configure Search or any other SSP-related functionality.

Adding an extra server to an existing SharePoint farm – Windows Server 2008

Step 1: Install and prepare the server
  1. Install your favorite flavour of Windows Server 2008 (x86/x64, Standard/Enterprise)
  2. Change administrator password at the initial login
  3. In Server Manager set time zone, IP-address, and domain member ship. Reboot if needed.
  4. Still in Server Manager, enable automatic updating and feedback if you feel like it.
  5. It is always a good idea to Download and install updates.
  6. Now, let’s add the IIS Role:
    • Select Add Roles
    • Click Next
    • Add the Web Server (IIS)-role
    • Add Required Features
    • Click Next three times
    • Click Install be begin the installation
    • Click Close once completed
  7. Time to add the -Net Framework 3.0:
    • Click Add Feature
    • Select the .Net Framework 3.0 Features
    • Add the Required Role Services
    • Click Next three times
    • Click Install be begin the installation
    • Click Close once completed
  8. Close Server Manager
  9. Add the MOSS installation account to the local administrators group
Step 2: Slipstreaming MOSS installation files
Why not have the MOSS/WSS service packs applied automatically  when installing the new server? I recommend using the slipstreaming method described here. However, if you plan to add the server to a farm that is not on SP1 yet, slipstreaming is not recommended!
Step 3: Installing MOSS 2007
  1. Install using the MOSS installation account
  2. Start the MOSS installation by running setup.exe in the x86 or x64 directory depending on your architecture 
  3. Enter your license key and accept the license agreement
  4. Select Advanced and Complete install
  5. Run the SharePoint Product and Technologies Configuration Wizard
  6. Connect to an existing farm
  7. Enter the MOSS database server end click Retrieve Database Names. The Database Name and User Name fields are automatically populated. Enter the password and click Next
  8. In Advanced Setting make sure that this server will not host the Central Administration site and click Next
  9. In Central Administration navigate to Operations and use Servers in farm to verify it was indeed added to the farm and that theVersion match the other servers.
  10. That’s it. All that remains is to configure the new server for the purpose it is intended (Web Front-end, indexing etc)

Wednesday, November 30, 2011

Configuring a SharePoint website to allow SSL connections

This is the second in a series of posts on securing mixed SSL sites in SharePoint. This post will cover how to configure a SharePoint forms based web application to allow SSL/HTTPS connections. The process involves setting up an SSL certificate and configuring IIS and SharePoint to allow requests over HTTPS.
The following steps assume that you have a SharePoint web application already set up using forms based authentication. If you need details on how to do this see the article on Technet titled “Forms Authentication in SharePoint Products and Technologies”. We will be using IIS 7 in this example but a similar process can be followed using IIS 6 using the SelfSSL utility. As mentioned in the previous article this will differ if you are using off-box SSL termination and/or already have a registered SSL certificate.

Architectural overview

The following diagram shows the logical architecture for the setup that will be covered. The default web application is configured at www.company.com and uses forms based authentication with a SQL database to store membership and role information. This web application allows anonymous access and is exposed to the public over the internet. The default web application has been extended onto a second IIS web site at author.company.com that is configured to use Windows authentication. This is a simple configuration that allows internal users to enter content on a separate site that is not available externally. Other configurations are possible (including using content deployment) but aren’t in the scope of this article.
sharepoint-fba-ssl-architecture
The first step we will cover is shown on the right of the diagram and involves adding an additional binding to the www.company.com web site in IIS and adding an alternate access mapping to the web application in SharePoint.

Associate an SSL certificate with the IIS website

On a production environment you will obviously need to purchase a SSL certificate for the domain that you wish to secure but on a development environment an easy way to mimic this is to create a self signed certificate.
Create a new Self Signed Certificate for the existing web application
1. Click on the root node in IIS 7 Manager and select the “Server Certificates” icon in the feature pane on the right:
clip_image002
2. Click the “Create Self-Signed Certificate…” link on the right hand side of the page
clip_image004
3. Enter a name (I’m using www.company.com in this example) and click OK. You should see your certificate appear in the list of server certificates.
clip_image006
4. Select the IIS site that is running the SharePoint application and click on the “Bindings…” link on the right hand side of the page
5. To enable SSL click “Add”, select “https” and select the SSL certificate we created earlier:
clip_image007
6. Click OK. At this point we have configured IIS to allow connections to this site over SSL but we need to let SharePoint know to map these requests to the correct web application.

Configure SharePoint to accept requests over HTTPS

7. Navigate to Central Administration > Operations, select “Alternate Access Mappings” and click “Edit Public URL’s”
clip_image009
8. Select the Alternate Access Mapping Collection for the FBA web application and enter the relevant HTTPS address (e.g. My FBA site is located at http://www.company.com as an example so I would enter https://www.company.com). It is up to you which Zone you put the URL in as this doesn’t affect anything and is just there to help you remember what they are each used for.
clip_image011
9. That’s it! You should now be able to browse to your site using SSL. If you are using a self signed certificate you will first be presented with a certificate warning so click on the “Continue to this website (not recommended)” link and your site will be displayed.
clip_image013clip_image015
Now we can browse to our site over HTTP and HTTPS but will need to do some more work to ensure that the right protocol is used for each page. We need to ensure that pages displaying or sending sensitive information like passwords and/or address details are delivered over HTTPS, but pages such as the homepage are delivered via HTTP to avoid the additional processing encrypting and decrypting these non-sensitive pages.

Additional Resources:

How to Configure SSL Certificate for the Central Administration Web Site of SharePoint Server 2010

Introduction

In this article, I will explain how to install and configure self-signed SSL certificate for the central administration web site in SharePoint Server 2010. This procedure is also applicable for any other web applications for both SharePoint 2007 and SharePoint 2010.
Follow the steps below to configure SSL certificate for central administration web site:

Create Self-Signed SSL Certificate

  1. Log into the web server by using the SharePoint Set up account.
  2. Open IIS Manager. Click on the IIS Server and then double click Server Certificates.
  3. Click Create Self-Signed Certificate link as shown in the figure below:
  4. Enter the name of the SSL certificate that you want to associate with the central administration web site.
  5. SSL certificate is created.

Bind Self-Signed SSL Certificate with the Central Administration Web Site

  1. Right-click Central Administration web site. On the context menu, click Edit Bindings.
  2. A windows dialogue box will appear.
  3. Click Add to create a new binding for central administration web site.
  4. On the Add Site Binding window, select https from the Type dropdown and select SSL certificate from SSL certificate dropdown. Click OK to save changes.
  5. Click Remove button to remove default http binding as shown in the figure below:
  6. Now we have only https binding left for the central administration web site.

Update SSL Settings for the Central Administration Web Site

  1. Select SharePoint Central Administration v4. Double-click SSL Settings to open SSL Settings page.
  2. Configure the following options and click Apply to save settings.
    • Require SSL (checked)
    • Require 128-bit SSL (checked)
    • Client certificate: Ignore (selected)

Execute STSADM Command to Update Registry Settings on the SharePoint Farm

  1. Open command prompt and execute the following statement:
    STSADM -o setadminport -port 443 -ssl
  2. Now open SharePoint Central Administration Website.
  3. As you see in the screenshot above, Internet Explorer is showing SSL certificate error. Now to browse to alternate access mapping page and specify fully qualified domain name for the central administration web site. i.e. ServerName.DomainName. Once the alternate access mapping settings are updated, close your browser and open the central administration web site again.
I do hope that you will find this article useful, when using SSL certificate for the SharePoint web applications. Please leave your valuable comments.