How to serve html page or AMI test page in browser on new amazon ec2 server - linux

I got an Amazon ec2 server and when I go to the URL (Public DNS (IPv4)) in my browser I get "ERR_CONNECTION_TIMED_OUT"
I did the tutorial "Installing a LAMP Web Server on Amazon Linux" http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html
But got stuck on "If you are unable to see the Apache test page, check that the security group you are using contains a rule to allow HTTP (port 80) traffic."
I checked the security groups and they both set to "All traffic
All
All
sg-7496280c (default)"
And I still can't see the test page. I've also tried using the public IP address and I get the same thing.
There were no errors when installing packages.
I am able to connect using winSCP and upload html files but it doesn't serve them.
I don't know if I'm doing the right tutorial, or if I need to do other things first, or which tutorials apply to which types of servers or if ec2 and aws are the same thing or not etc.
I tried contacting support but it said I don't get technical support for basic accounts. I tried posting this on Amazon forums but it said something like "you can't post new threads right now, try again later"
I'm only doing any of this because you can't run node.js on hostgator.

ERR_CONNECTION_TIMED_OUT only happen either your apache not running or your server or your server is redirecting too much
Just I am unsure where you uploaded your HTML file and with what permission.
Do the basic thing reinstall only apache first.
check in your inbound and outbound port in aws security group in aws dashboard
if 80 port is open with anywhere option
check for
security rule
See if apache default page come. then upload your file.
can you tell in what directory you uploaded all your HTML

"ERR_CONNECTION_TIMED_OUT" can also be happen if you have not properly configure security group while creating the EC2 instance as it allows specific traffic to reach your instance.
If you want to set up a web server and allow Internet traffic to reach your instance, add rules that allow unrestricted access to the HTTP and HTTPS ports.
and copy Public IPV4 and use to visit the webpage rather than copying the url.

Related

IIS: front end server not connecting to website

I am newer to IIS so please forgive my ignorance. Here is my situation. I have a backend server that resides on ip xx.xx.xx.175 from here I have all my code and IIS installed here. I created a website and can access it just fine using localhost:3000. When I go to the frontend server which resides at xx.xx.xx.174 I cannot connect to the site using the URL.
I have updated the bindings, I have updated the firewall rules, I have also used netsh http add iplisten and I still cannot connect to the site. I am not sure where else to go from here as all of my Google searching lead me to the same things.
Please make sure you have added the ip address in the host file:
Open your text editor in Administrator mode.
In the text editor, open C:\Windows\System32\drivers\etc\hosts.
Add the IP Address and hostname. Example: 192.10.10.5 testserver.com.
Save the changes.

How do we show a page from our app but using a custom domain owned by a user

We host an angular app (e.g. render.our-app.com) hosted on now/zeit. This app allows a user to show a presentation. The presentationId needs to be included in the path e.g. https://render.our-app.com/. We are looking to be able use a custom domain owned by the user, to show a presentation we no redirects.
So for example, the user has a domain (website.mycompany.com) and we want to show the presentation under that custom domain but using our app.
website.mycompany.com => render.our-app.com/12345 (12345 = presentationId)
We are not sure how to do this properly. We tried to use a cname but we get an error saying:
404: NOT_FOUND
Code: DEPLOYMENT_NOT_FOUND
(The error is very now/zeit specific)
We thought that http://website.mycompany.com/12345 might work.
We are not sure how to do this :(
Thanks
The steps involved probably would be:
Set up a virtual host on your server for website.mycompany.com (or maybe use a ServerAlias directive if you are on Apache. This is where your app will be hosted.
Edit the host file of the computer that will be used for the presentation, in that host file you add an entry for website.mycompany.com, that points to the IP address of your server. By doing so, you bypass the normal DNS resolution process. Rather than connect to the 'true' address, the PC will connect to your demo server.
There is a gotcha: SSL. You can create a self-signed certificate on the server, and then you add it to the list trusted certificates on the client (demo PC). This can be done the first time you launch your browser and get an alert about the self-signed certificate.

Application Request Routing: Why some sites return HTTP 404 some don't?

I want to add a load balancer to an existing asp.net project using Application Request Routing. So I made myself familiar with the concepts and created a local test-setup:
IIS locally running on Windows 10:
Installed Application Request Routing 3.0 with Windows Platform Installer
Created server farm with following servers:
<test-server-name>.de (Microsoft 2012 R2 Server: contains the asp.net project)
www.google.com (just to see if load balancing and url rewriting works because I don't have two test servers available)
URL-Rewriting rule:
After typing localhost multiple times in any browser, I can see that load balancing (weighted round robin) is working fine. It's alternating between 1. and 2. website.
The problem I'm facing is a 404 Error on both websites.
I already tried the following:
Installing and enabling Failed Request Tracing Rules (on local IIS): URL Rewriting is working properly i think.
Failed Request Log for www.google.com: google drive, unzip and open xml in e.g. IE for better view
Create Server Farm without automatic creation of URL Rewrite rules
(selecting No and create own URL Rewrite rule)
Change "Managed Pipeline Mode"-setting of Applcation Pool from Integrated to Classic
Healthcheck on other Websites I have absolutly no clue why it's working on Git-websites and why facebook is returning a 400 error code.
Enabling/disabling proxy (IIS-Manager -> Application Request Routing Cache -> Server Proxy Settings...)
I don't know what i could do next, so I appreciate any help. Thanks.
Answer can be found here: https://forums.iis.net/t/1238739.aspx?Why+some+sites+return+HTTP+404+some+don+t+
Some websites simply don't support localhost as hostname, which is why localhost can't be found (error 404) e.g. on google.com
Detailed answer if link above is not working in future:
That is not an effective test.
What you are doing is sending the hostname of your request to the third party servers. Like Google.
So if your request is say http://example.com you are sending this to say www.google.com and the Google servers will likely reject this as you can see
Web server admins generally don't let themselves receive traffic from domain thet do not host.
If you sent a request to my servers IP with mysite.com I too would likely reject it. (Things get complex if you have wildcard sites and you allow all traffic through)
But simply showing that 404 page from Google means tour request hit there server so that implies ARR is working.
If you really wanted to test it this way have a local host file with www.google.com resolving to your servers IP. Set up a site with www.google.com as the hostheader and then you should see the correct info hitting Google. But there is no accounting for what 3rd party admins do on their side.

Temporary URL working fine, But the domain when pointed to the site shows CWP HTTP test page

I installed CentOS7 on Amazon EC2 instance, I also installed latest version of CWP(CentOS Web Panel). I created a new user 'myuser'. I associated a domain 'myuser.com' with the user. I uploaded the website files into '/home/myuser/public_html/' and I deleted the default HTTP test index.html present in the same directory. Now I can access my website at http://IP_ADDRESS/~myuser
But when I point 'myuser.com' with my server IP - IP_ADDRESS, it shows CWP HTTP test page. I even modified my host file to make 'myuser.com' point to IP_ADDRESS.
It just shows CWP HTTP test page.
Please someone help me in solving this issue.
Thanks in advance.
I got that just googling for "default page cwp"
Take a look here -> http://forum.centos-webpanel.com/apache/default-page-displayed-for-all-domains/
For Google compute engine (Maybe same scenario in Amazon) in CWP Setting don't use the same IP that is being used for cwp admin panel. Use the default IP that will be suggesting just below the field of Shared IP in cwp setting.
In google compute VM Instance you'll find two IP's internal and external
For domain name server setting use external IP while in cwp setting change Shared Ip to your internal IP.
After 10-15 minutes use Kproxy to browse your site again should work then.
Its just temporary issue. Clear browsing data. This mainly happens in Google Chrome. As you didnt open http://IP_ADDRESS/~myuser before creating newuser, you could view uploaded files, as you might have opened myuser.com before uploading and after pointing to server IP, you are still seeing default cwp template.

Jenkins URL with own domain

I have installed Jenkins Continues Integration system on my windows server successfully and it works without any errors. But I was unable to get Jenkins URL working with my host domain. The default Jenkins address which is http://localhost:8080 works well. My domain/server name is projectdev so I want to give Jenkins the http://projectdev/jenkins URL so that other developers in my network will be able to access Jenkins dashboard easily.
Although I added http://projectdev/jenkins as the Jenkins URL from the Jenkins configuration sections, it doesn’t work. I can’t access it from other computers in my network. But when I use http://localhost:8080 I can access the dashboard directly.
I also tried to add Jenkins as a web application on IIS and give it the address I want. But I don’t know what to provide as the physical path of Jenkins as it was installed using Jenkins.jar file.
It would be really great if someone can help me to get this done as I want.
Thank you.
You have to configure IIS to re-route requests to {domain}/jenkins to {domain}:8080/jenkins
check the info on:
http://www.iis.net/learn/web-hosting/microsoft-web-farm-framework-20-for-iis-7/setting-up-a-server-farm-with-the-web-farm-framework-20-for-iis
Try this address: http://projectdev:8080/jenkins If you type without 8080 port , the port will be 80 by default.

Resources