What is the mechanism behind rendering web pages locally? - windows

When I visit a web site, my browser sends a request to a an HTTP server, such as Apache or IIS. The HTTP server then forwards the request to the appropriate web server, .NET, PHP, Ruby on Rails, etc. This then returns a response to my browser and the page is rendered.
How does this work on a local web page? Say I create a simply hello world in PHP (hello.php) on my windows desktop. I do not have IIS installed, so what is handling the "request"? That is, what is telling my request to be interpreted by php and how is this getting back to my browser? I have tried several google searches, but I suspect my search terms may be too vague.

The question is a bit ambiguous. A PHP file on a disk simply won't be rendered unless it is present within the Document Root configured for the web server.
For example if your file is present within C:\PHP_Scripts, then C:\PHP_Scripts must be configured as a document root for your web server.
For more information on how to setup document roots within Apache HTTP server refer to the below link :
Apache Web server Document Root creation
Having said this, in your case assuming the file (say test.php) is now present under C:\PHP_Scripts and this has been configured to be part of the Document Root of the web server; the following happens when you request http://localhost/test.php:
The web server refers to the document root and searches for the file named test.php.
Since this is a php file, the PHP interpretor kicks in and processes the script.
The results of the processing are rendered back to the user. In some cases, the processing may be a task like submitting the data to a backend and redirecting the user to another page.
Note that Apache HTTPD server must be configured to work with PHP for all the above to be true.

If you can run PHP on local machine, your machine is probably installed with web server with PHP interpreter (either Apache with PHP, XAMPP, MAMP or similar software installed).

Related

Windows authentication box pops up with integrated authentication on web page

I am running two Windows server 2016s with IIS 10.0.14393. One server for staging purposes, and one for production.
The application has one "front-end app" and one "back-end REST api" running on the same IIS server. The front end communicates with the backend (suprise!). The difficulty I am facing is that the staging server works as expected, i.e no "Sign in" box appears when entering the front-end web page (React). However, on the production server this box pops-up.
When the page is loaded, there is javascript that fetches some information from the API, and it seems that this async fetch is causing the pop-up to occur (the request is in pending mode until login).
I have studied the configuration of IIS on the two servers but can't seem to find any obvious differences.
Both instances have both windows authentication and anonymous authentication turned on for both front-end and backe-end. I need this as the API has different types of authentication for the endpoints.
Anyone that has solved a similar issue?
Thanks
If someone experiences a similar issue the following link may help: https://support.microsoft.com/en-us/help/258063/internet-explorer-may-prompt-you-for-a-password
In my case I was sending the request to the api with the full domain url. The problem was fixed by just using the machine name (and port in my case) when sending the request. If the whole domain with punctuation is used, the system believes that the request is meant for the Internet and not the intranet, and will not include any credentials.
Another, and probably more robust solution, is to add the site in question to: Internet properties -> security -> Local intranet -> sites -> advanced.

Unable to render HTML. Unable to access URL. COM error 800c0019 in FACILITY_INTERNET. The drive cannot locate a specific area or track on the disk

I am getting the above error message in production when trying to call the AddImageUrl section of ABCPdf (version 10). This started occurring yesterday just after midday my hosting provider assures me nothing has changed I am the only developer on the project as was working on something else entirely.
The URL provided in the stack trace can be accessed in IE on the web server without any error messages (including SSL). There is also a UAT environment on the same web server in which the PDF works, the UAT environment is identical in code and application pool settings, the only difference is the web address and database.
The HTML the PDF is calling can take a little time to come up on first load. Given that data is different I have increased the timeout from 15 seconds to 2 minutes.
I have arranged a reboot to see if that fixes it, but I have run out of things to check.
Edit: I did think of one further check, could I add the image of a page not on the site (https://www.google.co.uk/), doing this resulted in the same error so it appears not to be a blocking issue on the worker process.
—
Edit2: switched to the gecko engine and it is now working.
You can sometimes get this error if the web browser within Abcpdf cant access the URL.
On the webserver add the URLs directly to the local machine hosts file
C:\Windows\System32\drivers\etc\hosts
The entry should look something like this
127.0.0.1 example.com

Can I run a http server in nativescript?

Is it possible to run an in-app HTTP server with NativeScript either as a background service or as part of the foreground app itself ? I am looking to utilize a common code base across a system of applications which would communicate to a local server which handles some parts of the application's communication to my servers. Where, I intend to create a HTTP server in the app which can just serve as a REST server for the app. Is it possible ?
Thank you.
I don't think its possible since nativescript doesn't offer any module or plugin that supports the creation of http servers. First option is to look for a nativescript module in npm that supports http server creation, Second option is to create an http server using the native API's with javascript, Third and last option (which I prefer) is to make your own server using nodejs or any server side script and run that server on a certain machine then from your nativescript app you can access that server using the fetch module or the http module :)

Installing ColdFusion 11 on Windows Server 2012 / IIS 8.0

I've done this many times in the past, but this is new, and I think CF11 is the problem. Not sure.
Fresh Windows Server 2012.. installed CF11. Selected "Configure All IIS Websites" during install. There's only two sites configured in IIS -- Default, and one other, which has its own name (test.mydomain.com) configured in the hosts file and in DNS. In its webroot is a single index.cfm file, and a subdirectory thereof, is an actual ColdFusion web app.
When I browse to the webroot, I get a standard Microsoft IIS page, rather than the index.cfm file. If I browse to the subdirectory, I get 404.
I've set index.cfm as the default document.
The path specified to the webroot is correct.
If I run the wsproxyconfig.exe file, it shows nothing is configured. I click Add, select IIS. In the drop-down where you configure a specific site, it says None and is not selectable. If I try to add, I get the error, "Unable to configure WebSocket Proxy Enable the required WebSocket Protocol option in IIS." I've looked all over IIS and can't find where this setting might be.
What's interesting is I can get the cfadmin page to load and function just fine (127.0.0.1/cfide/administrator)... there are no port numbers in that URL so it must be passing through IIS. So I'm not really sure what the problem is. Is it the connector? Is it something else? I'm stumped.

Access the IBM AJAX Test Server over HTTPS?

I'm using the AJAX Test Server in Rational Application Developer. I'm posting a form to another host for authentication. That host takes a URL to redirect to after authentication. However, it insists on using HTTPS whenever it sends the 302 response. The low hanging fruit would be to just use HTTPS locally.
Looking at the launch configuration, the AJAX Test Server appears to be a custom Apache HttpCore server. I haven't spotted anything in the configuration guide.
Is there a way to access this test server via HTTPS?
This is for demo and local development purposes; not production.
Speaking from working with WAS (WebSphere Application Server) in RAD, I'm pretty sure the answer would be yes. The server (at least with WAS) has both secure and "unsecure" ports.
What I have noticed is that when the server is built with the install (at least with the newer versions of the products 7.5+), the ports used are different per install. This is to help with not conflicting with other applications that may use those ports.
So https is probably fine. You just may have to use it over port 302 or some other port.
If there is no admin console for viewing your ports, you could always try the Window | Preferences option under your menu items. Sometimes IBM hides server config stuff in there.

Resources