How to file upload mvc5 on cpanel server? - asp.net-mvc-5

I've created a project in visual studio on MVC5. As you guys can see in pictures bellow index.cshtml is in Views/Home/index.cshtml! So how can I upload it on cpanel server. As you guys know on server we need an index.html file to link! I don't know how to handle that, let me know if further details or project code is required... Please helpenter image description here

it will not work on cPanel hosting because its a Linux platform that will not support for your programming type. so take another hosting of a windows server if you want manged hosting than go with windows plesk hosting providers.

Related

Deploying ASP.NET Core 6.0 MVC app to Server doesn't work

I am new to web development, I am learning it on the way as I develop my application.
I have an ASP.NET Core 6 MVC app that basically does this:
Starts with a Login
After login you can view the data
You can manipulate data on the view page
You can view some logs, and acknowledge them
So, my app works just fine when I run it from VS 2022.
I would like to deploy the app, so it can be used within the company. It all works on an internal network.
I have two options for deployment and to host the app from:
Windows Server 2019 (IIS)
Synology NAS
It really doesn't matter for me, but I have been through more than a dozen of tutorials/videos, but could not get it work either way.
I have tried different publishing methods.
I have .NET Core Hosting 7.0.2 and Web Deployment installed on the Windows server.
Basically my published file structure doesn't look like in some of the tutorials.
The furthest I've got is that I can load the page on the Windows Server 2019 machine, it shows the login page, but after I press "Login" it says ".../LoginController" Page not found.
So, after this chaos, can anyone give me some guidance where should I look for the solution? I thought it would be a good idea to use MVC, but now I think it would be much easier with a simple ASP Web app...
Eventually, after I got to the Login page (as I mentioned), I figured out the problem there. I am using cookies, which were set to "secure" in the program, but I was usint http instead of https. As a test, I have set the cookies' "Secure" property to "false", after that it worked.
At least I know where to go next.

How to know web app framework by looking at the source code

I am more towards to infrastructure but want to learn web app.
I have been given access to Windows server + IIS, how do I know what web framework or even just what language of this web app? Thanks
install "Wappalyzer" browser extension
The extension automatically checks pages you visit and reveals the technologies the website is built with.

Can I use a Wix domain for a NodeJS app?

This may be a silly question but I was wondering if I would be able to use my wix domain mfall33.com when deploying my node app.
I'm not really sure how Wix is working, but if you paid for a domain name, you should be able to link your domain (mfall33.com) to an IP address.
So yes, you should be able to use your domain when you will deploy your node app.
I think you might have been a bit confused.
A Domain is the name of your website, i.e. the URL.
Wix is a system to build a website.
Node JS is a technology to build a server.
Today as Wix Code released, I believe you can send events from Wix (client side) to your Node (server side).
You can change the DNS in order for your domain to point to your Node server in case you don't use the client side of Wix.

How do you connect the frontend and the backend?

I'm still kind of new in programming and I'm not quite sure that this is the place to ask this question, but I can't find anything worthy on the Internet. Sorry on first place but I'm truly lost. All I can find is "just use wordpress" and things like that.
I'm trying to make a website from zero with HTML and CSS, and there I would have the front end. I know a little bit of backend but I'm still learning. The real question is: how do you mesh up all of this and put it on the Internet so others can see it? I know you have to buy a domain and so, but how do you put it all together? What do you exactly do with your server-side code if what you "upload" is the HTML code? Are there any good books on the subject or something so I can study it on my own?
Thanks in advance.
Read about web frameworks like Spring in Java or Django in Python. Start with a lecture of these to grasp a notion of backend and frontend working together:
https://www.quora.com/How-do-front-end-and-back-end-technologies-work-together
https://www.quora.com/How-are-the-front-end-and-back-end-connected
https://www.quora.com/How-does-frontend-code-and-backend-code-interact-with-each-other
EDIT
And don't forget to read about the MVC pattern.
If all you want to know is how to publish an html/css project to make your website live then you need a domain, hosting account, your project files, and an FTP program.
Buy a domain and hosting account through a website like godaddy. Once you have that then you basically have your own little server. A server is just a machine thats on 24/7 which holds your project and makes the files live on the internet for people to view.
Once you create your project, then use ftp software such as filezilla to connect to your server. Drag your project into the public_html folder and your website will be live!
I think the word you are looking for is "web server." Examples of web servers are Apache, nginx, and IIS. A web server is a computer program.
A simple web server is sometimes called a "static web server."
To see a bit how this works, you can install a static web server like http-server on your computer (which requires Node.js to run), point it at a directory, and browse the site on your own PC.
So if you have a folder called "my-site" and a file in it called "index.html" and you ran the http-server in the my-site folder, and you went to http://localhost:8080, you would see "index.html" in your browser.
To put all this on the internet:
First, if you have an internet connection at home then you could technically set something up on your laptop that people could connect to. I won't get into it here because it's a little involved, but I think it's important conceptually to understand that you could do it if you wanted to.
You need to get access to a web server. A relatively fast way to set this up would be with zeit.

Web API 2 project and MVC 5 Website project in same domain

Technologies used:
BreezeJS
OData
Web API 2
MVC 5
IDE: Visual Studio 2013
I've been wrestling with the idea of having a Web API project and a separate web site project in a single solution.
My Web API 2 project opens up as: localhost:2020/ExampleProject.API
My MVC 5 WebSite project opens up as: localhost:5050/ExampleProject.WebSite
Now by default web api doesn't allow cross origin policies. So I played around with enabling CORS in my Web API 2, although I was able to get it to work, it only works for the latest browsers; I need the backward compatibility of IE7 to IE9.
So I played around with JSONP. I'm not fond of the lack of support that exists for this. I was able to get it to work for my Web API 2 project, but it doesn't work if I wanted to use BreezeController if using the breezejs web api library. It also doesn't work if I wanted to create an ODataController.
So I'm moving away from the idea of cross origin sharing; though hoping that in the future there will be enough support for jsonp regardless if I use BreezeJS WebAPI helper or ODataControllers.
For now, I have no idea how to put my WebAPI project and my MVC 5 Website under the same domain where I can have:
localhost/ExampleProject.API
localhost/ExampleProject.WebSite
Do I have to make some configuration in my host file? if I want to run my projects from VS2013 would it be able to run both projects under the same domain.. or do I have to keep on manually changing the URL in the browser?
Well, the answer was really really simple.
I know this an old question, it was just that I forgot how to do it since it's been so long since I did this. Searching for the answers on google and on stackoverflow was difficult since the discussions talked about setting up cross origin policies instead of setting up a same origin policy.
I spent the good portion of my time putting everything on IIS.
Created a website and had it point to the physical path where my website csproj and bin folder is located. I gave it a hostname of "dev.example.com" and changed my hostfile for 127.0.0.1 to refer to dev.example.com
Created a Web Application for the website, and set it up for web api 2 project. Everything magically worked after that.
The dumb part was, I could have easily done this in visual studio. I remember in VS2010, this cause many problems, but in 2013, I guess bugs have been fixed and it works now.
I had my WebSite project set up as
localhost:2020/ExampleProject.WebSite (incorrect)
instead of
localhost:2020 (correct)
and created a virtual directory. I do this by right clicking the project, going to properties, under "Web" tab.
So basically, the rule of thumb was to get my website to be my main root domain, and to copy that full domain to any web application I want to add under it.
So: website would be:
localhost:2020
web application:
localhost:2020/ExampleProject.API

Resources