Creation of AMI from operating wordpress site yield "connection refused" with elastic ip - wordpress

I created an AWS server and installed wordpress with an elastic ip address and verified that the default website was up and running.
I wanted to make a backup image at that point so that I could use it as a beginning point for other websites. However, after getting the AMI running and attaching the elastic ip address to it, I got an "connection refused" error. I can both SSH and FTP into the server, but the wordpress site is offline. I then switched the elastic ip back to the original server and got the exact same issue.
I'm guessing that this is a "change of ip" type error(?) (although, when I've seen that before, the connection has never been outright refused... it usually allows at least access to the admin area of the website) but I thought by using an elastic ip address that I would avoid that. I'm also confused by the error in the first server, since the database still has that address.
Any ideas about how to troubleshoot something like that? Is there anything else that it could be?

Well.... I missed something vital.
Using an AMI works just fine with an elastic ip address. I had forgotten to make sure the webserver (httpd) and mysqld were running with :
service httpd restart
and
service mysqld restart
What made it click was reading that the main reason for this error is that there is listener to the incoming data.
Duh.

Related

Wordpress not working after changing instance type on Google Cloud Platform

I changed my VM instance from "F1-micro" to "E2-micro". When I then restarted my machine, I couldn't access my webpage using the domain name, the webpage just shows an "Error 521" code - showing that my browser is working, CDN is working but the host has an erorr. When I paste the VMs IP address into my webpage, however, it show's the "Apache2 Debian Default Page".
Can somebody please help me with this?
The Error 521 message is caused by one of two situations:
First, check whether your WordPress site’s server is down. Even if everything else is configured properly, if your WordPress site’s server is offline, Cloudflare simply won’t be able to connect.
Second, your web server might be running fine but blocking Cloudflare’s requests. Because of how Cloudflare works, some server-side security solutions might inadvertently block Cloudflare’s IP addresses.
Cloudflare is a reverse proxy, all the traffic coming to your origin server will appear as if it’s coming from a small range of Cloudflare IPs (rather than each individual visitor’s unique IP address). Because of that, some security solutions will view high traffic from a limited number of IP addresses as an attack and block them.
Please check this link out in order to fix error 521 for Cloudflare and WordPress.
Turns out this problem was caused by my having installed the Debian Apache server package and it is causing collisions between it and the Apache shipped in the stack. Bitnami Stacks are completely self-contained and run independently of the rest of the software or libraries installed on your system.
So to fix this, all I had to do was run the following commands:
sudo systemctl stop apache2
sudo /opt/bitnami/ctlscript.sh restart

Drupal error when accessing sites: Can't get hostname for your address

I'm getting the following error when trying to access sites on my server through the browser. I can ssh to the server and I tried running a flush hosts command but that didn't do anything. The host in question is in the mysql user table and has a username/password and all relevant privs. This issue appeared since an office move and the server was switched back on. I can only think it of being a network issue of some sort.
PDOException: SQLSTATE[HY000] [1042] Can't get hostname for your address in db_table_exists()
How do I resolve this?
I think you need to check if the mysql hostname defined in $databases['default']['default']['host'] of the Drupal sites/default/settings.php file is reached by the machine where drupal is running.
Try to connect to ssh and do a ping or a telnet with the hostname.
Instead of the hostname try using the ip address. Otherwise, if the hostname is not resolved, try adding it to /etc/hosts if you're on linux.

unable to ping/send http requests to RHEL tomcat server on Azure

Note - I am fully aware that there are lot of similar issues posted before, but I tried NSG settings, psping but nothing seem to work
All, I brought up a RHEL7.3 server on Azure and installed JDK1.8 and Tomcat8. After starting Tomcat, I tried an http request from my browser:
http://XX.yy.zz.abc:8080/ but I was unable to get the index page
I also created an inbound security rule to allow HTTP and also allow IP range from our company.
Even worse is, when I tried pinging to this IP from my desktop computer, I am unable to ping the same - it is timing out.
Please note that in the past, I've been able to bring up servers and be able to connect from desktops without any issues - in a similar azure-companynetwork setup.
Am I missing anything here?
Ok, so pings do not work, you shouldn't even try that. What you should check is the firewall on you RHEL VM and check you've allowed port 8080 on you NSG, also your VM should have a PublicIP attached
According to your description, you had better check as the following ways:
1.Please ensure you could access your web by using 127.0.0.1:8080 on your VM.
2.Check your service listening.
netstat -ant|grep 8080
Please ensure 8080 is listening on tcp not tcp6.
3.Open firewall port on RHEL.
sudo firewall-cmd --zone=public --add-port=8080/tcp --permanent
More information about RHEL firewall please refer to this link.
4.Open port on Azure NSG.
NSG could be associated with NIC and subnet, you should check all of them.
All,
It looks like there is an input firewall inside of RHEL7.3 that is preventing connections. I just stopped it using
service firewalld stop
I am able to get the home page.

Configuring WL to listen for my IP address

I know how to configure WL to listen for a my IP address instead of localhost. I had done it in past and it worked as well. Today suddenly things are broken, as usual I started my server configured for listening to my IP address and I was not even able to open the WL console.
I thought it could be some proxy issue so I removed all my proxies and then tried but no help. Then just to be double sure I used curl and tried to GET the admin page but still no help.
Then I thought that it could related to some recent firewall blocking rules my company might have pushed so this link and added my port to unblock list for both inbound and unbound rules, but still not help.
Does anyone has any idea whether there is something I can do to debug or rectify this issue. Please note that I have already tried changing my WL listen address to "no address", specific address etc. but it doesn't help, and I have tried netstat -a -n command and I can see there is a connection listening for my IP:port, but in the end I cannot access that connection/socket or in other words I cannot access my WL admin console or my application
I am assuming that your servers and applications are running. But you are not able to access them.
In this case, You can start from here.
1. Verify whether you are able to ping the admin host. If so, see whether telnet is allowed on admin port.
2. Try accessing the console with both FQDN and ip address.
3. If vnc server is configured on your server which is hosting weblogic, try launching chrome from VNC to access weblogic admin console.

How to use external IP internally and using it with ownCloud? And WAMP shutdown

I have setup a server on of my PCs and I am running ownCloud on it. Everything is working fine but I wanted to ask a few things just to make the whole process more convenient.
How can I use a dynamic IP address in ownCloud? I have a ddns but, since I have a dyn external IP address, I need to put in the ddns again and modify the account when the IP changes. Is there a way through which ownCloud could work on the ddns and not on external IP address? (I hope you got what I meant) IMAGE: http://s27.postimg.org/r0224wfsz/Untitled_2.jpg
Also, is there a way to use the ddns(xyzz.co) in the same home network in which my server is? instead of the internal IP address(192.168.1.2). Because again, I need to modify the account when I am in the home network and when outside.
My WAMP server shuts down automatically like it would if I manually exit it. Is there a solution to that too? I have kept it on auto start on OS boot-up. But, I think that is not the solution.
Thanks a lot!
Why not let your router attached to your server cope with this? In the most recent routers, you can set your (D)DNS-settings.
You can set port mapping in your router to an external address. Then, when you are at home, you don't need to edit the settings of the sync client since you can always use your external IP-address.
I'd use cron for that. Look it up when you enter crontab --help in the terminal. On most distributions, cron comes with examples in the cron itself. So you can just edit it by entering crontab -e. Enough online, too.

Resources