Friday, 29 October 2010

ASP .net: IIS Configure site name

Configure Web Sites by Using Host Header Names

To configure Web sites by using the Host Header Names feature, follow these steps:

  1. Click Start, point to Administrative Tools, and then click Internet Information Services.
  2. Expand * server name (where server name is the name of the server), and then expand Web Sites.

  3. Right-click the Web site that you want, and then click Properties.The Web site name Properties dialog box appears (where Web site name is the name of the Web site that you selected).

  4. Click the Web Site tab, and then in the IP Address list, select the IP address that you want assigned to this Web site.

  5. Click Advanced.

  6. Under Multiple identities for this Web Site, click the IP address, and then click Edit.The Advanced Web Site Identification dialog box appears.

  7. In the Host Header Name box, type the host header that you want. For example, type www.example1.com. Add the port number, select the IP address in the list, and then click OK.NOTE: If you want to configure this Web site with additional identities, click Add. Use the same IP address and TCP port, but enter a unique Host Header Name, and then click OK. For example, if you want to access the same Web site from both the Internet and a local intranet, you can configure the Web site identity in the manner shown in the following example:
    IP Address TCP Port Host Header Name
    192.168.0.100 80 www.example1.com
    192.168.0.100 80 example1.com

  8. In the Advanced Multiple Web Site Configuration dialog box, click OK.

  9. In the Web site name Properties dialog box, click OK.You return to the IIS window.

  10. Right-click the next Web site that you want, and then click Properties.

  11. In the IP Address list, select the same IP address that you selected in step 4, and then click Advanced.

SQL: Setting Up Data And Log Files For SQL Server

Setting Up Data And Log Files For SQL Server

When a database is created in SQL Server it creates two files by default: one is the data file with an extension of .mdf that stores the actual data, and the other is the log file with an extension of .ldf that stores the transaction log information used to recover data in disaster recovery scenarios. The mdf is the primary data file; in case of very large databases it might be useful to have secondary data files with an extension of .ndf in which case the data will be stored in both mdf as well as ndf files.
The placement of mdf, ndf and ldf files on a particular drive is a matter of decision based on the size requirements of each file, and more importantly on the impact it will have on the overall performance of the database. As the log file is write-intensive it should be placed on a separate drive and the data files also placed on separate drives of their own. Even secondary data files should be placed on a separate drives to optimize performance. Why? This is because, it increases parallelism while accessing the data and log files for read/write operations.
The log file is write-intensive, and the data file (depending on your application) is read/write intensive. Suppose you have multiple users simultaneously updating and requesting data. For data retrieval, the log file is not needed, and so the requests for data can be satisfied from the data file placed on its own drive. This would involve the movement of only the spindle of that drive on which the data file is kept. For data updates, the log file is heavily used, and so any write operations would involve the movement of the spindle of the drive on which the log file is placed. Now, if both log and data files are placed on the same drive, the amount of spindle movement would be heavy so as to satisfy both read and write operations. But, if you place the data and log files on separate disk drives, then the spindle movement for write operations won’t interfere with that of the read operations, since each drive’s spindle would be moving independently to satisfy read as well as write requests, thus improving the performance of data retrieval and data updates.

Ideally, the separation of data and log files on drives should be done while creating the database, but this can be done later also after the database is created and is in use. SQL Server is very flexible in that. The way to go about doing this is to use the two statements that SQL Server provides: CREATE DATABASE and ALTER DATABASE. Let’s look at both examples where database_name is the name of the database being created and/or altered, and os_path is the operating system file path.

While creating a database, you use the Create Database statement in the following manner:
CREATE DATABASE database_name ON
(NAME=Database_name_data,
FILENAME = ‘os_path\database_name_data.mdf’),
(NAME=Database_name_log,
FILENAME = ‘os_path\database_name_data.ldf’)


If you want to add secondary data files, the statement would be:
CREATE DATABASE database_name ON
(NAME=Database_name_data,
FILENAME = ‘os_path\database_name_data.mdf’),
(NAME=Database_name_data,
FILENAME = ‘os_path\database_name_data.ndf’),
(NAME=Database_name_log,
FILENAME = ‘os_path\database_name_data.ldf’)


If you already have a database and want to change the drive location of either the data or log file, then use the Alter Database statement in the following manner:

First, bring the database to an offline status by giving the following command:
ALTER DATABASE database_name SET OFFLINE

Next, change the location of either the data file or the log file with the following command for each file:
ALTER DATABASE database_name MODIFY FILE ( NAME = database_name_data, FILENAME = 'new_path\database_name_data.mdf' )ALTER DATABASE database_name MODIFY FILE ( NAME = database_name_data, FILENAME = 'new_path\database_name_data.ndf' )ALTER DATABASE database_name MODIFY FILE ( NAME = database_name_data, FILENAME = 'new_path\database_name_data.ldf' )
Finally, bring the database back online by issuing the following command(but before giving this command make sure you copy the data and log files to their new locations):
ALTER DATABASE database_name SET ONLINE


After this you should verify the changed locations of the files by querying the sys.master_files catalog view:

SELECT name, physical_name AS CurrentLocation, state_descFROM sys.master_files WHERE database_id = DB_ID(N'database_name');
The above procedure is valid for both SQL Server 2008 and 2005.

Wednesday, 27 October 2010

SharePoint: Fix issue with People scope returning empty

1. Go to User Profiles and props in Shared Service.
2. Select Start Full import *(make sure No of users is present).
3. Go to http://*mysite Address here*/_layouts/settings.aspx
4. Click Site Visability
5. Set the "Allow this web to appear in search results?" to true
6. check " Always index all ASPX pages on this site "
7. Then run the crawl again and thsi should work.

Wednesday, 13 October 2010

Sharepoint: Performance tuning

Common issues and resolutions:
http://technet.microsoft.com/en-us/magazine/2009.08.insidesharepoint.aspx

performance tips and tuning in configs:
http://sharepointbergen.blogspot.com/2007/07/sharepoint-2007-performance-and-tuning.html

Different caching parameters:

Enable the BlobCache in web.config to create a disk cache for all pictures, style sheets and scripts that are used => Reduced database traffic.
Consider reducing the number of application pools used to relase more memory on the server(s). Each application pool is assigned a unique worker process which again loads the runtime => More memory for caching the "real stuff" :-)
Set the correct Caching profile on each web site - from the Admin page => Quicker page loads.
Web parts and customizations

Write your web parts and custom controls and pages such that the do as little data processing as possible before the user makes an action. => Reduces the time to load a the page that are using your web part/component.
Site structure

Depth of the web site hierarchy => Content by Query and other querys will run quicker


And.....


Resolving Performance Issues
Regardless of the framework and methodology you use in trying to understand your SharePoint performance issues, isolate their root causes, and resolve the problems, you need baseline data that reflects acceptable performance against which you compare data that reflects poor performance. You can obtain a baseline set of performance data either right after your initial deployment, during periods of acceptable performance, or from best-practice recommendations. If you have no basis for comparison, then you can use Microsoft published performance recommendations for various measurements, available at technet.micro-soft.com/en-us/library/cc262787.aspx.
As I already mentioned, the most common performance issues happen as a result of interrelated components. This can be troublesome because the underlying indicators are often the same. For example, one common indicator of a performance issue is a spike in resource utilization, such as RAM, CPU, or disk I/O. To resolve the performance issue, you need to look at all available data, understand the sequence of events leading to the issue, and correlate events to determine the underlying root cause. Figure 2 shows common performance issues, possible root causes, and resolution options.
Figure 2 Issue, Cause and Resolution Summary
Issue Possible Root Causes Possible Resolutions Additional Resources
High disk I/O activity on SQL Server Large list operations, timer jobs, SQL maintenance tasks, backup, indexing, inadequate RAM, high I/O databases such as temp tlog, search, and content, placed on same disk or slow disks. Separate temp and search databases in multiple files across high I/O disk volumes, increase RAM, use dedicated disks for transaction logs, defragment, and re-index databases weekly. technet.microsoft.com/en-us/library/cc678870.aspx
msdn.microsoft.com/en-us/library/ms175527.aspx
technet.microsoft.com/en-us/library/cc263261.aspx
technet.microsoft.com/en-us/library/cc262067(TechNet.10).aspx
SQL blocking/locking NIC configuration, large list operations, indexing/crawling jobs. Do not use SharePoint Team Services Administration (STSADM). Use SQL backup, DPM, Litespeed, or SQL 2008 with compression, ensure fill factor is set to 70% on content databases, enforce 100GB growth limit. technet.microsoft.com/en-us/library/cc901593.aspx
go.microsoft.com/fwlink/?LinkID=105623&clcid=0x409
support.microsoft.com/kb/271509
support.microsoft.com/kb/298475
Overall slow page loads Compression not enabled. Caching not enabled or not configured. Large pages. Redundant SQL trips, underlying network issues. Enable caching and compression, check page load times, and examine SQL queries and round trips, check NIC for Broadcom 5708 Chimney issues. technet.microsoft.com/en-us/library/cc298550.aspx
support.microsoft.com/kb/942861
Long time to load full page Improper SharePoint object handling in custom code, slow links, SQL blocking, timer jobs, Web part caching not enabled. Resolve back-end bandwidth and response issues, dispose of objects properly, use 64-bit hardware or configure memory pool limits, delay downloading core.js. code.msdn.microsoft.com/SPDisposeCheck
technet.microsoft.com/en-us/library/cc298550.aspx
technet.microsoft.com/en-us/library/cc678870.aspx
technet.microsoft.com/en-us/library/cc298466.aspx
Poor list performance Large lists >2,000–3,000 items in a level. No indexing on lists. Underlying SQL Server issues. Too many columns. Index on one or more columns, ensure SQL Server performance, keep fewer than 2,000–3,000 items in a level. go.microsoft.com/fwlink/?LinkID=105580&clcid=0x409
Long crawl and index times or indexing causing sluggishness Large data volumes require long index times, no dedicated index target. Block with robots.txt, offload crawling/indexing to dedicated front-end server. technet.microsoft.com/en-us/library/cc261810.aspx
LDAP operations (such as authentication and user operations) causing usage spikes Low bandwidth, remote domain controller, large profile imports. Increase bandwidth, use Kerberos, optimize profile importing. support.microsoft.com/kb/827754
Backup taking too long Using STSADM, other SQL conditions such as blocking. Use Microsoft Data Protection Manager (DPM) or SQL 2008 with compression. technet.microsoft.com/en-us/library/cc901593.aspx
IIS out of memory conditions Application pool and worker process recycling, improper object handling, not enough RAM, poor load balancing architecture. Use IIS overlapped recycling, use 64-bit hardware. msdn.microsoft.com/en-us/library/aa720391(VS.71).aspx
technet.microsoft.com/en-us/library/cc737679.aspx
As you narrow down possible causes for performance issues, keep in mind general operations best practices, such as the ones documented in the IT Showcase white paper, "SharePoint Performance Optimization." Applying the latest patches, service packs, and updates for SQL Server, IIS, SharePoint, and Windows Server is especially important. Microsoft has fixed many previous performance issues, such as tempdb allocation contention (see Concurrency enhancements for the tempdb database) and TokenAndPermUserStore cache (see Queries take a longer time to finish running when the size of the TokenAndPermUserStore cache grows in SQL Server 2005).

Troubleshooting Tools
You can rely on a diverse range of tools for digging down to the specifics of a SharePoint performance issue and gathering evidence that would help you make a diagnosis, determine the root causes, and resolve the problem.
The following tools are especially helpful in pinpointing causes of performance issues:
Fiddler PowerToy and neXpert add-on Used together, these tools provide a solid starting point for page load analysis. They allow you to review caching, compression, and overall HTTP performance. You can get more information about these tools at Fiddler PowerToy - Part 2: HTTP Performance and Microsoft neXpert Performance Analysis Plugin.
WireShark When you need to look into network issues, use WireShark. It works with many media, and you can capture packets from recreated TCP/IP conversations when you recreate issues. For more information, see wireshark.org.
Visual RoundTrip Analyzer (VRTA) You can use VRTA to examine the round-trip performance from request to response. VRTA examines the communications protocol, identifying the causes of excessive round trips, and recommending solutions. You can download it from Microsoft downloads, Visual Round Trip Analyzer.
SQL Profiler You can use this useful tool, installed with SQL Server, for monitoring an instance of SQL Server Database Engine or SQL Server Analysis Services. It enables you to discover issues with queries, deadlocks, timeouts, recompilations, and general errors and exceptions.
SQLDiag This tool, also installed with SQL Server, collects valuable information about the configuration of the computer running SQL Server, the operating system, and the information that is reported to the SQL Server error logs.
SQL Query Analyzer This is a low-level debug tool for analyzing query performance issues. It also is part of the SQL Server toolset.
SPtraceview This is one of my favorite tools because it provides a view of performance issues in real time. It's useful for monitoring diagnostic tracing when working with custom Web parts. For more information, see SPTraceView – Lightweight Tool for Monitoring the SharePoint Diagnostic Logging in Real-Time.
WSSDW.exe This is a performance-testing tool that populates data for testing deployments of Office SharePoint Server 2007. See Tools for performance and capacity planning (Office SharePoint Server) and SharePoint 2007 Test Data Population Tool for more information.
Custom tool for client-based URL ping This is one of the most useful tools because it enables the comparison of statistics before and after implementing configuration changes to the environment. See the appendix on the SharePoint Performance Optimization page.

Constant Monitoring
SharePoint performance tuning, like most things SharePoint, is complex. You need to understand the object model, details about the SharePoint architecture, and the interactions between IIS/.NET and SQL Server. You also need to know database administration and troubleshooting best practices. The good news is that if you lack this understanding, you can still do well at optimizing your SharePoint infrastructure by following established best practices, recommendations, and knowledge, and addressing the common issues pointed out here.

SharePoint: Uninstalling Considerations

Uninstalling sharepoint considerations:

http://nehasinha.wordpress.com/2008/02/01/uninstalling-moss-2007-manually/

Note: Before performing these operations make sure you backup all Share Point databases and create a backup of the registry.

a) Disable and Stop the following services

-Microsoft Single Sign-on Service
-Office SharePoint Server Search
-Windows SharePoint Services Administration
-Windows SharePoint Services Search
-Windows SharePoint Services Timer
-Windows SharePoint Services Tracing
-Windows SharePoint Services VSS Writer

b) Note the following registry keys:

From HKLM\Software\Microsoft\Office Server\12.0
-Install Path (default is C:\Program Files\Microsoft Office Servers\12)

From HKLM\Software\Microsoft\Shared Tools\
Web Server Extensions\12.0
-Location (default is C:\Program Files\Common Files\Microsoft Shared
\Web Server Extensions\12)

c) Delete the following registry hives:

HKLM\Software\Microsoft\Office Server\12.0
HKLM\Software\Microsoft\Shared Tools
\Web Server Extensions\12.0

[x32] – HKLM\Software\Microsoft\Windows
\CurrentVersion\Uninstall\OSERVER
[x64] – HKLM\SOFTWARE\Wow6432Node\Microsoft
\Windows\CurrentVersion\Uninstall\OSERVER

d) Delete the following folders:
The value of the InstallPath key
The value of the Location key
C:\%CommonProgramFiles%\Microsoft Shared\SERVER12
Restart the server and perform an installation as normal.
Before running the configuration wizard, follow the steps as follows
You need to restore the Server Language registry value by
creating the following .reg file (open notepad and paste the following):

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft
\Shared Tools\Web Server Extensions\12.0 \ServerLanguage]
“1033″=”"

Sharepoint: Best practices

1. Remove spaces from site name as removes %20, etc
2. Try to keep pictures in root picture library and use path
e.g. http://portal/sysimages/email.jpg
better: /sysimages/email.jpg
3. Make sure SharePoint site added to trusted IE intranet
4. In columns don't use £@, etc use no, etc
5. Create subsite each time new information is present

SharePoint: webparts

CorasWorks Cross Site Search
http://mindsharpblogs.com/todd/archive/2005/02/14/293.html

Additiional free webparts:
http://blog.brainlitter.com/sharepoint/Lists/BestPractices/AllItems.aspx

SharePoint: Q and A

• What is SharePoint?
Portal Collaboration Software.

• What is the difference between SharePoint Portal Server and Windows SharePoint Services?
SharePoint Portal Server is the global portal offering features like global navigation and searching. Windows SharePoint Services is more content management based with document libraries and lists. You apply information to certain areas within your portal from Windows SharePoint Services or directly to portal areas.

• What is a web part zone?
Web part zones are what your web parts reside in and help categorize your web parts when designing a page.

• How is security managed in SharePoint?
Security can be handled at the machine, domain, or sharepoint level.

• How are web parts developed?
Web parts are developed in Visual Studio .Net. VS.Net offers many web part and page templates and can also be downloaded from the Microsoft site.
• What is a SharePoint farm?
Multiple machines running services for SharePoint. Otherwise known as Topology.

• What is a site definition?
It’s a methods for providing prepackaged site and list content.

• What is a template?
A template is a pre-defined set of functions or settings that can be used over time. There are many templates within SharePoint, Site Templates, Document Templates, Document Library and List Templates.

• How do you install web parts?
Web Parts should be distributed as a .CAB (cabinet) file using the MSI Installer.

• What is the difference between a site and a web?
The pages in a Web site generally cover one or more topics and are interconnected through hyperlinks. Most Web sites have a home page as their starting point. While a Web is simply a blank site with SharePoint functionality built in; meaning you have to create the site from the ground up.

• What are the differences between web part page gallery, site gallery, virtual server gallery and online gallery?
Web Part Page Gallery is the default gallery that comes installed with SharePoint. Site Gallery is specific to one site. Virtual Server gallery is specific to that virtual server and online gallery are downloadable web parts from Microsoft.

• What is the GAC?
Global Assembly Cache folder on the server hosting SharePoint. You place your assemblies there for web parts and services.

• What is a DWP?
The file extension of a web part.

• What is CAML?
Stands for Collaborative Application Markup Language and is an XML-based language that is used in Microsoft Windows SharePoint Services to define sites and lists, including, for example, fields, views, or forms, but CAML is also used to define tables in the Windows SharePoint Services database during site provisioning.

• What is a document library?
A document library is where you upload your core documents. They consist of a row and column view with links to the documents. When the document is updated so is the link on your site. You can also track metadata on your documents. Metadata would consist of document properties.

• What is a meeting workspace?
A meeting workspace is a place to store information, attendees, and tasks related to a specific meeting.

• What is a document workspace?
Document workspaces consist of information surrounding a single or multiple documents.

• What is a web part?
Web parts consist of xml queries to full SharePoint lists or document libraries. You can also develop your own web parts and web part pages.

• What is the difference between a document library and a form library?
Document libraries consist of your core documents. An example would be a word document, excel, powerpoint, visio, pdf, etc… Form libraries consist of XML forms.

• What are themes?
Themes provide a quick a easy way to change the appearance of your SharePoint site
.
• What is presence?
Allows users to see if other users are online and can send them instant messages.

• Can web parts be connected? if so, how?
Web Parts can be connected by Modifying the Shared Part and providing the connection with the correct fields to share.

• What is a personal view and what is a shared view?
Personal views are specific to a user while Shared View is common across all users.

• What is an STP file?
The file extension that applies to site templates.

• What is an FWP file?
The file extension that applies to SharePoint sites that have been backed up.

• How does SharePoint support MS Outlook integration?
Via Web Parts available at the Microsoft Web Component Directory. Oh yeah and Active X Controls.

• How can you extend lists in SharePoint?
If you mean extend by adding columns of data and have specific data types for each column the answer is yes. You can also use Data Views in FrontPage 2003 to pull in XML data from other sites, lists or document libraries to make the information more presentable for users.

• Explain the document versioning in SharePoint document libraries
When versioning is enabled everytime the document is edited from the SharePoint site it creates a new version. You can restore or delete old versions of documents. Version numbers are incremented by the system itself.

• Where are web part resources contained?
The SharePoint file system, SQL, and the GAC folder. They are also referenced in the web.config folder.

• What are the different installation methods for deploying web parts? and what are the pros/cons?
The best way is via a CAB file using the MSI Installer.

• What is a ghosted/unghosted page?
Page that is created from a template oppsed to being created from scratch.

• How is site data stored?
Site data is stored in your content database that either resides in SQL Server 2000 or MSDE.

• Where is metadata for a web stored?
In the content databases stored in SQL.

• What is an audience and describe the use?
Audiences are a pre-defined set of users that you can apply information to. You can apply information to their personal sites as well for dailey information or job tasks.

• What are the trust levels and what is the default trust associated with SharePoint?
SSL and the basic IIS security. SharePoint comes with Integrated Windows Authentication turned on.

• What are the two logging mechanisms for usage statistics?
By default creates log files in the \%windir%\system32\LogFiles\STS directory on the front-end Web server, although an alternate location can be specified. The STS directory contains a folder for each virtual server on the Web server, each named with a GUID that identifies the respective virtual server. Each virtual server folder contains subfolders for each day, which in turn contain the daily usage log for each virtual server. In addition to containing information per virtual server, the Windows SharePoint Services logs are also useful because they associate users with page hits and with time stamps. what functionality does owssup.dll provide for client side activities?

• What is STSAdm and what can it be used for?
STSADMIN is a tool that can do many things from a command prompt like manage users, create new sites and add files to the file system.

• Can WSS search subsites?
Not without the new CorasWorks Search Web Part.

• Can you register alerts for users?
Not unless you are logged in as that user.

• Are PDFs searchable?
Out of the box only the metadata collected in the upload form is search able. Unless you download and install the Adobe iFilter.

• Describe a large deployment
Many front-end webserver with a SQL cluster with the possibility of multiple international locations.

• How can you synchronize custom Active Directory attributes to SharePoint?
Via the Profile Importer.

• If it is anticipated that our organization would need to store 1 terrabyte of documents, what is the recommended configuration and storage requirement?
Multiple front-end web servers with content databases across the server farm. The amount of web-servers can depend on how many users you have and what the typical size of a document is.

• Explain how you would deploy SharePoint on an extranet
Usually servers that are accessible from external sources are housed in DMZ’s. Depending on the requirements and the workflow for publishing content you could go with Multiple Servers hosting the same information. One server would reside inside with the SQL Cluster while the external server resides in the DMZ simply calling data. Security would be handled by the same or different active directory domain clusters as well increasing security.

• What is the BKM for maximum number of virtual servers configured for SharePoint on a single box?
I believe its 15.

• what are the migration strategies for moving sites around?
You could use the SharePoint Portal Server backup and restore tool as well as the STSADMIN and GUI STSAMIN tools. We have migrated databased from the SQL Level and have simply reconnected the front end.

SharePoint: Installation Guides

Single machine instance:
http://blogs.msdn.com/b/martinkearn/archive/2007/03/28/how-to-install-sharepoint-server-2007-on-a-single-machine.aspx

Step by step installation guide:
http://www.codeproject.com/KB/sharepoint/SharePoint_Server_2010.aspx
*http://mindsharpblogs.com/bill/archive/2006/06/27/1153.html

SharePoint: Design considerations