Unable to run nodeJS App on A2 Hosting shared plan - node.js

I'm trying to run the simplest node/express app which has a single get request that sends hello world as response. Works on local.
I followed this tutorial for deploying it on A2 hosting shared plan, but I'm getting default a2 hosting page and not my app.
Tutorial followed: https://medium.com/#pampas93/host-your-node-js-app-on-shared-hosting-go-beyond-localhost-73ab923e6691
I tried contacting support. They responded:
App is on a different location and website is looking at different location.
To make it use the path that you need may require custom coding or alterations to the .htaccess file to change the document root for the primary domain.
I'm not able to understand what changes to make/how to fix this. Any help would be appreciated.
The .htaccess file in my cpanel is empty right now. No code is written inside it.

Related

I have copied files via FileZilla to Azure but the index page doesn't show

I shall try not to be subjective so as not be closed.
This is my first foray into Azure and it really is NOT like my dedicated server on another hosting company. Suffice it to say, what takes me minutes to deploy a site via FTP, then to IIS to set it up, has taken me WEEKS!
I don't want to set up any of the "pre-packaged" Quickstart solutions. I simply want my INDEX.HTML file to DISPLAY.
I copied all the files via Filezilla to Azure, quite easily, but yet, when I go to the URL, I keep getting:
Your App Service app has been created
Go to your app's Quick Start guide in the Azure portal to get started or read our deployment documentation.
Everything is set up on Azure perfectly.
Here's what it looks like under the appSettings Tab:
**Virtual applications and directories**
/ site\wwwroot Application …
/wwwroot site\wwwroot\mynewsite Application …
The directory, site\wwwroot\mynewsite has an index.html but it will not display when I type in the URL.
I already built the site and the company I'm working for wants it on AZURE.
A dedicated server takes under 15 min. This has taken weeks.
UPDATE:
Thiago, thank you... so here's the file structure below...
Reveals EXACTLY what my directory looks like. Under /thingblugrow is where "the fake name" mynewsite exists. I thought it'd be easier to just show you what I really have.
So, /thingblugrow has an index.html file....
If your want to visit http://yoursitename.azurewebsites.net/mynewsite/index.html,
The appsetting we need config it as following in your case:
Virtual applications and directories
/ site\wwwroot Application …
/mynewsite site\wwwroot\thingblugrow Application …
You also can refer to another SO Thread to get more info about creating Virtual applications and directories
You're adding an extra level, so in your case you'll be able to see the index through:
http://yoursitename.azurewebsites.net/mynewsite/index.html
Just move all the content from "mynewsite" folder to the parent directory (wwwroot).

IIS: How change URL to include site name when browsing web files

In my IIS, I have created "App1" as my site name and setup everything.
Now when I browse one of my web file from IIS, the URL for that page is something like "http://localhost/Folder1/Default.aspx".
But back to last time when I was using window 7, the URL that I can get is "http://localhost/App1/Folder1/Default.aspx", now I'm only getting "http://localhost/Folder1/Default.aspx" after I upgrade to window 8. I'm not sure if it's window 8 that causing the issue or anything, but I need advice on how to include the site name when I browse the file so that I can get "http://localhost/App1/Folder1/Default.aspx".
The reason why I need to include site name is because my entire project solution is calling files and web services that including the site name since long time ago. Without the site name, I can't run the program at all because I can retrieve data from any web service
Can anyone advice me on how to include site name in IIS?
I tried Directory Browsing but seems not the solution in my case. I try search for how to include site name in my domain but usually end up directing me to Directory Browsing.
FYI, my application pool setting is as below:
.Net CLR Version: v2.0.50727
Managed Pipeline mode: Classic
Really appreciate any help on this.
Thanks
Just in case anyone face the same issue like me, I found my solution.
Yesterday I just thought of instead of searching Google for so many hours looking for how to include site name in my URL, I remove the App1 application in my IIS. Then, in the physical directory of my App1, I created one new folder call "Main" and I move my App1 folder into Main.
When I create a new application in IIS, i create new application as App1 but point the physical application path to "Main". This way, when I browse one of the web files in IIS, I can see something like "http://localhost/App1/Folder1/Default.aspx" which totally solve my problem, and my program can run properly now.
Although I still do not know how to include site name into the URL and why the site name is missing. But at least this solve my issue now

How to get standard out from a Node.js application in Azure?

We have a Node.js application with a pretty big codebase that we're trying to deploy to an Azure Web Site. My problem is that when I deploy the app and try to access it, I just get a message saying "The page cannot be displayed because an internal server error has occurred".
According to http://azure.microsoft.com/en-us/documentation/articles/web-sites-nodejs-debug/ I should be able to configure some settings and have my standard out be logged to a file - well, it's not working. in /LogFiles I can see /git, /html, and /DetailedErrors, but none of these folders contain the stdout logs.
I have deployed the app using Visual Studio. I created a blank Azure project, and manually added all the folders and files I need. I also created an iisnode.yml file that contains the following config:
loggingEnabled: true
devErrorsEnabled: true
logDirectory: ./logs
debugHeaderEnabled: true
The last two lines I added later, the first ones are from the tutorial. I also have a web.config file, the contents of which I haven't really touched.
I've attempted to configure the settings that are available in the Web Sites UI, but I haven't really been able to make any headway. I think currently they are pretty much default.
I'm sorry that I can't provide you with more information. I'm really kind of banging my head against the wall here, since all the tutorials I've found basically state that if I do this and that, everything should work. The problem is, it doesn't. Sad face.
Edit: I should probably add that my server.js is in a folder called /NodeServer. It's not in the root as Azure seems to presume.
Edit2: I deployed a Hello World example and got it to work, but when I try to move the server.js file from the root I can't get it to work anymore.
I've added a tag to the web.config, so that the structure is basically
configuration
location path="NodeServer"
system.webServer
I've also edited my package.json so that it says
"main":"NodeServer/server.js",
"scripts":{
"start":"cd NodeServer && node server.js"
}
If the app is started successfully, you should be able to find the stdout at
D:\home\LogFiles\Application
in Azure Websites, without configuring anything.
But here it looks like an error related to incorrect/missing web.config. The node app may not get launched. You can try:
Publishing your app using git to Azure Websites.
Or if you are familiar with IIS and iisnode, make sure your app works locally with IIS and iisnode. See http://tomasz.janczuk.org/2011/08/hosting-nodejs-applications-in-iis-on.html
Or try publishing an "hello world" node.js app to Azure Websites, take the generated web.config and modify it for your app.
Edit: When you change the location of server.js, you have to change web.config too. The change in web.config is not correct. And package.json is only used as hints to generate web.config during git deployment. To get your "hello world" to work, you can either
In your web.config, replace all "server.js" with "NodeServer/server.js".
Or deploy the modified app using git. Make sure it does not contain the wrong web.config.
Then you can try to get your larger app to work.

Azure Mobile Services on Local IIS rather than IIS Express

OK, I've created an Azure Mobile Services project in Visual Studio 2013.
I run it up as-is, then in the browser I test it by adding a todo item via the simple browser app that seems to get baked into these service projects. It gives me a '201 success' message - brilliant.
I then convert the project from IIS Express to Local IIS as the web host, recompile and try again, and although I get the same smiley face app telling me that everything is OK, when I try and add a todo item I get a 404 error. This is contrary to the Microsoft article that gives these instructions, which clearly says I am able to choose either IIS Express or Local IIS when setting up the project.
My guess is that web.config is missing something when this project runs on the local IIS server.
I'm hoping someone already has a solution before I spend hours trying to work out how to configure IIS for this type of project.
I've already wasted a load of time working through loads of bugs and gotchas with Azure Mobile, and I'm starting to run out of steam - so I'm hoping someone can help me before I go and grab an account at Parse.com
Many thanks in anticipation.
Dean
The easiest approach for your situation might be to just deploy to the cloud, and use that service for your testing. Visual Studio 2013 Update 2 makes it easy to deploy your app and connect to it for remote debugging. It is a little slower than using a local instance, but you are also assured that there will be no surprises when you eventually go live (since you are live the whole time).
That said, we will investigate the issue you are seeing with using IIS directly. Some things you might want to try on your own:
Verify that you can view the web side from your Mac's browser, to make sure that the firewall is letting the requests through.
Try using the "Getting Starting" link from the smiley-face page, to see if the REST endpoints are behaving correctly.

cakePHP, what to do next?

I've followed some tutorials about cakePHP and now it's done, the "mvc" is ready.
What should I do next?
Meaning: I was working locally, can I simply upload the complete app online and it is secured as 'they' meant it to be?
I've downloaded the 1.3.6 package from https://github.com/cakephp/cakephp/archives/1.3, and deployed it as is in a folder named as my domain.
Edit:
I have win-xp with wamp.
I created the app by simply unzipping the file to a folder and then renamed it to 'domain_name'.
Then I made the db connection and set the configuration files.
At that point I created the models, views and controllers.
Now the application is working, locally.
My question is: can I simply upload everything to my server, to the html root folder and say that "I am done"?
As long as your app isn't already in production, putting it online can tell you more about how it's working. For instance, you'll learn if there are missing modules or dependencies that must be installed on the live server.
If it's an already live system, you may want to use an online staging server to understand what needs to be modified on the production server in order to have a smooth deployment.
There are three ways that you can deploy your cake app (Development, Production and Advanced), and all of them are secure:
http://book.cakephp.org/view/912/Installation
I would recommended the Production install if you aren't going to run any other apps on this server.

Resources