How to publish a web application using WebMatrix Web Deploy

Web hosting Forums and discussions

Forums for Web hosting discussions: If you have any queries or questions related to web hosting services, place them here and get answered by our experts and customers. We invite you to even participate and provide solutions or answers that are known to any queries placed in this forums. We will get answer for all the queries and questions raised here.

How to publish a web application using WebMatrix Web Deploy

0
To run the steps in this procedure you must be running Windows XP SP3 or a later version of Windows. You'll also need to have WebMatrix installed. Please see here for installation WebMatrix Installing WebMatrix

Just follow the simple steps below for setting up your website and WebMatrix IDE

How it works:
After you create a website locally, you would typically publish the website to your Web hosting Space. Publishing your website involves following steps:

Step 1: Preparing your Web Hosting Space
Step 2: Configuring WebMatrix for Publishing
Step 3: Publishing
Step 4: Review Site


Web hosting Space
When you publish your website, you copy files from your computer to a web server that's maintained by HostASP. That can be done by two ways Web Deploy method and FTP method. We support both Web Deploy and FTP method to automate the publishing process. FTP method lets you publish Microsoft SQL Server Compact 4.0 databases, but not databases that use SQL Server or SQL Server Express.

Among the publishing options is SSL, which stands for secure sockets layer. (SSL is what you're using if you access a Web site using https:// instead of http://.) SSL encrypts the information going between the browser and server, and is a good idea for pages that involve private information like passwords and credit-card numbers. Setting up SSL requires extra steps like purchasing and configuring a certificate that's used for encryption. At HostASP, we offer Free SSL publishing URL when you do Web Deploy all your files are encrypted, safely and securely transferred to your HostASP Web hosting account.

Databases
If you're using SQL Server Compact as your database, the data is stored in an .sdf file. When you publish the database, WebMatrix copies not only the .sdf file but also the database program itself to the web server. This ensures that the published site will work even if SQL Server Compact isn't already installed on the web server.

If you're using a SQL Server or MySQL database, WebMatrix publishes the database by creating scripts that run in a database that has been created for you by your hosting provider. These scripts create database tables and insert data into them in order to replicate the structure and data that you have in the database on your computer.

If you're using a SQL Server Compact database and want to publish to a SQL Server database, you must migrate the data to SQL Server before publishing. For instructions, see Migrate a database to SQL Server. You might want to do this to take advantage of SQL Server features such as stored procedures and its additional capabilities, such as handling more than 256 concurrent connections or creating databases larger than 4 gigabytes

In this session we will see how to deploy our movies website, we earlier saw in other topic how to develop a simple movies website using MS SQL Compact DB. We will now deploy this website to our web hosting account on domain name http://www.yourwebhosting.in/

Step 1: Preparing your Web Hosting Space

Very first step that you would need to do is prepare your website for web publishing on our web hosting space. Login to your web hosting control panel, open website properties and setup a web deploy account ( this will create a windows NT account ). Use this account to configure the Publishing XML. This will enable your website for remote Website publishing.

http://www.hostasp.net/articles/images/webmatrix/webmatrix-enabling-web-deployment_03.png

To setup an web deploy account - Provide user name and password for your Web publishing and click on enable button. This will enable your web deployment account for web publishing.

http://www.hostasp.net/articles/images/webmatrix/webmatrix-webdeploy-account_03.png

You could see Web publishing is now enabled on your account.

http://www.hostasp.net/articles/images/webmatrix/webmatrix-webpublishing-enabled_03.png

You do have option to configure Web publishing XML - If you have multiple databases on your web hosting account and based on your application database type, you could choose a MS SQL database or My SQL database, The database user whom permission is granted and then the FTP account. Select your choice and rebuild the publishing XML. After rebuild is complete your publishing XML is saved and can be downloaded onto your local machine for import to WebMatrix.

http://www.hostasp.net/articles/images/webmatrix/webmatrix-publishingsettings_03.png

Step 2: Configuring WebMatrix for Publishing

Now that we configured our web hosting account for Web publishing, let us download the publishing XML file. The file that you download will have .publishsettings as extension , here in our case we will have yourwebhosting.in.publishsettings. Find below the structure of publishing XML file.

http://www.hostasp.net/articles/images/webmatrix/webmatrix-publishingxml_02.png

Now go to WebMatrix IDE on Top Menu -> Publish -> Settings and Import the file by clicking on "Import Publish Settings" this would default all the required fields with server information that you have on Publishing XML. Publishing XML supports both FTP method and Web deploy method. Let us see deployment using Web Deploy method. You would also notice that server name with https prefix, we have setup this URL with SSL certificate so that you can safely deploy your website over internet. One more thing you would notice is "Remote connection string not required" against this Movies DB it is because this MoviesDB application uses integrated SQL Compact Databases .SDF and so you would not require an explict or external MS SQL Server access on your hosting account, if your web application uses MSSQL or MySQL server then it would be filled in with information by default from Publishing XML.

Ok, now that you have imported the settings lets Click on validate settings to connect to the server.

http://www.hostasp.net/articles/images/webmatrix/webmatrix-import-publishingxml_03.png

You have done your validation part and is successful, the information you have got on Publish setting is fine and able to connect to server. Click on save button to save this setting on your project.

http://www.hostasp.net/articles/images/webmatrix/webmatrix-publishing-validatesettings_03.png

Step 3: Publishing

You are done with the server validation part, let us now start publishing website.
Click on Publish. This will perform compatibility check with the server to see you web application is compatible with the server / web hosting account.

http://www.hostasp.net/articles/images/webmatrix/webmatrix-publish-compatibilitysettings_03.png

Accept and proceed with compatibility check with the server. WebMatrix will upload few sample / test files to the server to check the server requirement for your website.

http://www.hostasp.net/articles/images/webmatrix/webmatrix-compatibilitychecking-uploadingfiles_03.png

You would then see WebMatrix validating the server requirement, for this MoviesDB website you would need ASP.NET setup and support for simple HTML on server. It is validated and WebMatrix found them available on our Web hosting account. Click on Continue to proceed with deployment.

http://www.hostasp.net/articles/images/webmatrix/webmatrix-publish-compatibility-results_03.png

The Publish Preview dialog box appears.

http://www.hostasp.net/articles/images/webmatrix/webmatrix-publish-preview_03.png

Review the list of files and databases and make changes if necessary. For example, you might want to clear check boxes under Changed Files to exclude some files.

Important: If you're publishing a database and the database already exists in the hosting provider's site, whatever is in that database will be overwritten.

Click Continue. WebMatrix publishes the website, showing status messages in the navigation bar at the bottom of the screen. The publishing process is done in the background, which means you can continue to work in WebMatrix while it is publishing.

http://www.hostasp.net/articles/images/webmatrix/webmatrix-publishing-yourwebhosting_02.png

In the notification bar at the bottom of the screen, you can click Log to see a detailed log of the publishing activity.

http://www.hostasp.net/articles/images/webmatrix/webmatrix-deployment-log_03.png

If you see something in the log that catches your attention during the publishing process, you can click Pause Scroll to go back and examine what you saw more carefully.
When the publishing process is complete, the notification bar lets you know:

http://www.hostasp.net/articles/images/webmatrix/webmatrix-publishing-complete_02.png

Step 4: Review Site

To verify that publishing was successful, browse to the site. If you published a database, make sure you try any pages that display data from the database.
Note: If your site has a Web.config file, the copy on your web hosting account on web server might look slightly different. For example, if you published a SQL Server database, it will have the our web hosting SQL connection string value so that the published site will use the database at the hosting provider.


http://www.hostasp.net/articles/images/webmatrix/webmatrix-review-websites_03.png

In the next Topic we will show how to download DotNetNuke using WebMatrix Gallery, and set them up locally, test and then deploy remotely on a server.
Technical specialist HostASP
  • There is no reply for this discussion yet
Your Response
Please login first in order for you to submit comments