Sunday, July 22, 2012

Deploying nopCommerce Admin Site on Shared hosting

In my previous blog post we learn how to deploy nopCommerce website.

If you haven't created your store site (i.e. Nop.Web) please do so before proceeding further.

I am assuming that you have published your website to /YourWebsite.com/wwwroot


nopCommerce has 2 web application
1) Nop.Web - It is actual store web application, which we already published in my previous post
2) Nop.Admin - It is admin interface, which will allow us to add product, manage product and much more admin related stuff.

This both web application need to be published to the same directory.



Being said that, In this blog post we will see how to deploy and configure nopCommerce Admin site.
  • Open nopCommerce Project in VS.Net 2010
  • Compile the project in Release Mode.
  • Publish website.  From menu, Build > Publish Nop.Admin
    • Save publish profile as shown in figure below and click on "Publish" button.  After few mins. website will be published and create necessary files in folder you choose to publish.

  • Open FTP Client tool FileZilla  (If you do not have installed FileZilla FTP Software or any other FTP Client Software, please do so before proceeding any further.)  
  • Now Copy files you just published for "nopCommerce Admin" to Remote Site.   
  • In order to do so 
  • On RemoteSite, where you publish your nopCommerce website, Create a "Administration" Folder inside website.

 Now copy files you publish to "Administration" Folder.

  • I am assuming that you have published “Nop.Web” to “ /YourWebsite.com/wwwroot ”. 
  • Nop.Admin” needs to be published in “/YourWebsite.com/wwwroot/Administration”. 
  • Make sure the .dlls from Nop.Admin ( /YourWebsite.com/wwwroot/Administration/bin) are moved and exist in (/YourWebsite.com/wwwroot/bin).


You are done, now check your admin site by login using admin username and password.  And it should start working :)

Deploying nopCommerce on Shared Hosting

In this blog post, i will be showing how to step by step deploy nopCommerce on Shared Hosting.  I will be using Arvixe web hosting as my Shared Hosting but you may use Godaddy, etc.

1) Domain Pointing to Third Party Hosting
If you have set your "Nameserver" pointing to your third party hosting, please do so now.
Setting up "NameServer" can take upto few mins to few hours so do it while you are trying to prepare for next few steps.
  • Let say you purchase your domain on "Godaddy.com", in order for godaddy to point to third party hosting you need to set up nameserver.
  • Login into your "Godaddy.com" account and goto "Domain Details" page of your domain.
  • Inside "Domain Details" find "NameServers" and click on link "Set Nameservers".
  • On Nameservers popup window, choose the option "I have specific nameservers for my domains."
  • Now type Nameservers details you received from your hosting company.  If you do not have call up your hosting company and find those details.  You need to set "Nameserver1" and "Nameserver2" details and other if you have any more servers.
  • Click "OK" button to save Nameservers changes.
  • Now This may take few minutes to few hours in order to have changes in effect.

2) Creating Domain and Website inside third party hosting.
  • Logon to your third party hosting control panel.  (Incase of Arvixe, you need to type "cp.websitename.com" Enter your username and password.)
  • Create a Domain inside control panel.  (Click on "Domains" and click button "Add Domain" to add new domain.  You need to typein your domain name and click "Add")
  • Create a website inside control panel.  (Click on "Websites" and click button "Add Website" to add new website.)
  • Note: Below points are Arvixe Hosting Specific steps
  • Ones website is created click on website so that "Web site properties" screen will appear.
  • Inside website properties, click on "Extension" tab.
  • Inside "Extension" tab screen, choose Asp.net version as "4.0 (Integrated)" and click on "Update" button.  Since our website will be on Asp.net MVC with 4.0 code we have made this changes.

3) Publishing Website and doing Installation for first time on Arvixe.
  • Open nopCommerce Project in VS.Net 2010
  • Compile the project in Release Mode.
  • Publish website.  From menu, Build > Publish Nop.Web
    • Save publish profile as shown in figure below and click on "Publish" button.  After few mins. website will be published and create necessary files in folder you choose to publish.


  • Open FTP Client tool FileZilla  (If you do not have installed FileZilla FTP Software or any other FTP Client Software, please do so before proceeding any further.)


  • Now Copy files you just published for "nopCommerce" to Remote Site.  File upload will take some time.

  • Since we are doing it for first time we have publish all files, but if you are doing it after your first installation remember to remove your configuration files.
    • Example:  do not publish your connection string file which is in nopCommerce\Presentation\Nop.Web\App_Data\Settings.txt

  • Now type the URL of your website and "nopCommerce" is smart enough to help you through your first time installation, even in third party hosting.


After few minutes you are ready to play with your e-Commerce website.

How to change connection string in nopCommerce

Connection string in nopCommerce is located at
...\nopCommerce\Presentation\Nop.Web\App_Data\Settings.txt

Please note:  
This file can not shows in visual studio, so you can directly open file from physical location  Presentation\Nop.Web\App_Data


Your sample connection string will look like
DataProvider: sqlserver
DataConnectionString: Data Source=<SQLServerName>;Initial
Catalog=<MyDatabaseName>;Integrated Security=True;Persist Security
Info=False;MultipleActiveResultSets=True


Is it safe to Settings.txt file is secured?
Generally we stored connection string in Web.config file, but in nopCommerce we found that Connection String is stored in \Presentation\Nop.Web\App_Data\Settings.txt

Yes it is safe.  All files stored into App_Data directory are "secured". Any file you place there won't be downloadable.