Trying to run a local website - asp.net

I can get a website to run locally on "localhost" but I have more than one website I want to run locally and trying to set one up as dev.dfwcraftbeer but for some reason it doesn't work. I get "ERR_NAME_NOT_RESOLVED" from Chrome. Here was my process for setting it up:
"add website"
site name = "dev.dfwcraftbeer"
Physical Path = "C:\inetpub\wwwroot\dfwCraftBeer\dfwCraftBeer"
Binding = "http All Unassigned port 80"
host name = "dev.dfwcraftbeer.com"
I'm using IIS on my windows 10 laptop.
Why will it not come up? What am I doing wrong?

It sounds like you need to edit your host file. So that that domain name will resolve to your local machine. Just add your domain name dev.dfwcraftbeer.com to the hosts file and point it to 127.0.0.1. See the link to find out how to do it.

Related

Nginx Static files for Flask Admin Page

I have trouble serving the static files for flask admin page.
admin = Admin(app, name='APPName', template_mode='bootstrap3')
app.config['FLASK_ADMIN_SWATCH'] = 'Slate'
Everything seems to be working on localhost but when I upload the application to the server(ubuntu) the bootstrap template no longer works.
The route to the static files for the Flask admin is
http://127.0.0.1:5000/admin/static/bootstrap/bootstrap3/swatch/Slate/bootstrap.min.css?v=3.3.5 on localhost.
On the server its https://domainname.com/admin/static/bootstrap/bootstrap3/swatch/Slate/bootstrap.min.css?v=3.3.5 but its returning error 404.
Can anyone can point me to the right direction.
I know this probably comes late, but here:
Solution
Change your second line:
admin = Admin(app, name='APPName', template_mode='bootstrap3')
app.config['FLASK_ADMIN_SWATCH'] = 'slate' # This line: 'Slate' to 'slate'
Context
I was having the same issue you did. In my case, my config file contained this:
# Flask Config
FLASK_ADMIN_SWATCH: str = "Superhero"
Worked locally, but not when deployed to an EC2 machine running CentOS, I got a 404.
I was running Windows locally and a Linux-based remote machine. I bet you are as well. Windows is case-insensitive, while Linux is case-sensitive.
Having the FLASK_ADMIN_SWATCH variable set to Slate means the path that arrives at flask is something similar to admin/static/bootstrap/bootstrap4/Slate/bootstrap.min.css?v=4.2.1. This doesn't present an issue for Windows, but it does for Linux.
Swatch themes reside inside flask_admin/static/bootstrap/bootstrapX/swatch/, each of them on a folder of their own, and all of them lowercase (e.g.: cerulean, cosmo, etc.). Your specific theme directory is flask_admin/static/bootstrap/bootstrapX/swatch/slate/.
Windows will try parsing bootstrap/bootstrap4/Slate/bootstrap.min.css?v=4.2.1 and succeed at it, because it doesn't care for the case-ness of Slate, but Linux does, that's why it fails and ends up returning a 404.
# These paths are equivalent for Windows, but not for Linux.
bootstrap/bootstrap4/Slate/bootstrap.min.css?v=4.2.1
bootstrap/bootstrap4/slate/bootstrap.min.css?v=4.2.1

Vagrant and wordpress not working

Recently I have started using vagrant for Wordpress development.
The installation process and everything else went well. But when i try to access the page I get to see this:
enter image description here
It also loads really slow. Any ideas?
To be able to resolve salesacademie.dev, you will need to add the name to your hosts file. The line you need should look something like
salesacademie.dev 127.0.0.1
With that change, you should be able to download the assets (and the site) using that name assuming that vagrant's port forward is for port 80 (the standard http port).
Alternatively, you can reconfigure your Wordpress to not use the name salesacademie.dev but 127.0.0.1 instead. Then, you don;t need to edit your hosts file. However, you will not be able to run several websites concurrently on your vagrant server then.

IIS - Create a local host name and use it

I'm new to IIS and I'm trying to use a local hostname to differentiate my web projects. Basically, what I want is to do something like:
http://myproject.dev
and access it directly via the web.
Normally, with an Apache server, I would create a virtualhost and I would add an entry in my hosts file.
So, I tried to do the same with IIS. I created a a website as follows:
In my hostfile, I then added an entry:
127.0.0.1 myproject.dev
However, when I type the address, I'm redirected to my IP Address and I can't see the website.
Am I missing something?
Edit 1:
aha, I got it, it is host file issue, just remove:
127.0.0.1 localhost
or comment it because it make everything go back to 127.0.0.1
and write yours like this:
127.0.0.1 myproject.dev
You just have to create a folder in c: --> inetpub --> wwwroot than just type localhost/yourprojectfolder..

Visit Nginx sites-enable without domainname in place

I was wondering, I regularly set up a new Drupal site in Nginx, I download the files, get the database in place and then.... I wait... for the DNS to resolve because I have no idea how to access the site without going through the domain name as stated behind "server_name".
Does anybody know how to access all the sites in sites-enabled without using a proper domain name?
The simplest way is to resolve domain name to IP locally. You can use hosts file for it. Just edit /etc/hosts file if your home OS is Linux, or C:\Windows\system32\drivers\etc\hosts if Windows.
Add ip.of.ur.sever domain.name.com line, save file and restart browser.

Put file at specific port on Localhost

I need to put a file at this address: http://localhost:51547/file.txt
What folder would I put it in on C:/?
Tony
If I understand your question correctly and you're trying to expose a file via the ASP.NET development server at that location (http://localhost:51547/file.txt) I'm afraid the answer is not quite to your liking.
Basically I don't think you can serve files from the root of the ASP.NET development server (i.e right after the localhost:port/ part - the port is automatically selected by ASP but you can also manually configure it). ASP.NET automatically creates a virtual application path right after localhost:por> and so you're most likely going to be limited to serving files from the virtual application folder. So, assuming you web application name is: "testApp", if you put a file called file.txt in the directory where you're storing the source code for "testApp" it will also become available when you're testing at: http://localhost:port/testApp/file.txt (note the testApp in between the host-name & port, and the file-name)
UPDATE
In light of you comment, here's something you could do. You could try to get a simple HTTP server installed on your development computer and have it serve files on a different port (say port 8000). In that case you would serve file.txt using this secondary HTTP server and it would be accessible at: http://localhost:8000/file.txt.
You could try to install Apache or use IIS which comes with Windows. For Apache, the quickest way to get it going would be to install a WAMP environment. You may also try Lighttpd, and also note that MySQL or PHP are not required at all if you're only serving static files.
Any folder you want. The port designator is specified in IIS itself.
http://support.microsoft.com/kb/149605
I suggest you that if you want to do a site(HTTP) is better to use the port 80 or to do a redirection for another port, remember too that localhoost is a loop back and also take a look at PortForward to check some ports that are used by specific applications and types of servers, and please improve your question.
Regards.

Resources