服務平台:Amazon Web Service(AWS)
環境:Amazon Elastic Compute Cloud (Amazon EC2)
工具:putty
1)新增一個virtual.conf的檔案額外設定Apache:
[root@ip-XXX-XXX-XXX-XXX ec2-user]# vim /etc/httpd/conf.d/virtual.conf
2)設定虛擬主機(virtual.conf)port 80所指定的虛擬主機:
NameVirtualHost *:80
3)設定虛擬主機(virtual.conf)目錄路徑及DNS名稱:
<VirtualHost *:80>
ServerName kejyun.twbbs.org DocumentRoot /var/kejyun
</VirtualHost>
<VirtualHost *:80>
ServerName shihgu.twbbs.org
DocumentRoot /var/shihgu
</VirtualHost>
3)設定虛擬主機(virtual.conf)目錄權限
<Directory "/var/kejyun">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory "/var/shihgu">
Options FollowSymLinks Indexes
AllowOverride None
Order allow,deny
Allow from all
</Directory>
4)重新啟動apache讀取新設定
[root@ip-XXX-XXX-XXX-XXX ec2-user]# /etc/init.d/httpd restart
服務平台:Amazon Web Service(AWS)
環境:Amazon Elastic Compute Cloud (Amazon EC2)
工具:putty
- 使用yum安裝[root@ip-XXX-XXX-XXX-XXX ec2-user]# yum install httpd php mysql
- 開機自動啟動
- 設定開機自動啟動Apache:[root@ip-XXX-XXX-XXX-XXX ec2-user]# /sbin/chkconfig httpd on
- 新增MySQL服務至自動啟動設定:[root@ip-XXX-XXX-XXX-XXX ec2-user]# /sbin/chkconfig –add mysqld
- 設定開機自動啟動MySQL:[root@ip-XXX-XXX-XXX-XXX ec2-user]# /sbin/chkconfig mysqld on
- 啟動服務
- 啟動Apache:[root@ip-XXX-XXX-XXX-XXX ec2-user]# /sbin/service httpd start
- 啟動MySQL:[root@ip-XXX-XXX-XXX-XXX ec2-user]# /sbin/service mysqld start
- 設定MySQL管理者密碼:[root@ip-XXX-XXX-XXX-XXX ec2-user]# mysqladmin -u root password ‘NEWPASSWORD’
服務平台:Amazon Web Service(AWS)
環境:Amazon Elastic Compute Cloud (Amazon EC2)
工具:putty
- 切換至管理者:[ec2-user@ip-XXX-XXX-XXX-XXX ~]$ sudo -s
- 新增帳號:[root@ip-XXX-XXX-XXX-XXX ec2-user]# adduser USER_ACCOUNT
- 新增帳號密碼:[root@ip-XXX-XXX-XXX-XXX ec2-user]# passwd USER_ACCOUNT,重新輸入兩次密碼即可
- 新增管理者權限:echo 'USER_ACCOUNT ALL=(ALL) ALL' >> /etc/sudoers,即可新增USER_ACCOUNT為管理者
*:若在使用ssh登入時候被提示說auth method不允許,則至/etc/ssh/sshd_config中,將PasswordAuthentication設為yes即可登入
服務平台:Amazon Web Service(AWS)
環境:Amazon Elastic Compute Cloud (Amazon EC2)、Windows 7
工具:putty、puttygen
- 執行「puttygen > Conversions > Import key」,將從AWS下載的「*.pem」檔轉換成「*.ppk」檔
- 執行putty(或pietty,點選PuTTY模式),切換左側樹狀目錄[Session],輸入AWS給予您的「Public DNS」(例如:ec2-XXX-XXX-XXX-XXX.ap-southeast-1.compute.amazonaws.com)