|Unable to connect to MSSQL server on Amazon RDS using NAT instance|
Your problem is a little bigger than security group changes. The main
problem is that your private vpc is private as in 'not internet
You have several options to connect from outside:
Use a bastion machine as an intermediate hop (on the public net) and add
relevant SG rules to hop form that machine into your precious DB. Your
users will need to connect to that machine and then either run client tools
on that machine to connect to the DB or setup a SSH tunnel to your DB (so
your office machine could connect). This is not a great solution in term of
users experience and in term of security (the bastion become a very big
security risk) but it is simple to setup. (Note: since you are MS dude then
please switch SSH for RDP [and cancel the tunneling thing])
Setup a VPN - bring a
|Cannot connect to PostgreSQL Remotely on Amazon EC2 instance using PgAdmin|
Do you have a firewall blocking port 5432? A quick nmap shows that it is
nmap -Pnv -p 5432 ec2-54-251-188-3.ap-southeast-1.compute.amazonaws.com
Starting Nmap 6.00 ( http://nmap.org ) at 2013-07-21 11:05 PDT
Nmap scan report for ec2-54-251-188-3.ap-southeast-1.compute.amazonaws.com
Host is up (0.19s latency).
PORT STATE SERVICE
5432/tcp filtered postgresql
What does the iptables on your EC2 show for port 5432?
[after OP added more details]
Netstat shows that it is listening, but the firewall output doesn't look
like the 5432 port is open (I confess to not being much of a network guy).
Referring to some of my notes from previous installs, you might need to
open up EC2 port 5432 to your IP.
To allow input firewall access, replace Y
|Asp.Net: Retaining the old browser session after closing and reopening browser instance|
You cannot reclaim the session-id as such, but you can certainly restore
some of the predictable part of the session state. If you are using forms
authentication, then just read the forms-auth cookie in global.asax session
start and re-populate the session objects.
You can control the expiration of forms-authentication cookie manually by
creating a persistent cookie by using:
Alternatively, you can fine-tune the expiration by manually changing the
Dim authCookie As HttpCookie = FormsAuthentication.GetAuthCookie(userName)
Dim authTicket As FormsAuthenticationTicket =
Dim newAuthTicket As New FormsAuthenticationTicket(authTicket.Version,
authTicket.Name, authTicket.IssueDate, expireDa
|Connect to an EC2 instance running MySQL from another EC2 instance|
You should always use the private IP when possible for ec2 instances
communicating with each other.
Among other reasons, you will get charged money for using the public ip
even though the machines are started in the same availability zone.
Also, the security group is just a set of inbound and outbound rules, it
doesn't matter that the two machines are in different groups with different
rules so long as your mysql server can accept traffic on the port from the
other ec2 instance based on the ruleset.
If you're going to be starting and stopping instances frequently, you might
benefit from creating an elastic IP and attaching it to instances as needed
instead of constantly changing configuration files.
|How to access Amazon AMI ec2 instance in GUI|
Very brief answer. It is not amazon linux specific because I don't use it
but should give you enough hints because it is Red Hat based AFAIK.
Basically you need to install the GUI you want to use (xfce, gnome, kde,
etc.) and vnc server. try yum search vnc and yum search gnome to find out
what packages do you need to install.
You then start vnc server on the machine. You do the above through command
line console. If it works for you you may make VNC start with machine boot.
I don't know which tutorial is good for putty port forwarding because not
using windows but this looks promising to me:
With linux (perhaps if you install cygwin on your windows that will be
possible for you as well) one usually can start a remote vnc session with
|Cant get Amazon EC2 instance work|
You need to check the security group that is associated with the instance.
Make sure that you open up port 80.
Also make sure that apache is started, and configured to start on boot.
If you're logged in, you should be able to use wget localhost to verify if
apache is serving up pages.
|connect visual studio and sql express on amazon EC2|
Assuming that you have a connection string (to server
ec-xxxxxxx.xxx.amazon.com), your problem could be that the .Net instance
(let's call it NET) and the SQL Server instance (SQL) don't have the rights
to see each other.
Create two instances with the different security groups
On both groups, you'll like want to open RDP (you probably have that
already as I can read)
On the SQL instance security group create an inbound rule for port 1433 and
open it only for the security group of WEB. Otherwise, the whole world can
access your SQL Server Express database. Like this, only the WEB instance
can access it. You need to paste the security group id of WEB into the
inbound rule for SQL to do that.
|How to figure out the 'Public DNS Name' from within an Amazon EC2 instance?|
Take a look here, but use public-hostname instead of instance-id.
|Deploying code to Amazon EC2 instance|
It is, but consider that...
If you have SLAs, and they fall within SQS Limits (Maximum 4 Days), you
could consider publishing your task queues into SNS/SQS, and use CloudWatch
to track the number of needed instances.
If you have a clear division of roles (more like a workflow), and the
long-running tasks are not of much concern and you can retry, also consider
using AWS SWF instead. It goes a bit beyond of a SQS/SNS Combo, and I think
it could fit nicely with CloudWatch (thats just a theory, I haven't looked
further). Cons are the extreme assh*le AWS Flow Framework for writing the
If your workload is predictable (say, around 5K processes to process
today), meaning you have no need for real-time and you can batch those
requests, then consider using Elastic MapReduce for
|In java, how can I get an Amazon EC2 Instance to see its own tags?|
You should be able to get the current instance id by sending a request to:
http://169.254.169.254/latest/meta-data/instance-id. This only works within
ec2. With this you can access quite a bit of information about the
instance. However, tags do not appear to be included.
You should be able to take the instance id along with the correct
authentication to get the instance tags. If you are going to run this on an
instance, you may want to provide an IAM user with limited access instead
of a user which has access to everything in case the instance is
|Installing Perl DBI on amazon instance|
So After some googling I found this link about make failure on Ubuntu Forum
And post#3 worked for me
sudo apt-get install libyaml-perl
sudo perl -MCPAN -e 'install DBI'
(apart from the step in above question)
a) sudo apt-get install build-essential autoconf automake libtool gdb
b) sudo cpan DBI
a) sudo apt-get install mysql-server
b) sudo apt-get install libmysqlclient-dev
c) sudo cpan DBD::mysql
I need all of the above steps as I have fresh instance
|Login Amazon instance with pem and password|
You can use IAM groups and users. The documentation is here.
IAM allows you to generate separate access keys for users with restricted
|Amazon autoscaling scale-down instance|
you need to specify ami id for template ami only. all will be scaled up and
down based on this single ami id. PLEASE NOTE: it is an ami id or image id
that will be utilized and not an instance id.
The scale will be a range from 1 to 3 and will be configured in your
autoscaling group with these tags: --min-size 1 --max-size 3 based on the
metrics that you supply in the autoscaling policy.
With a minimum size of 1 instance, 1 instance will always be running. With
a maximum size of 3 instances, 3 can run. There is not a need to scale non
Here is a complete tutorial:
|How to change the instance type in amazon ec2|
For whatever reason, Amazon's HVM based AMI is not compatible with the
Amazon has hardware virtual machine (HVM) based AMIs, and paravirtual
machine (PVM) based AMIs. From that error message, AWS is saying that your
current instance is HVM based, and t1.micro size will only support PVM
The way round this would be to create a new AMI from your instance and
launch a new instance from that AMI as t1.micro size. Be careful, though,
this may just create an HVM-based AMI, in which case you will need to
snapshot the volume for your current instance and create a new AMI from
Some more information on HVM:
|Amazon AWS SDK PHP 2 - Filter tags by instance?|
The API docs for Ec2Client.describeTags show that Value should actually be
Values and should be an array. Try the following:
$oModel = $oEC2Client->describeTags(array(
"Filters" => array(
array("Name" => "resource-id", "Values" =>
|When reserving an Amazon EC2 instance, what does it mean for the Platform to be the same?|
You would choose "Linux/Unix". Flavors of Linux such as Redhat and SUSE
include additional licensing fees not charged for other versions of linux,
which is why they are considered separate platforms.
|terminate instance; Amazon cloudwatch|
you have to add these two lines
PutMetricAlarmRequest alarmreq=new PutMetricAlarmRequest()
//This stops the instance in the requests
|How do I download an Amazon RDS database from an instance?|
There is no other way but connecting to your instance and using any tool
you might want to use to do the job - backup
This question was answered before.
download RDS snapshot
|Direct browser upload to Amazon S3|
Try adding a wildcard for the AllowedHeader and allow all methods, like so:
Great starting points for a direct upload to Amazon S3 are:
For the js:
For the php:
Or if you're looking for a solution that works out of the box, t
|How To read through environment variables of an Amazon EC2 instance on the fly in PHP|
you should find the vars there (reference -
|What could break after changing instance type on Amazon EC2 AWS?|
If you're talking about just changing the instance type, nothing. You
should keep backups anyway in case amazon goofs, but remounting the EBS to
a larger instance shouldn't break anything as long as you restart all the
services and recompile whatever's necessary to be safe.
|Connecting to ubuntu instance in amazon ec2 without java|
You can connect over ssh using an ssh key without using their web based
java ssh program. Read the documentation here about halfway down the page.
|How to SFTP into Amazon EC2 Ubuntu t1.micro instance?|
I really like sshfs. SSHFS lets you mount a remote file system and have it
show up as a local mount point on your local system.
A simple example is:
1. From the client make sure that you have sshfs installed:
"sudo apt-get install sshfs"
2. From the client system:
"sudo sshfs user@ubuntuServer:/remote/path /local/path -o allow_other"
This will mount /remote/path on the ubuntu server to /local/path on your
machine. The "-o allow_other" says that any user on the client system and
read/write to the mount point assuming that the "user@" user has
permissions on the ubuntu server to read/write to the "/remote/path".
|amazon spot instance termination issue|
In short answer if another user is bidding more for the instances and there
more spare available instances then the spot price increases and the first
group of instances that fall below that price are SHUTDOWN instantly.
Spot Instances allow you to name your own price for Amazon EC2
computing capacity. You simply bid on spare Amazon EC2 instances and
run them whenever your bid exceeds the current Spot Price, which
varies in real-time based on supply and demand.
|allow others to see your Sinatra local server through amazon instance|
I'm not sure if there is a specific reason that you want to do this from an
Amazon server or not, but if you just want someone else to see your sinatra
app, you could simply use localtunnel.
Using this, you can simply run localhost on your OWN computer, then run
localtunnel PORTNUMBER and it will give you a URL that your app will now be
visible from. You can then give that URL to anyone you want.
Example of use:
$ ruby myapp.rb
$ localtunnel 4567
A URL will then be displayed for you to copy-paste to a friend. Easy as
I use this a lot when developing web apps to be mobile friendly and want to
quickly look at the app on my phone without having to deploy to a server.
|How to uninstall mysql on amazon ec2 micro instance|
For right now:
Assuming you don't need to keep any data, you can terminate your instance
and launch a new one and configure it to your liking.
To prevent problems in the future:
After you launch your new instance and configure it with MySQL and whatever
else you may need, create an Amazon Machine Image (AMI) of the instance.
You can launch an instance based on your AMI so you don't have to go
through and manually configure the instance from scratch if something were
to happen. You shouldn't have to update AMIs too often. I usually only do
when there are updates to the OS or something else on the machine.
When it comes to persisting data/code the first thing I recommend is
looking into some kind of source control system like git. On top of that
you can create Snapshots of the Volume att
|Scalability of database on an Amazon EC2 micro instance?|
If the load on your application increases the database on EC2 instance will
not scale itself. It will fail if you do not take any steps. All you can do
is vertical scaling. And you can have read replicas. The same is true for
RDS. With RDS, DB server does not scale automatically, you need to upscale
it your self if the traffic increases. So RDS decreases your DB management
|Connect to mysql on Amazon EC2 from a remote server - ERROR 2003|
i have in the iptables this line
REJECT all -- anywhere anywhere reject-with
and this line only append the rule to the end of the list so the reject
catch it first
sudo iptables -A INPUT -i eth0 -p tcp -m tcp --dport 3306 -j ACCEPT
to solve it i needed to put the rule higher in the chain, i.e. use -I
switch like this:
sudo iptables -I INPUT -i eth0 -p tcp -m tcp --dport 3306 -j ACCEPT
|itextSharp PDF to text file in c# issue in Amazon EC2 instance|
Please debug as follows:
Create a FileInputStream to PDFFilePath.
Read the bytes of this stream into an array.
Check the first five bytes.
On your local system, they're '%', 'P', 'D', 'F', '-'.
On your Amazon EC2 instance, they aren't.
Check all the bytes to see what goes wrong.
|PHP unable to run MYSQLI functions on Amazon EC2 micro instance|
Up to where I understand your PHP installation was compiled with mysqli
support but the module is not enabled. Why? Because you specify that the
only reference to mysqli in the phpinfo() is the Configure Command. Should
it be enabled, a table like
should show up.
So, maybe, you simply didn't uncomment the extension line in your php.ini
According to the official docummentation:
To check whether the system is using a configuration file, try
retrieving the value of the cfg_file_path configuration setting. If
this is available, a configuration file is being used.
In other words, you could check if your php.ini file is being taken into
account (it may be in a wrong path). Try:
<?php echo 'Configuration file (php.ini) path: ',
|How can I resolve an ORA-12514 when connecting to an Amazon RDS instance using Java|
The JDBC connection string is incorrect.
The string should be:
Changing the connection string resolved the issue.
|Reading and writing on Instance store disk of Amazon|
No. There are no IO request charges for instance store disk (aka
ephemeral disk) from an EC2 instance.
However, EBS volumes do incur IO request charges, or pIOPS charges for
Provisioned IOPS EBS volumes.
You can read more about EBS volume charges here:
|Permission denied (publickey) when SSH Access to Amazon EC2 instance|
This error message means you failed to authenticate.
These are common reasons that can cause that:
Trying to connect with the wrong key. Are you sure this instance is using
Trying to connect with the wrong username. ubuntu is the username for the
ubuntu based AWS distribution, but on some others it's ec2-user (or admin
on some Debians, according to Bogdan Kulbida's answer)(can also be root,
fedora, see below)
Trying to connect the wrong host. Is that the right host you are trying to
log in to?
Note that 1. will also happen if you have messed up the
/home/<username>/.ssh/authorized_keys file on your EC2 instance.
About 2., the information about which username you should use is often
lacking from the AMI Image description. But you can find some in AWS EC2
|Amazon EC2 change instance type, possible issues with volumes?|
If the volumes are EBS volumes then you can safely do this (note that
terminating an instance can delete EBS volumes if they have the delete on
termination flag set, but stopping an instance is ok). The volumes will
stay attached to the instance but depending on the operating system and
configuration you may need to remount them
If they are ephemeral volumes then stopping the instance will lose all data
stored on them.
|How to automatically start Tomcat after starting an Amazon EC2 instance|
Your best bet (if you want to cut out a lot of trial and error) is probably
to reinstall Tomcat with the .exe installer, and explicitly install it to
run as a service. (You could certainly accomplish this without
reinstalling; I suggest reinstalling merely because when all's said and
done, it'll will probably take you less time, unless you have lots of
custom Tomcat config.) Once it's installed as a service, go to Services
and make sure the Tomcat service's "Startup Type" is "Automatic". (You
will probably be able to control the Tomcat service's Startup Type from the
Apache Service Monitor in your system tray as well, without opening
Note that running Tomcat as a service may conflict with the way you
schedule the starting/stopping Tomcat during business hours, but since it's
|How to install edited ruby gem from github on Amazon EC2 instance?|
You can build gem from installed source after some modifications and
Just locate to source, find mygem.gemspec file, then gem build
mygem.gemspec and gem install mygem.
Read more on http://docs.rubygems.org/read/chapter/5.
Does it address your needs and solve your problem?
|How do I force Amazon EC2 instance to use my Elastic IP when I FTP out to a remote server?|
FTP has two modes of operation - active and passive. Quoting wikipedia:
FTP may run in active or passive mode, which determines how the data
connection is established.In active mode, the client creates a TCP control
connection. In situations where the client is behind a firewall and unable
to accept incoming TCP connections, passive mode may be used. In this mode,
the client uses the control connection to send a PASV command to the server
and then receives a server IP address and server port number from the
server, which the client then uses to open a data connection from an
arbitrary client port to the server IP address and server port number
To summarize, in active mode, the server will attempt to create a
connection BACK to the client. Since you client's IP is a private o
|Suddenly not able to send email by amazon SES - unable to connect smtp host|
Try sending your email via email-smtp.us-east-1.amazonaws.com:587.
Outgoing connections to SMTP (25) port may be blocked by a firewall to stop
Can you telnet any of the two ports? Do you get SMTP greeting messages?
telnet email-smtp.us-east-1.amazonaws.com 25
telnet email-smtp.us-east-1.amazonaws.com 587
Many Internet service providers and enterprise or institutional networks
restrict the ability to connect to remote MTAs on port 25. The
accessibility of a Mail Submission Agent on port 587 enables nomadic
users to continue to send mail via their preferred submission servers even
from within others' network
|Amazon Elastic Load Balancer (ELB) url not resolved by instance attached to it|
This is normal, if I correctly understand your testing framework. The way
that ELB is scaling, it starts out running on a very small machine, and as
traffic increases, it's directed to even larger and larger machines.
However, ELB is not configured to handle flash traffic, especially from a
small number of hosts, as is the case with a load testing scenario. This is
because the DNS record is changed whenever ELB scales, and it sometimes
takes a while to propagate. Load testing frameworks sometimes cache the DNS
lookup, making things even slower. The official ELB documentation
(http://aws.amazon.com/articles/1636185810492479) states that traffic
should not be increased by more than 50% every 5 minutes. I found that
scaling takes even longer if you're looking to get over 150-200k RPM.
|Route 53 Amazon Aws - Check service (Solr) health in my ec2 instance|
Yes, this is possible. The port and path of Route 53 health checks is
fully configurable, so you can create one pointing to eg.
There are a few things you'd have to setup:
your ec2 instance needs to be reachable from the IP addresses used by Route
apache solr needs a URL that can be used to determine if it's healthy. A
good way of doing this is with solr's ping request handler
Full disclosure - I work for Route 53