Sunday, September 21, 2014

ConfigureSharePoint APPS on Premise

How to configure the environment to develop SharePoint 2013 APPS on Premise

Hello everybody,
Today I very happy to post this article. I think it is very useful for all of you who want to research in SharePoint 2013 APPS. Step by step to Setup SharePoint Server 2013 and Configure APPS.

Requirement:
Win server 2012; Active Directory; SQL Server 2012; SharePoint Server 2013; Visual studio 2013.

Steps to do

We have 4 parts:
Create 2 account spfarmadmin and spinstaller and add them to Administrator group and local group and create domain in DNS
Setup SharePoint 2013
Create services application and configure APPS
Adding Apps from SharePoint Store
Adding Apps from Visual studio

Create 2 account spfarmadmin and spinstaller and add them to Administrator group and local group and create domain in DNS


The most important isn’t use Administrator to setup or configure anything on server. So I create new user is spfarmadmin and spinstaller then add it to Administrator group.
Configuring DNS: Find DNS and open it
Expand DNS > DELL6530 > Right click to Forward Lookup … >> New Zone
Next
Keep default and click next
Input Zone name: dellApps.com (my domain: dell.com) then click next
Keep default or choose “Do not allow …” then click next
Click on Finish
Right click dellApps.com > New Alias (CNAME)
Alias name: *
Fully qualified domain name (FQDN): keep default
Fully qualified domain name (FQDN) for target host: click to Browse >> double click to Dell6530
Double click to Forward Lookup Zone
Double click to dell.com
Choose dell6530.com > OK
Click OK
Try to ping new domain >> ping hung.dellapps.com (you can change hung to your name yourname.dellapps.com). If you get result as follows you get success

Setup SharePoint 2013

Refer this article (http://www.microsofttechnology.net/2014/09/installing-sharepoint-server-2013.html).
Login to computer by spfarmadmin
Preparing setup SharePoint: Configure Application Server and Web IIS
Setup Preparation
Setup SharePoint
Continue
Install now
Waiting
Run configuration
Next
Yes
Choose Create a new server farm
Server name: dell6530
Database Name: any name
User Name: using spfarmadmin
Password:: XXXXXXXXXXXXX
Passphrase: same your password
Specify port number: 9999 > Next
Next
Waiting
Finish
Login to SharePoint Central Admin
Choose “Yes, I am …” > OK
Click cancel
On home page, click on Application Management > Manage web applications
Keep default then click ok
Click “Create Site Collection”
Username : spfarmadmin
Click OK
Open site collection

Create services application and configure APPS

Creating 2 services application: is Subscription Settings Service Application and App Management Service Application

Creating Subscription Settings Service Application

Open SharePoint Management Shell
Input $account = Get-SPManagedAccount dell\spfarmadmin then enter
$appPoolSubSvc = New-SPServiceApplicationPool -Name SettingsServiceAppPool -Account $account
$appSubSvc = New-SPSubscriptionSettingsServiceApplication -ApplicationPool $appPoolSubSvc -Name SettingsServiceApp -DatabaseName SettingsServiceDell6530DB
$proxySubSvc = New-SPSubscriptionSettingsServiceApplicationProxy -ServiceApplication $appSubSvc
Go to Application Management >> Manage services applications
And see service is created successful
And database also

Creating App Management Service Application

$account = Get-SPManagedAccount dell\spfarmadmin
$appPoolAppSvc = New-SPServiceApplicationPool -Name AppServiceAppPool -Account $account
$appAppSvc = New-SPAppManagementServiceApplication -ApplicationPool $appPoolAppSvc -Name AppServiceApp -DatabaseName Dell6530AppService
$proxyAppSvc = New-SPAppManagementServiceApplicationProxy -ServiceApplication $appAppSvc
Go to Application Management >> Manage services applications and see App Services is created
Database also
Make sure 2 services which is started: Go to Application Management > Manage services on server
We see it is stopped
Start it

Configure Apps URL and App Catalog

On Home page >> click Apps >> click Configure app URLs
Input App domain: dellApps.com (create before in DNS)
App prefix: SharePointApps
Click to Manage App Catalog
Choose Create a new app catalog site > OK
Input your information
App catalog site look like this

Adding Apps from SharePoint Store

Login spfarmadmin as farm admin >> Add an app
Choose SharePoint Store
Choose News Ticker
Add it
Login to Microsoft account
Continue
But you get Issue
You got error because you login by Administrator local or Admin farm (spfarmadmin).

Solution:

Adding spinstaller to Manage the farm administrators group in central admin (Go to central admin >> Security >> Manage the farm administrators group then add user to there)
Login to App Catalog as pinstaller user you will not get error (spinstaller => created before)
Result: Add App again then you got >> click return to site
Trust It
Done
Login to App Catalog by spfarmadmin then click to your app
I using firefox login to Apps but is not successful, so login by spfarmadmin  it in IE
Result as:

Adding Apps from Visual studio

Login to computer by spinstaller
Open visual studio >> create App for SharePoint 2013
Input  your App Catalog and choose SharePoint-hosted
Developing some JavaScript or keep default then click deploy project app
You get error

Cause:

Your create spinstaller but it didn’t add to SQL Server

Solution:

Login to computer by spfarmadmin
Add new user is spinstaller
Add Mapping for this user and give it db_owner permission
Switch user to spinstaller and create another apps then deploy it
Deploy succeeded
Switch user to spfarmadmin
Login App site by spfarmadmin you will see you your app
Click to your app and login to Apps by spfarmadmin then you see the result
Finish.


0 comments:

Post a Comment