申請及建立主機請看
http://blog.json.tw/teaching-ten-minutes-to-quickly-build-a-free-amazon-ec2-host
我選擇的系統為 Red Hat Enterprise Linux 7.1 (HVM)

登入主機
# chmod 400 EC2key.pem
# ssh ec2-user@{public_ip} -i key.pem

切換到 root 帳號
    # sudo su -

安裝 VIM
    # yum -y install vim

安裝 Mysql
因為 RHEL 7 無法直接用 yum install mysql-server,所以請參考下面這篇進行安裝
http://www.phpini.com/mysql/rhel-centos-yum-install-mysql
    # rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
    # yum install mysql-community-server
    # /usr/bin/systemctl enable mysqld
    # service mysqld start

安裝 PHP, Apache
    # yum -y install httpd
    # service httpd start
    # yum -y install php php-mbstring php-mysql php-gd php-ldap php-devel

開啟 80 及 443 Port
請參考:http://docs.aws.amazon.com/zh_cn/AWSEC2/latest/UserGuide/using-network-security.html#adding-security-group-rule
1. 在 instances 列表,點選最後一欄的 "Security Groups"
2. 在你要編輯的 Security Group 列按右鍵,選擇選單的 "Edit inbound rules"
3. 點擊 "Add Rule" 按鈕,加上 80 及 443 Port
4. 按 "Save" 即生效

測試 Apache
    # service httpd start
    在瀏灠器直接輸入 Public IP 看看正不正常!

arrow
arrow
    全站熱搜

    wbkuo 發表在 痞客邦 留言(0) 人氣()