Skip to content
Thanerik edited this page Nov 3, 2014 · 13 revisions

Security Groups

To accepting inbound HTTP and HTTPS trafics from whole IP range (default)

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html#adding-security-group-rule

Ports needed for Red5: 1935, 1936, 5080, 8088

SSH access

To enable SSH access to the server (Linux/Mac)

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html

$ chmod 400 my-key-pair.cer - Make sure your private key file isn't publicly viewable

$ ssh -i my-key-pair.cer ec2-user@[DNS/IP to host]

Or you can use ssh config to simplify your life:

$ nano ~/.ssh/config

And write the text on (Without comments):

Host dev
    HostName dev.example.com // IP or DNS
    Port 22000 // Port to the ssh - I didn't use that
    User ec2-user // Default Amazon AMI user
    IdentityFile /Users/Someone/Documents/my-key-pair.cer</p>
Host github.com
    IdentityFile ~/.ssh/github.key

Then you can use:

$ ssh dev - to ssh into "dev" host.

Update

Updates the instance with the newest updates

$ sudo yum update -y

LAMP

Apache web server, with PHP and mySQL

Source: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html Source: https://gist.github.com/sl-digital/9838411

Installing LAMP

Amazon AMI have PHP5.3 by default. Must alter it to install PHP5.5 and more

$ sudo yum install httpd24 php55 php55-common php55-pdo php55-mysqlnd php55-gd php55-mbstring php55-mcrypt php55-pecl-apc php55-devel
$ sudo service httpd start // Start web server
$ sudo chkconfig httpd on
$ chkconfig --list httpd
Check it: 0:fra	1:fra	2:til	3:til	4:til	5:til	6:fra

Modifing php.ini

$ sudo nano /etc/php.ini
error_log = /var/log/php-error.log
date.timezone = "America/Chicago"
$ sudo service httpd restart

Install mySQL

Find the link to mysql yum distro: http://dev.mysql.com/downloads/repo/yum/

$ sudo yum localinstall http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
$ sudo yum install mysql-community-server
$ sudo service mysqld start
$ sudo /usr/bin/mysql_secure_installation // Set root pwd and say yes to all
$ sudo chkconfig mysqld on // Start mySQL in startup
$ chkconfig --list mysqld
Check it: 0:fra	1:fra	2:til	3:til	4:til	5:til	6:fra

$ sudo chown -R ec2-user /var/www/html - Gives the ec2-user ownship on html - makes ftps access easier

Git

We use Git to pull from Github.com

$ sudo yum install git-core - Installs git

Generate a ssh-key for root user

$ sudo ssh-keygen -t rsa -> Chose "no passphrase"

$ sudo cat /root/.ssh/id_rsa.pub -> Add the key as a "deploy key" at https://github.com/you/myapp/admin

Get the repo

$ cd /var/www/

$ sudo git clone git@github.com:yourUsername/yourApp.git html

To pull the repo

$ cd /var/www/html

$ sudo git pull

Red5 Media Server

Forget it! Too complicated!!

Reasons

  • Hard to install
  • Requires a wide knowledge in Java, Actionscript and building a application in linux
  • Too few/simple documentations about a complicated topic
  • Have to create a flash object to communicate in RMTP proctol
  • Must build a .swf object in Flex or Flash Builder - to properly communicate with the server
  • Must find a way to communicate php/js ~ actionscript to have database updated correctly
  • It's just stupid!

If you absolute want to read how to install Red5 in a Amazon AMI instance... here u go...

Webcam recording

Uses a third-part to handle recording, uploading and encoding.

The choice of the project: Tag - https://cameratag.com/

Later

Source: http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/creating-migrating.html

Considerations

Alternative FMS than Red5 (which is hard to install and use) https://github.com/arut/nginx-rtmp-module BTW, maybe too hard to have 2 HTTP servers side-to-side?

Clone this wiki locally