2016年2月21日 星期日

[AWS] - Route53 + EC2 LEMP ( Ubuntu14 + Nginx + PHP5 + MariaDB )

去 Godaddy 逛逛看到了一組 39 元 TWD 網域註冊後 ,
當測試來驗證一下 AWS 的 EC2 + Route53

1. 登入Godaddy 後台 ~到設定




















2. 設定域名伺服器 , 指定到 AWS route53 

NS-298.AWSDNS-37.COM
NS-1931.AWSDNS-49.CO.UK
NS-1226.AWSDNS-25.ORG

NS-992.AWSDNS-60.NET 





















3. 到 AWS Route53 設定一組 IPV4 的 A 紀錄
Ex.   fifi.xlinux.website  xxxxxxxxxxxx
PS ( 大概等了 1個小時以內就生效 )














4. AMI(Amazon Machine Image) 打開  AMI 建立一個  Instance  , 選擇 Ubuntu14











SSD 選擇 General purpose 就好 , 因為不用算 IOPS ( input/output per second ) 費用,

Provision IOP   這種會算費用












5. 到 Elastic IP (EIP) 綁定固定 IP , 不然 Instance Reboot 都會換 IP















6.  設定 SSH 連線
  A. 先建立一組 Key Pairs  xxx.pem
       使用 pietty or putty or xshell   ..etc 來連線
       匯入 xxx.pem 或透過 Linux console   
       ssh -i 'xx.pem'  ubuntu@fifi.xlinux.website

  B. 若要取消 key Pairs  , 編輯 sshd config 

   # vim  /etc/ssh/sshd_config
   PasswordAuthentication YES

   C. 重新啟動 sshd 
    # service sshd restart



7. 到 Security Group 設定防火牆存取 
   打開 icmp 跟 web 的 port
   

     
8. 安裝 LEMP

   A. 安裝 MariaDB 
        # apt-get install mariadb-server
  B. 安裝 Web Nginx 
        # apt-get install nginx
  C. 安裝 PHP FPM
       # apt-get install php5-fpm php5-mysql
       
  D.  設定 PHP FPM  9000 port 啟動
       # vim /etc/php5/fpm/pool.d/www.conf    

       ; listen = /var/run/php5-fpm.sock

       listen = 127.0.0.1:9000

      # service php5-fpm restart


   E. 設定 Nginx 透過 php fpm 運作 script 
       # vim /etc/nginx/sites-enabled/default
              root /var/www/html;
             index index.php index.html index.htm;
         
        location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
        #       # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
        #
        #       # With php5-cgi alone:
                fastcgi_pass 127.0.0.1:9000;
        #       # With php5-fpm:
                # fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
        }
         # service nginx restart
      

.... Orz ..  設定了一筆 A 紀錄後 ,
已經被收了 $ 0.01  US 




     




沒有留言:

張貼留言