I've tried to upload my Angular2 project from GitHub to Azure but I get the following error when I open the Azure page:
You do not have permission to view this directory or page.
The GitHub deploy to Azure worked fine, no problem. Does anybody know the reason why I still get this error message?
Here's my GitHub project
Here's my Azure website
You are using Azure Web App and Azure uses IIS to host your application. So, basically, you no longer need to handle your Angular2 project with the Node.js script.
Please try to delete your server.js file from /wwwroot folder, and also remove the following content in web.config file.
<handlers>
<!-- indicates that the app.js file is a node.js application to be handled by the iisnode module -->
<add name="iisnode" path="server.js" verb="*" modules="iisnode" />
</handlers>
Related
<configuration>
<appSettings>
<add key="REACT_APP_SERVER_URL" value="http://hostname.api" />
</appSettings>
</configuration>
I have added the REACT_APP_SERVER_URL env key in the web.config file and the React App is hosted on the IIS manager. I did a console.log(process.env.REACT_APP_SERVER_URL) in React to read the value of this key but I always get back the value of undefined.
I have also hosted a Node Express server on the same IIS manager instance and the environment variables works fine there. I am not sure if this is a React issue or IIS manager issue, can someone assist me? Thanks.
Recently I developed a website using NextJS with some features like ISR and API Routes. Unfortunately, I purchased a hosting service called Winhost that is not especially for NextJS and only supports IISnode.
So, is there a way I can host my NextJS website without static exporting and retaining all the features?
At the end of the day a NextJS application on the server side is a NodeJS application, follow the steps here
https://support.winhost.com/kb/a1534/node_js.aspx
Make sure you select the right node version with your NextJS application - i.e downloading the right node.exe
The mapping file seems to be important so nodejs apps are executed by IISNode
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="iisnode" path="*.js" verb="*" modules="iisnode" />
</handlers>
</system.webServer>
</configuration>
Today i've deployed my client react app to Azure App Service. The problem is, that instead of displaying site im interested in, it returns structure of wwwroot. Even if I change directory to /src/App.js it return code of the App. What is the problem?
When you run a node application on Windows Azure Web Apps, IIS is used as the webserver together with iisnode and most likely some configuration is wrong so IIS doesn't know what to start. I'd suggest to let Azure handle the creation of the web.config and you don't touch it unless you know what you're doing:
Create a file .deployment with the following content
[config]
SCM_DO_BUILD_DURING_DEPLOYMENT = true
Put the .deployment file as well as the content of your React app (don't include web.config, you also don't have to include the node_modules folder, Azure will handle this as SCM_DO_BUILD_DURING_DEPLOYMENT is set to true) into an upload.zip file.
Delete the content of /wwwroot in Azure
Run az webapp deployment source config-zip -g <ResourceGroupName> -n <AppServiceName> --src upload.zip
A new web.config should get created which should contain a handler for server.js which will be the file to be served by Node.js.
This is solved. Thanks to #azium
The only thing i needed to do is run
npm run build
in local before deployment
I managed to deploy my react app with an Azure CD pipeline on an Azure App Service. And the pipeline throws no error.
Unfortunately when I click browse on the Azure app service I get this message "You do not have permission to view this directory or page."
I enabled advanced logging and here is what I get:
Here is my web.config file content:
[![enter image description here][2]][2]
Any hint on how to solve this issue?
You do not have permission to view this directory or page
The root reason is that there is no default page in your Azure website. You can try to directly view the page with following url.
https://{siteanme}.azurewebsites.net/views/login.html
Or you could add the default document in the project root folder and set it as default page in appsetting on the Azure portal and save the setting.
The default document is the web page that is displayed at the root URL
for a website.
In addition, you can check the IP restrictions or authentication settings on the Azure web application that may block you.
Check Web App > Authentication /Authorization and Web App > Networking > Access Restrictions
Here is a blog about deploying create-react-app on Microsoft Azure, you can refer to.
Created the production build by executing npm run build command. A
build folder got generated in the solution with some meta data files
Once connected via the FTP client, copy the entire content of the
build folder created earlier into the /site/wwwroot/ folder on your
Azure Website
I needed to configure the following in Azure Web App Configuration:
index.js as a Default Document
change the virtual path to \site\wwwroot\build
I have no knowledge about deployment, production server, web server, etc. But I have a web application and my boss wants to deploy it in order to access it by web browser.
So, my application was generated by Spring Initializr.
It's using Spring (Boot, Security, Web, Data JPA), with web service REST (#RestController), HTML templates and AngularJS.
With mvn clean package, I generated a JAR file of this application. It is working on my desk. But, how can I deploy it?
I believe that my company has an OVH hosting. Can I install JBOSS or Tomcat on it, and upload my JAR on OVH?
You can deploy your application on Tomcat but you need to have a war instead of a jar to run it on an existing application server.
You can read the following documentation to create the war : http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#build-tool-plugins-maven-packaging
Once done, you just have to upload it on the server in the webapps directory of your tomcat server.