Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am going to host a web site in Amazon EC2 instance which would be a Linux instance. My web application will be developed using PHP, Apache and MySql. As I am new to Linux and Amazon EC2 environment, what are key areas in security should I consider to protect my server? This may be very very generic question as the security itself a vast area. But I need to kick start with most imporant points. That way I would be able to track down all those areas one by one.

share|improve this question
Possible duplicate of Tips for Securing a LAMP Server. – Scott Pack Jan 11 '11 at 2:02

For me that would be:

  • keep up to date with patches on your distribution
  • run only the services needed on the interfaces needed (netstat -l -n -p will show what process is listening on what port on which interface) eg run mysql only on localhost
  • Secure remote login
    • no root access
    • ssh keys for login only
    • sudo to escalate privileges
    • intrusion detection (rkhunter or tripwire)
  • maybe suphp but I have no experiance with that
  • reliable, offsite backup with history (dirvish for me)
  • configure EC2 Portforwarding only for the services needed
share|improve this answer

Ensure that your protect your private keys and you should use the Security Group feature in AWS to ensure that your ports are secure (eg, allow SSH and FTP from your home or office only while allowing HTTP/S from all IPs).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.