.net core 2.2 app returns "This site can’t be reached" when run on IIS version 10 - iis

I have recently downloaded a copy of nopCommerce and installed it. Pressing F5 in visual studio, it ran successfully on IIS Express. I have now enabled IIS and would like to run this site on IIS but when I click "browse" in IIS I get the message "This site can’t be reached". I am running VS in admin mode and enabled development-time IIS support but I still haven't got it working.
launchSettings.json
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iis": {
"applicationUrl": "https://nopCommerce.local.com",
"sslPort": 0
}
},
"profiles": {
"Nop.Web": {
"commandName": "IIS",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://nopCommerce.local.com:443/"
},
"IIS": {
"commandName": "IIS",
"launchBrowser": true,
"launchUrl": "https://nopCommerce.local.com:443/",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"nativeDebugging": true
}
}
}
IIS Application Pool
.Net Clr version: No Managed code
Managed pipeline mode: integrated
IIS Site Bindings
Type: https
IP address: all unassigned
Port: 443
Host Name: nopCommerce.local.com
Required server name indication: false
Disable HTTP2: false
Disable OCSP stapling: false
SSL certificate: IIS Express Development Certificate

Related

EISDIR issue in Azure hosted Nuxt Vue webiste

I have hosted a Web app in Azure DevOps, the application built with Vue and Nuxt.
#vue/cli 5.0.1 and "nuxt": "^2.15.8". After hosting the web application works fine, I can login, then it navigates me to the listing page. But from there when I refresh the page it's showing this error. Sorry, check with the site admin for error: EISDIR .. in the browser and throwing a 500 Error in the console. In my login response I get only access token, there is no refresh token, could that be an issue? or any other settings in the Azure side? We tried setting this in the azure pm2 serve /home/site/wwwroot --no-daemon --spa. Still it's not working. Everything works fine in my dev environment.
export default {
ssr: false,
head: {
title: 'BBG Returns Self Service',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
{ name: 'format-detection', content: 'telephone=no' },
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
},
plugins: ['~/plugins/clearTokens.js'],
components: true,
buildModules: ['#nuxtjs/style-resources'],
env: {
BASE_URL: 'https://my-api-url',
},
publicRuntimeConfig: {
baseURL: process.env.BASE_URL,
},
router: {
mode: 'history',
},
styleResources: {
// scss: ["~assets/scss/main.scss"],
},
modules: ['#nuxtjs/i18n'],
build: { transpile: [/^#storefront-ui/] },
server: {
port: 4200,
},
i18n: {
locales: [
{
code: 'en',
iso: 'en-GB',
name: 'English',
file: 'en.json',
icon: 'uk.svg',
},
{
code: 'de',
iso: 'de-DE',
name: 'Deutsch',
file: 'de.json',
icon: 'de.svg',
},
],
lazy: true,
langDir: 'i18n/',
defaultLocale: 'en',
detectBrowserLanguage: false,
},
target: 'static',
}
If deploying an SPA app, you need to have both:
target: 'static' (the default being 'server')
ssr: false
This removes quite some benefits regarding SEO + performance but at least, you still get all the benefits of the Nuxt DX and ecosystem.
To host it on Azure, you have several approaches, if you're using:
a static app, you can follow this official documentation for Azure Static Web Apps: https://nuxtjs.org/deployments/azure-static-web-apps/
a SSR app, you can follow this one about Azure Portal: https://nuxtjs.org/deployments/azure-portal
The actual issue was the Azure configuration. The resource should be created as Static website, then it will work fine.
Please follow this official documentation to understand How to Deploy in Azure.
https://nuxtjs.org/deployments/azure-static-web-apps/

.NET Core API - IIS - cannot make it work

I created a simple .NET Core API with Visual studio 2019
I just cannot make it work
I go from 503 to 404 to connection refused, and so on...
I tried :
adding my app to an application pool with or without SSL and dev certificate
publishing the application in a folder and setting that folder in IIS like in many tutorials
then VS2019 complains about that and force the IIS site to be linked to the VS project root
I set bindings to 80 and 443 ( modded my host file to have fqdn of the web site to point to 127.0.0.1
I checked the IIS logs and I even added a Failed Request Tracking rule on port 503, no log file was ever produced, while the error clearly appeared
I tried by setting the wwwroot of the site to ../bin/debug or .../bin/release
launchSettings.json:
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iis": {
"applicationUrl": "http://*******-api.local",
"sslPort": 0
},
"iisExpress": {
"applicationUrl": "http://localhost:55973",
"sslPort": 44362
}
},
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "weatherforecast",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Local": {
"commandName": "IIS",
"launchBrowser": true,
"launchUrl": "weatherforecast",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"*********Api": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "weatherforecast",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:5001;http://localhost:5000"
}
}
}
I deleted my project, recreated it,
I also installed the windows hosting bundle
also make sure the .NET CLR Version is set to No Managed Code
https://dotnet.microsoft.com/download/dotnet-core/thank-you/runtime-aspnetcore-3.1.6-windows-hosting-bundle-installer

How to deploy an asp.net core 2.2 in linux apache server with revese proxy

Hello I'm trying to deploy an asp.net core 2.2 app in a linux machine using apache server and reverse proxy but I'm having problems to see my web app. I see this:
I will show you all the configuration i've made
Following this microsoft tutorial : https://learn.microsoft.com/es-es/aspnet/core/host-and-deploy/linux-apache?view=aspnetcore-2.2
I've configured first my Startup.cs code like this:
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseDatabaseErrorPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
//app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseCookiePolicy();
app.UseForwardedHeaders(new ForwardedHeadersOptions
{
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
});
app.UseAuthentication();
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
}
And the launchSetting.json like this:
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:63992",
"sslPort": 44365
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"ElectransCloudServices": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:5000"
},
"Docker": {
"commandName": "Docker",
"launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}"
}
}
}
Then I compiled my project and I move into my linux machine executing the command dotnet publish --configuration Release -o /var/www/ElectransCloudServices to deploy my project into the correct directory for the apache configration.
This part is the project configuration. Now I gonna show you my server configuration:
I've created a configuration file called electransapp.conf in /etc/apache2/sites-enabled/ with the following script:
<VirtualHost *:*>
RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
</VirtualHost>
<VirtualHost *:8080>
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:5000/
ProxyPassReverse / http://127.0.0.1:5000/
DocumentRoot /var/www/ElectransCloudServices
ServerName localhost
# ServerAlias *.example.com
ErrorLog ${APACHE_LOG_DIR}helloapp-error.log
CustomLog ${APACHE_LOG_DIR}helloapp-access.log common
</VirtualHost>
I'm using the 8080 port.
Then I modified the file /etc/apache2/apache2.conf with the following parameters:
<Directory /var/www/ElectransCloudServices>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
ServerName localhost
And finally I run the command systemctl restart apache2
After doing all this I'm seeing the first image I showed you. I'm pretty sure that the error is in the apache configuration but I dont know what I'm doing wrong.
Any help?
Thank you in advance

Run Nightwatch.js tests against a remote Selenium server in Kubernetes environment

I've created automated tests with Nightwatch-Cucumber based on Nightwatch.js. I can start the tests on local machine, the Selenium server starts on local machine and the tests will be executed.
But now I want to integrate the existing tests in a Kubernetes environment. On local machine I want to use minikube, helm, a jenkins chart to start the tests and a selenium chart. But this setup is quiet different to the local one. I want to start the tests on the Jenkins instance and the tests should be executed against the running Selenium server delivered by the selenium chart. So I want to use such a "remote" Selenium server. I don't want to use a local Selenium server that starts on runtime, but a still existing Selenium server somewhere in the Kubernetes environment
But how to configure my nightwatch.conf.js configuration to realize that scenario?
My current configuration looks like this:
const config = {
output_folder: "reports",
custom_commands_path: "commands",
// custom_assertions_path: 'assertions',
live_output: false,
page_objects_path: "pageobjects",
disable_colors: false,
selenium: {
start_process: true,
server_path: seleniumServer.path,
log_path: "",
host: "127.0.0.1",
port: 4444
},
test_settings: {
default: {
globals: {
waitForConditionTimeout: 30000,
waitForConditionPollInterval: 500
},
screenshots: {
enabled: true,
on_failure: true,
path: "screenshots"
},
//launch_url: "http://localhost:8087",
//selenium_port: 4444,
//selenium_host: "127.0.0.1",
desiredCapabilities: {
browserName: "phantomjs",
javascriptEnabled: true,
acceptSslCerts: true,
"phantomjs.binary.path": phantomjs.path
}
},
First step, make sure your remote Selenium-server is accessable( checking host IP and port )
Secondly, config following :
const config = {
output_folder: "reports",
custom_commands_path: "commands",
// custom_assertions_path: 'assertions',
live_output: false,
page_objects_path: "pageobjects",
disable_colors: false,
selenium: {
start_process: false, // turn this off and comment all below config
// server_path: seleniumServer.path,
// log_path: "",
// host: "127.0.0.1",
// port: 4444
},
test_settings: {
default: {
globals: {
waitForConditionTimeout: 30000,
waitForConditionPollInterval: 500
},
screenshots: {
enabled: true,
on_failure: true,
path: "screenshots"
},
launch_url: "http://localhost:8087",
selenium_port: 4444, // provide your selenium port in 1st step
selenium_host: "127.0.0.1", // provide your selenium address in 1st step
desiredCapabilities: {
browserName: "phantomjs",
javascriptEnabled: true,
acceptSslCerts: true,
"phantomjs.binary.path": phantomjs.path
}
},

Uable to access to localhost:8080 after upgrading NodeJS to 8.1.4

Our development group is starting a new React project and I have been trying to use Nightwatch + Selenium to do the e2e testing. I got it to work when running everything using NodeJS 6.9.4. Now we have been forced to upgrade NodeJS to 8.1.4 and I'm facing an issue that is stopping me to proceed with testing. When using Selenium with Chrome as browser, I keep getting a 'This site can't be reached' message (but the page can be accessed if I open manually a Chrome window. Any idea what can be going on? Here you have the test result log and my nightwatch.conf.js
Test Result:
INFO Request: GET /wd/hub/session/fc36e7a7-4909-4dfd-a853-6d769accb085/element/0/text
- data:
- headers: {"Accept":"application/json"}
INFO Response 200 GET /wd/hub/session/fc36e7a7-4909-4dfd-a853-6d769accb085/element/0/text (16ms) { state: 'success',
sessionId: 'fc36e7a7-4909-4dfd-a853-6d769accb085',
hCode: 972983271,
value: 'This site can’t be reached',
class: 'org.openqa.selenium.remote.Response',
status: 0 }
Nightwatch Conf
const SCREENSHOT_PATH = "./screenshots/";
const BIN_PATH = './node_modules/nightwatch/bin/';
``
// we use a nightwatch.conf.js file so we can include comments and helper functions
module.exports = {
"src_folders": [
"__tests__/e2e/specs"// Where you are storing your Nightwatch e2e tests
],
"output_folder": "./reports", // reports (test outcome) output by nightwatch
"selenium": { // downloaded by selenium-download module (see readme)
"start_process": false, // tells nightwatch to start/stop the selenium process
"server_path": "./node_modules/nightwatch/bin/selenium.jar",
"host": "127.0.0.1",
"port": 4444, // standard selenium port
"cli_args": { // chromedriver is downloaded by selenium-download (see readme)
"webdriver.chrome.driver" : "./node_modules/nightwatch/bin/chromedriver"
}
},
"test_settings": {
"default": {
"screenshots": {
"enabled": true, // if you want to keep screenshots
"path": './screenshots' // save screenshots here
},
"globals": {
"waitForConditionTimeout": 5000 // sometimes internet is slow so wait.
},
"desiredCapabilities": { // use Chrome as the default browser for tests
"browserName": "chrome",
"javascriptEnabled": true, // turn off to test progressive enhancement
"chromeOptions" : {
"args": ['--disable-web-security', 'no-sandbox', '--disable-async-dns']
}
}
},
"chrome": {
"desiredCapabilities": {
"browserName": "chrome",
"javascriptEnabled": true, // turn off to test progressive enhancement
"chromeOptions" : {
"args": ['--disable-web-security', 'no-sandbox', '--disable-async-dns']
}
}
}
},
"params": {
"baseUrl": "http://localhost:8080/",
}
}
Sorry for having the files attached instead of expanded on the comment but tho I have been using StackOverflow for a long time, this is my first request. StackOverflow
Apparently my localhost is not visible to the Selenium Chrome that is running. Needed to make my localhost accesible from outside my machine in order to get this running

Resources