EC2 Ubuntu Apache keeps Connecting - apache

I'm trying to setup an Apache server on an Ubuntu EC2 instance. I'm using 12.04 LTS, and I've tried with 14.04 LTS, but haven't reached a solution. I've scoured the internet looking for a solution but haven't found anything. My Apache settings are default and I've created a Security Group for HTTP. I also have an elastic IP associated with the instance.
When I load localhost using Lynx, I'm getting the Apache page. I cannot access it from my browser externally. The page keeps trying to connect and is waiting for it. When I nmap port 80 internally from the server, it says open. The weird thing is when I try to nmap the server from outside. It sometimes shows it's open and sometimes it shows it's down. I cannot determine the situation that causes this. It seems arbitrary to me at the moment. I've tried to launch different instances and I'm getting the same behavior. I've turned off ufw, and cleared iptables.
I am able to SSH and FTP to the server without any problems. I'm stumped, and very confused why something so simple can not work. Apache error logs are normal. I also tried with nginx and I'm getting the same problem.
Any help is appreciated!

Related

Visual Studio Code appears to kill my GCP VMs during Remote SSH

I managed to connect to my GCP (Ubuntu) instance from VS Code via remote-ssh but something it's doing appears to kill my VM instances. I can hit the server with the external IP and apache continues to run, but the virtual hosts are inaccessible.
Don't see anything meaningful in the logs. (It's possible that I'm not looking at the right one.)
Restarting the instance and Apache a few times appears to fix it, inexplicably.
Any ideas? Thanks in advance.

Mobile Access from Digitalocean apache2 connection timed out

I'm using Digitalocean cloud hosting server and apache2 in Ubuntu 16.04 VPS. I can browse the site from my local PC and check apache access.log to see the page requests. However when using a mobile device, I cannot get a response from the website. I can ping the server IP address from my phone successfully. However, any requests for the domain root do not create any record in the access.log.
I have attempted to uninstall fail2ban as per this threads:
https://www.digitalocean.com/community/questions/how-to-debug-solve-a-err_connection_timed_out-error-when-this-error-happens-on-some-browsers-but-not-in-another
http://installion.co.uk/ubuntu/vivid/universe/f/fail2ban/uninstall/index.html
I have also tried simply serving a phpinfo() page. However, no still no records in access.log when trying to access from mobile devices. The site is has https enabled and is serving perfectly to a PC.
Also, using a browser testing site (https://www.browserstack.com/) I also get connection timed out errors, and no response records in the access.log.
Any suggestions on where to start troubleshooting this? Is this possibly a problem with Digitalocean itself? Is there anything in the LAMP stack that would specifically be blocking some browsers or IP addresses?
It sounds to me like one of two things is happening here:
Your DNS is not set to point to that IP, but you set it in your operating system's host file on your computer.
Your DNS is correct, but other systems are not yet seeing the change you've made.
Try visiting the IP of the server directly from your mobile device. If anything occurs besides timing out, be it a redirect (even if failed) or a page load, you will know that DNS resolution is the issue. Given that you can ping the IP from your phone I would suggest fail2ban is not related, as fail2ban should block ping as well.
If it turns out to be #2 there, it's just a game of waiting. DNS changes can take up to 48 hours to be seen by all systems. In most cases 4-6 hours is common, but 48 hours is still the recognized standard of "it could possibly take this long."
Jarland

Can't connect apache running on Amazon EC2

Today I got one instance in Amazon EC2 with Ubuntu 14. Through SSH( A Java SSH Client directly from my browser (Java required) ) I am able to login and able to install LAMP server.
I also include Inbound rules in Security group.
But when I am trying to load apache from browser I got "This site is configured to require an SSL (https) connection." this error.
While trying with https then got unable to connect.
I didn't under the issue.
I have added ICMP in the security group and ping is working from my local.
Could you please help me to resolve this.
Thanks in advance.
I selected Ubuntu as operating system but I took another instance with Amazon Linux and it is working now.

connection failure with localhost server

after installing apache in my pc I cannot visit http://localhost.
firefox shows that :
Firefox can't establish a connection to the server at localhost.
what is the problem? can anyone help
This has nothing to do with your webserver.
Check http://kb.mozillazine.org/Error_loading_any_website .
There are many things that could go wrong in this case. My best bet is to check your proxy or firewall settings.
UPDATE:
Antivirus programs interfere with firewall and security settings, so you might take a look into that... Make sure the port that Apache is running is not blocked by your firewall. Go to the firewall settings and make sure that Apache (or HTTP port number used by Apache) is not blocked
In windows if you installed apache you have to start your apache service first then go throw your Firefox or other browser simply type local host then you can access your server.

Problems running ServiceStack as daemon on Linux (Ubuntu 13) as described on the wiki page

I have a problem running ServiceStack as daemon on Linux.
I just started to work into creating a REST API with C# on Mono. I studied your Wiki about it and yesterday I tried to run ServiceStack as daemon on Linux (Ubuntu 13) exactly as described on the wiki page:
https://github.com/ServiceStack/ServiceStack/wiki/Run-ServiceStack-as-a-daemon-on-Linux
But I encountered a problem, tried every possible solution I found in the web, but nothing helped.. The problem:
If I access http://127.0.0.1:8080 on the Ubuntu System everything is fine and I am beeing redirected to http://127.0.0.1:8080/metadata and get the Service Metadata.
If I access http://127.0.0.1:80 I get the static content. Also fine.
BUT if I access http://127.0.0.1/api I'm being redirected to http://127.0.0.1/metadata and get a 404. Which is absolutely understandable because there is no such thing on Port 80.
You know I'm not that good in apache, but after reading the configuration mentioned in the wiki I thought this should work normally. Am I wrong? Or do you have any idea how I can solve this?
Another problem is that if i access the service on my ubuntu system from another system, e.g. Windows through http://ubuntu-dev:8080, I get Bad Request (invalid host).
I also get the 404 there if I accesshttp://ubuntu-dev/api.
I think the Bad Request Thing must have something to do with servicestack because apache only listens on port 80 (as it should I think). Do you have any suggestions about this?
It would be really nice if someone could help me because I really don't know what to do with these problems.
Greetings, daily
It might be a problem that only occurs when it runs on a different port than 80.
Probably it's not redirecting properly when a port is set.
Try running it on nginx with fastcgi (fastcgi-mono-server4), there you can run it on port 80.