from:http://sharepointchick.com/archive/2012/07/29/setting-up-your-app-domain-for-sharepoint-2013.aspx

The most important change in SharePoint 2013 for developers is the introduction of SharePoint apps. An app for SharePoint is a small and isolated application that provides a specific bit of functionality. SharePoint apps can and have to be added to or removed from a site by the site owner.  Apps have their own, isolated URLs, which are separate from the URLs of the sites where the app is being deployed to and where the app is being used. In order to provide isolation apps run in their own domain, instead of in the same domain name as your farm. Using a different domain name for apps helps prevent cross-site scripting between apps and SharePoint sites.
Each installation of an app has its own unique URL within the app domain. The app’s URL is based on a template “http://[app prefix][app hash].[app domain]/[relative site url]/[app name]. When you add an app to a site, a subweb of that site is created to host the app content. This subweb is not visible on the Site Contents page though.

Because apps run in their own app domain you will have to configure Domain Name Services (DNS) in your environment in order to be able to host apps. There is a page on TechNet that describes how to setup you DNS, but because it took me a while to get it all working I decided to write a step by step guide, which is what you’re reading now.

You can choose whether you want your app domain to be a subdomain of the domain that hosts the SharePoint environment (option B), or whether you want to create a completely new domain for your apps (option A). Creating a new domain specifically to host your apps in is a bit more secure, but it also requires a little bit more configuration. I will describe both approaches in this article. If you don’t have control over your DNS you will have to ask an administrator to perform these steps for you.

Option A: Create a new domain to host your apps in

  • Go to “Start”
  • Click on “Administrative Tools”
  • Select “DNS”

  • Right click “Forward Lookup Zones” and select “New Zone…”
  • Click “Next”
  • Keep the default and click “Next” again
  • In most cases, especially if your development server is in it’s own domain you can use the default on the next tab again and can just click “Next”
  • You now have to specify a zone name. It’s up to you what you choose here. My domain name is “solutions.com” and for my app domain I will use “solutionapps.com”
  • Click “Next”

  • Click “Next”
  • Click “Finish”

  • Right click on your new zone and select “New Alias (CNAME)…”
  • Fill in a * for “Alias name (uses parent domain if left blank)”
  • Click “Browse”
  • Double click on your server name
  • Double click “Forward Lookup Zones”
  • Double click the domain of your SharePoint environment. In my case this is “solutions.com”.
  • Select “(Same as parent folder)” and click “OK”
  • Click “OK”.

* Note that selecting the FQDN of the domain in here will only work in single server scenarios. If you are using more than one server you should be pointing to the DNS record of the web server in here. This is either the DNS A record for the web server, or the DNS record of the primary cluster address for NLB environments.

  • You are now done setting up your DNS and it should look like this:

Option B: Create a subdomain to host your apps in

  • Go to “Start”
  • Click on “Administrative Tools”
  • Select “DNS”

  • Right click on the name of your domain and select “New Alias (CNAME)…”
  • Fill in “*.app” for “Alias name (uses parent domain if left blank)”
  • Click “Browse”
  • Double click on your server name
  • Double click “Forward Lookup Zones”
  • Double click the domain of your SharePoint environment. In my case this is “solutions.com”
  • Select “(Same as parent folder)” and click “OK”
  • Click “OK”

* Note that selecting the FQDN of the domain in here will only work in single server scenarios. If you are using more than one server you should be pointing to the DNS record of the web server in here. This is either the DNS A record for the web server, or the DNS record of the primary cluster address for NLB environments.

  • You are now done setting up your DNS and it should look like this:

Configuring SharePoint

I’m assuming you already created an App Management and a Subscription Settings Service Application and that you already started the App Management and Subscription Settings services on your servers. If not this MSDN article will tell you how to. Note that you have to use PowerShell to create the Subscription Settings Service Application. There is no user interface for it.

  • Go to Central Administration
  • Click on “Apps” in the left side navigation
  • Click “Configure App URLs”
  • Fill in the URL of the app domain that you configured. If you choose to use Option A the url will be something like “solutionapps.com”, if you choose to use Option B it will look like app.solutions.com.
  • Fill in an app prefix. This can be anything you like, although it is best to keep this short. I used “app” myself.

Two example urls for two different apps on the same site are:
http://app-fef8493a3feb20.solutionapps.com/sites/apptest/[App1AppName]/Pages/Home.aspx
http://app-fef8493a3feb1d.solutionapps.com/sites/apptest/[App2AppName]/Pages/Default.aspx
As you can see both apps have their own app hash, but both are in the same domain.

Beware of host headers

You are now ready to deploy your apps. Because of all this extra domain stuff though there are a few things you should know about your web applications and site collections.
If you are using a host header for your web application apps won’t just work for that web application. Because of how the redirect for the app domain works IIS will try to resolve the app url by using the default IIS web site, which of course doesn’t work. If you want to use host headers for your web applications you have to create an extra web application that is listening on port 80 (or 443 if you are using https) and that doesn’t have a host header.
This means that you have to create a web application like you normally would. You have to make sure that you select port 80 (or 443 if you are using https) and you should not fill in a host header. Note that you have to stop the Default Web Site in IIS in order to be able to do this. The web application will use the server name as its url. The web application can be empty except for a root site collection.

Another option is to use web applications without host headers and to create Host Header Site Collections. Be aware that Host Header Site Collections cannot be created via the user interface, they can only be created by using PowerShell.

Setting up your App domain for SharePoint 2013的更多相关文章

  1. BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第2章节--SharePoint 2013 App 模型概览 SharePoint 2013 App 模型

    BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第2章节--SharePoint 2013 App 模型概览 SharePoint 2013 App 模型 你能够通过两个 ...

  2. [Forward]Visual Guide: Setting up My Sites in SharePoint 2013

    from  http://blog.sharedove.com/adisjugo/index.php/2012/07/25/visual-guide-setting-up-my-sites-in-sh ...

  3. SharePoint 2013 APP 开发示例 系列

    SharePoint 2013 APP 安全: SharePoint 2013 APP 开发示例 (一)List 读写 SharePoint 2013 APP 开发示例 (二)获取用户信息 Share ...

  4. BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第1章节--SharePoint 2013 介绍 处理开发者需求

    BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第1章节--SharePoint 2013 介绍 处理开发者需求         SharePoint本质上是一个平台.你 ...

  5. SharePoint 2013 - App Domain Configuration

    1. 首先,在DNS服务器上创建app domain,建议使用一个新domain,而不是当前domain的 sub domain,参考此文章的 Option A: Create a new domai ...

  6. SharePoint 2013 搭建app本地开发环境

    使用SharePoint App,如果要通过应用程序目录分发 SharePoint 相关应用程序,如具有完全控制权限的 SharePoint 相关应用程序(无法部署到 Office 365 网站),则 ...

  7. "此站点已经禁用应用程序"在sharepoint 2013中通过v2013部署app提示该错误

    该错误的原文是:the apps are disabled in this site 可以在yahoo或者bing上搜索这个错误,可以找到解决办法: msdn上也有该错误解决办法,但是如果搜索中文,目 ...

  8. Install SharePoint 2013 on Windows Server 2012 without a domain

    Any setup of Team Foundation Server is not complete until you have at least tried t work with ShareP ...

  9. SharePoint 2013 APP 开发示例 (四)JQuery访问REST

    这个示例里,我们将用JQuery AJAX去发送一个 REST请求,并查看返回结果.为了让我们更好地理解REST 接口,我们将添加一个输入框让用户可以指定REST的URL, 这将让我们尝试着用构造的U ...

随机推荐

  1. Windows 服务开发框架介绍 - Topshelf

    关于 TopShelf Topshelfis a framework for hosting services written using the .NET framework. The creati ...

  2. sqlserver -- 学习笔记(三)解决php连接sqlserver2005视图时显示“异类查询要求为连接设置 ANSI_NULLS 和 ANSI_WARNINGS 选项”的问题

    --php5.2 --sqlserver2005 php连接sqlserver的视图aa,语句如下: $query = mssql_query("select * from dbo.aa&q ...

  3. 关于VSTO调用Excel后进程无法退出的解决方案:

    VSTO的Excel对象模型提供了托管代码对Excel的操作.但是它的实现时通过RCW(Runtime Com Wrapper)实现的,所以无法完全按照托管代码的运行方式操作.COM的资源释放时通过引 ...

  4. Gulp:新一代前端构建利器

    1.什么是Gulp gulp.js 是一种基于流的,代码优于配置的新一代构建工具. Gulp 和 Grunt 类似.但相比于 Grunt 的频繁的 IO 操作,Gulp 的流操作,能更快地完成构建. ...

  5. 斜堆(三)之 Java的实现

    概要 前面分别通过C和C++实现了斜堆,本章给出斜堆的Java版本.还是那句老话,三种实现的原理一样,择其一了解即可. 目录1. 斜堆的介绍2. 斜堆的基本操作3. 斜堆的Java实现(完整源码)4. ...

  6. 15套漂亮的 PSD 格式的图标,不一样的视觉效果

    在 Web 设计领域,图标发挥非常重要的作用,因为美丽的和创造性的图标集可以很容易地使网页设计更有吸引力.网页设计设计师专注于每一个领域的设计,包括颜色选择.图标.创造力.混色等.正确的选择图标可以使 ...

  7. 【转】sql server开启全文索引方法

    利用系统存储过程创建全文索引的具体步骤: 1) 启动数据库的全文处理功能 (sp_fulltext_database) 2) 建立全文目录 (sp_fulltext_catalog) 3) 在全文目录 ...

  8. Java魔法堂:打包知识点之jar

    一.前言    通过eclipse导出jar包十分方便快捷,但作为码农岂能满足GUI的便捷呢?所以一起来CLI吧! 二.JAR包 JAR包是基于ZIP文件格式,用于将多个.java文件和各种资源文件, ...

  9. 软件测试之黑盒测试:打着手电寻找bug

    功能测试,简单的理解就是黑盒测试,就是检测黑盒子,找到里面存在的缺陷. 功能测试新人学习计划: 1. 对于产品的学习---站在客户的角度学习产品.看待问题 测试人员不是简单地按照开发人员的设计文档去撰 ...

  10. 快速暴力解决Eclipse ADT和Android Studio兼容问题,创建同时兼容ADT和AS的安卓工程

    环境:AS 2.1.2+Java1.7+Gradle 2.14+ADT 24.0.2+MyEclipse 2015 前言:因为比赛要求使用ADT,而我本身比较习惯使用AS开发,遂想办法打造兼容两个ID ...