I have a asp.net webpage with just a couple divs on it. Most of the work is done through javascript, JSON, and a webservice running on the same page.
My webservice has three different functions I use. All functions perform a select statement from the same database, the database that is being queried is located on the same machine the website is on.
I originally started working on the webpage on my local machine and could run all my webservice functions correctly and get a response. However, I am now trying to move the page to a server but I am having no luck.
When on the server the page loads correctly, which requires a call to the first function (this works fine). However on click of a button a second call to the function is made but I get a timeout error.
I tried running the functions directly from the server, and the first function works fine, however the other two do not, they give me a page error code 500. Any ideas what could be causing this?
I figured out the issue. I had some code on the two functions that was trying to get the hostname from an ip address but my webpage was being hosted on a computer in the network outside of the domain. So it was getting an exception when trying to convert the ip to a hostname. I resolved the issue by hosting the webpage on a computer on the same domain so that it could resolve the ip addresses to a hostname. Thanks for the help.
Related
I have a project with the following problem:
If the page is accessed directly via the domain, you can switch to any subpage without an error. However, if a URL is called directly, e.g. https://impalawolfmitbiss.com/consulting, a server error is issued. This actually affects every subpage that is not called from the main page.
Error Logs:
Apache server logs (500 GET /consulting HTTP/1.1)
Chrome Console Network: 500 Internal Server Error
Since I rarely have to deal with such applications, I just want to ask in advance if this is a known problem and if anyone has any suggestions for a quick solution or Tips i can search.
a note: if I start the application locally, the problem does not occur.
Site: https://impalawolfmitbiss.com
I have a site that is running in Node and using express for the server. I also have an API on a different server I need to hit. Everything works fine except in IE9. The issue is when ever i try to hit my API once i have the page loaded it breaks.
For example on the home page i have a search form where each step makes an API fetch and once I try to make my first fetch i get this error
"Unhanded promise rejectionError: Access Denied"
It seems like it has to do with a CORS issue since IE9 didnt have CORS and the era of the error message. Also when I make the fetched server side I have no issue, its just when the client tries to perform them.
Has anyone had an issue like this and if so how did you fix it?
Currently I am trying this but it hasnt worked yet:
First I changed my api host address to the current sites address with /api at the end.
apiHost: process.env.API_HOST || 'http://127.0.0.1:3000/api'
Then in my express server is run this:
app.use(modRewrite([`^/api/(.*)$ http://api.mysite.dev:8080/$1 [P]`]));
I was hoping to avoid making a fetch cross address with this but no luck as of yet.
Any help would be much appreciated
thanks!
To solve this problem I changed my host file for my machine to use mysite.dev for the 127.0.0.1 IP. Then went to mysite.dev rather than 127.0.0.1 when testing my site. Then did what I did above to get it to work
I am very confused about ip addresses and headers. So I'm sorry if my question seems simple.
I have gone through the answers listed here:
How to get the user IP address in Meteor server?
But I can't figure out how to make them work. For example, I am trying to use this:
Meteor.onConnection(function(conn) {
console.log(conn.clientAddress);
});
But nowhere can I find where to place it.
If I place it on the client side it says Meteor.onConnection is undefined. If I place it on the server nothing happens. I don't think you run it on meteor.startup.
Is there someone could give me a hand in explaining where to use this code? Specifically if anyone has built a custom tracking system, that would be great. Do you store ips into database? or how to record for tracking purposes?
Any hint will help! thanks
Place the code anywhere on the server. e.g. in server/main.js. There is no need to call it from within Meteor.startup.
Start the app.
Open your browser to the appropriate address (e.g. http://localhost:3000) - this will cause a web client to connect and run the code from (1).
Look at your shell output (the shell you used to start the app - not the browser console) and you should see your local IP address (127.0.0.1) printed.
This should work in production as well, however if your app is served behind a proxy (e.g. nginx) you will need to add the appropriate commands to pass the user's IP to your app. For nginx, see this post.
Here is the problem:
I have a web application - a frequently changing notification system - that runs on a series of local computers. The application refreshes every couple of seconds to display the new information. The computers only display info, and do not have keyboards or ANY input device.
The issue is that if the connection to the server is lost (say updates are installed and a server must be rebooted), a page not found error is displayed). We must then either reboot all computers that are running this app, OR add a keyboard and refresh the browser, OR try to access each computer remotely and refresh the browser. None of these are good options and result in a lot of frustration.
I cannot change the actual application OR server environment.
So what I need is some way to test the call to the application, and if an error is returned or it times out, continue trying every minute or so until the connection is reestablished.
My idea is to create a client-side page scraper, that makes a JS request to the application (which displays basic HTML), and can run locally on the machine, no server required. If the scrape returns the correct content, it displays it. If not it continues to request the page until the actual page content is returned.
Is this possible? What is the best way to do it?
Instead of scraping, check the status code in the response from the server. if it's not 200 or 304, you've received an error page and should try again.
Check out this link: http://www.ibm.com/developerworks/web/library/wa-ajaxintro3/#N102DB
This is a followup question to the one here
Here's briefly what I am trying to do. The File server creates a text file to indicate an end of the process. On a webpage on the Web Server, I loop every x seconds and make an ajax request to find out if the test file exists (ajax request to http://fileserver/files/UserFile.txt)
I've tried the following approaches so far:
Trigger a web method from the client side that creates a HttpContext object to verify if the text file exists. But this is too strenous on the server and I started getting all kinds of exceptions in the Event Viewer.
YQL works great but unfortunately it's too slow. The user waits atleast twice the amount of time.
I am looking for a solution that doesn't involve the server side. Somehow, I'd like to use JQuery to verify the existence of a text file on the fileserver.
Any thoughts?
You should be able to use JSONP and JQuery.ajax() to do cross-domain request work. Play with the jsonp and jsonpCallback attributes. Alternatively, you can use JQuery.getJSON().
Serving a single file from the filesystem is the most simple operation a web server can do. If that is already too much, then all other solutions will be worse. Find out why the server takes so long to serve a simple file and fix that.
Note: I'm assuming that the file is small since you say "test file". If it's a big file, the server will actually send it to the client which will need a lot of resources.
What you can try is to add an ASP page to the web site which runs code on the server that checks whether the file is there and just returns a tiny piece of HTML which you can add to the page with jQuery.load().
I may be miles off base here but... could you not create ONE asynchronous (!) Ajax client request with a HUMONGOUS timeout. Fire it, and wait. You would be invoking some server script that checks every so often, in a loop on the server (using sleep in between), whether the file exists. And not replying to the Ajax request until the file finally shows. The server script then replies and exits.
EDIT: Depending on the server-side scripting framework used, you may even get some OS support. You may be able to sleep on a status change in the directory...