amazon ec2 新手使用指南
亚马逊EC2终端操作手册
Amazon EC2终端操作手册SUNDE亚马逊AWS EC2专用终端是为亚马逊EC2云计算服务量身定做的云计算终端。
用户只需拥有一个AWS账户,就可以通过终端连接亚马逊的云计算平台,进行虚拟机实例创建、登录等一系列操作,而无需使用PC机。
该终端还可以用于所有遵循亚马逊云计算协议规范的其他云计算平台。
1、终端登录终端开机后,登录界面如下:输入AWS EC2的domain name、access key id和secret access key后,点击login按钮登录到amazon。
其中access key id 和secret access key 是在亚马逊的官方网站注册在亚马逊的官方网站注册账户账户账户后,后,后,系统自动生系统自动生成的,可以成的,可以在账户的在账户的Security Credentials 选项中找到。
详情请访问 。
由于要输入的内容较多,也可以先把登录信息保存由于要输入的内容较多,也可以先把登录信息保存在名为在名为login.txt 的文件文件中中,并把文件保存到U 盘的根目录,点击read from udisk 按钮自动填入登录信息。
文件格式为:Domain Name=Access Key ID=AKIAI7UZEYA4EPDKJWQSWSecret Access Key=JS9MH2nekLjfi53cR2IPFMfIzu78W+H2nekLjfi52、终端设置在登录界面,点击设置按钮(setup ),将进入终端设置界面。
在设置界面可以设置终端的ip 地址和屏幕分别率地址和屏幕分别率。
在个别情况下需要设置终端的日期时间。
在个别情况下需要设置终端的日期时间或DNS 服务器,服务器,按按ctl+t 键可以设置终端的日期时间,按ctl+s 键可以设置DNS 服务器。
按S ave 按钮保存配置,按C ancel 返回终端登录界面。
3、创建实例所谓实例,就是用户在亚马逊云平台上的虚拟机。
弹性计算平台EC2的使用与优化
弹性计算平台EC2的使用与优化随着云计算技术的发展,越来越多的企业开始选择将其业务迁移到云上,实现资源的弹性扩展和灵活调配。
而其中最为核心的底层基础设施就是弹性计算平台EC2(Amazon Elastic Compute Cloud),该服务通过提供虚拟机实例的方式来为企业提供高度可扩展的计算资源。
一、EC2的基本使用EC2是Amazon Web Services(AWS)提供的一项计算服务,最常用的方式是启动EC2实例。
在管理EC2的过程中,可以使用AWS Management Console、AWS CLI和AWS SDK等多种方式,这里我们将以AWS Management Console的方式进行讲解。
1. 创建EC2实例首先登录到AWS控制台,进入EC2控制台,在实例管理页面中点击启动实例(Launch Instance),根据实际情况选择适合的Amazon Machine Image(AMI)镜像,配置实例规格、存储、网络等相关参数后即可开始创建。
2. 连接EC2实例当EC2实例创建成功后,需要远程连接到实例中进行操作,可以通过使用SSH、RDP等工具进行连接。
在EC2实例页面的“Actions”菜单中,选择“Connect”即可获取连接信息。
二、EC2的性能优化EC2的优点之一是其弹性和可扩展性,但是其性能方面并不是最优秀的。
下面介绍一些优化EC2实例性能的方法。
1. 配置实例规格EC2实例的性能主要由其规格、存储设备和网络带宽等因素决定,选择合适的实例规格可以大大提高实例的性能。
AWS提供了多种实例类型,根据应用负载类型和性能需求选择合适的实例类型。
2. 提高磁盘性能对于需要高性能磁盘的应用程序,可以使用SSD存储设备或EBS卷,并使用RAID 0来提高I/O性能。
3. 提高网络带宽对于需要高网络带宽的应用程序,可以使用EC2实例的“Enhanced Networking”功能来提高网络性能。
AWS EC2 登录和使用说明
连接到您的Linux实例收集实例信息请收集如下实例信息:Linux终端:使用ssh连接到Linux实例步骤一:使用chmod命令确保您的私有密钥不是公开可见的。
例如,如果您的私有密钥文件的名称是my-key-pair.pem,请使用以下命令:步骤二:使用ssh命令连接到实例。
您将指定私有密钥(.pem) 文件和user_name@public_dns_name。
对于Amazon Linux,用户名称是ec2-user。
对于RHEL5,用户名称是root或ec2-user。
对于Ubuntu,用户名称是ubuntu。
对于Fedora,用户名称是fedora或ec2-user。
对于SUSE Linux,用户名称是root 或ec2-user。
另外,如果ec2-user和root无法使用,请与您的AMI 供应商核实。
本次比赛是采用的Ubuntu系统,因此连接方式参考如下命令您将看到如下响应。
输入yes,您将看到如下响应使用SCP 将文件从Linux 传输到Linux 实例在您的本地计算机与Linux 实例之间传输文件的一种方法是使用安全复制(SCP)。
本节介绍了如何使用SCP 传输文件。
这个程序和使用SSH 连接到实例的程序非常相似。
1.在命令shell 中,将目录更改为您启动实例时所指定的私有密钥文件的位置。
2.使用chmod命令确保您的私有密钥不是公开可见的。
例如,如果您的私有密钥文件的名称是my-key-pair.pem,请使用以下命令:3.使用实例的公有DNS 名称将文件传输到您的实例。
举例来说,如果私有密钥文件的名称是my-key-pair、要传输的文件是SampleFile.txt、实例的公有DNS 名称是,则可以使用以下命令将文件复制到ubuntu主目录。
Tip对于Amazon Linux,用户名称是ec2-user。
对于RHEL5,用户名称是root或ec2-user。
对于Ubuntu,用户名称是ubuntu。
免费午餐:亚马逊免费云主机注册使用全攻略
免费午餐:亚马逊免费云主机注册使用全攻略折腾了好一段时间,终于申请成功了。
现在总结一下,希望能够对诸位朋友有所帮助。
恩,免费获得1年的云主机使用权,云主机配置为1CPU,613M内存,win或者linux操作系统。
值得一提的是,他们居然连winserver2012都有。
赞+1申请过程中遇到两个问题,差点放弃。
1,是注册账号需要信用卡。
后来我用我老婆的信用卡就注册成功了。
任意信用卡,只要有万事达MasterCard,或者VISA标记就可以。
2,是他发送一封邮件给我,告诉我被拒绝了,因为我没有域名。
好了,写一下详细过程吧。
有英语不好的朋友,照葫芦画瓢就可以了。
首先是亚马逊云主机网址:登陆以后点注册(这时候还是中文界面,注册在哪里你能找到吧?)输入邮箱,选择新用户。
上图,是什么类型卡,就选什么类型卡。
现在世界接轨了,找个有信用卡的朋友借一下,应该不是难事。
不过我好奇的是,只需要输入卡号,日期及名字(名字用中文原名),就可以扣你的钱……然后下面的步骤由于我已经注册好了,之前没有截图。
就不发图了。
(坑了,有木有?)恩,后面有个步骤会接到一个号码显示为+的英语电话,具体内容我又忘了。
(继续坑)接下来就是我遇到的第二个问题。
差点在这里放弃哦。
收到了他们的邮件,告诉我没有通过授权。
具体邮件如下。
Greetings from Amazon Web Services.This email is to notify you that you have not been granted access to Amazon Route 53, CloudFront. At this time we are requesting you to provide us with a valid business URL. Additionally, please email us the valid URL from an email addresses associated with the URL.You can send your message to aws-verification@. We apologize for any inconvenience this may have caused, and appreciate your patience with our security measures.我使用QQ邮箱注册的,他认为我没有域名,希望我用一个有效的(商业)域名为后缀的邮箱发送邮件给他。
Amazon AWS EC2使用说明文档
打开https:///ec2/home进入EC2 console:点击Launch Instance,启动新的Instance实例。
默认的第一个AMI, Basic 32-bit Amazon Linux AMI 1.0只有这个和下个64bit的免费实例数(Number of Instances),默认为1,可用区域(availability zone),这里用了默认的!实例类型(instance type),必须选择Micro,否则准备收账单吧。
点击Continue转到高级实例选项设定,默认。
点击Continue转到Tag设定页面,直接跳过。
点击Continue进入”Create Key Pair”,这一步比较关键,会下载一个pem结尾的密匙文件!用于连接建成的instance!随便起一个名字,特别提醒:由于ie安全设置,会阻止下载,等你点击同意时候,会刷新页面,导致无法下载密匙!建议先调低安全设置!略过截图!点击View your instances on the Instances page察看Instance状态。
您应该已经看到有一个 t1.micro status为Running,至此您的micro intance 已经启动,意味这您有一台可以ssh登陆的linux服务器啦。
SSH proxy在Linux下很简单,一条命令即可:以下为引用的内容:$mv ~/Downloads/fookey.perm ~/.ssh/$chmod 400 ~/.ssh/fookey.perm$ssh -i ~/.ssh/ec2.pem ec2-user@YOUR_AMAZON_PUBLIC_DNS -f -N -D 10003系统只允许通过key密钥登陆我们安装的AMI,默认登陆用户为ec2-user用你的Public DNS代替YOUR_AMAZON_PUBLIC_DNS1. SSH如果是Mac或者Linux用户,那么可以使用命令行方式的ssh,在EC2 Instance 上点右键,选择Connect,会出现以下页面提示你该如何通过ssh连接此实例。
Amazon【EC2】如何启动一个新的EC2实例
Amazon【EC2】如何启动⼀个新的EC2实例控制台可直接搜索ec2
创建实例
aws没有新建实例这个说法,新建就是启动实例
选择镜像
在搜索框中搜索⾃⼰想要的镜像。
这⾥有收费的也有免费的
选择实例类型
选择⾃⼰想要的实例类型(机器配置)
配置⽹络
这⾥⽹络配置为默认,后⾯详细讲述 VPC和⼦⽹
添加存储
磁盘的类型很多,选错的话,会花费很贵的。
添加标签
不重要,可以直接下⼀步
添加安全组
可以新建安全组或者选择现有的安全组
核实实例启动
就是把之前选择的配置信息确认⼀下
选择密钥对
这⾥需要把密钥下载到本地,记住!!只有这⼀次下载密钥的机会,如果没有下载的话,就⽆法下载了。
除⾮新建密钥,但是之前使⽤这个密钥的机器就⽆法登陆
AWS默认是使⽤密码的,没有设置密码的地⽅
启动实例
查看实例
Name这⾥最好写个项⽬的简称。
对于后来⽅便查找
申请弹性IP
分配IP
申请成功
关联IP
查看关联成功实例。
AWSEC2登录和使用说明
AWSEC2登录和使用说明连接到您的Linux实例收集实例信息请收集如下实例信息:Linux终端:使用ssh连接到Linux实例步骤一:使用chmod命令确保您的私有密钥不是公开可见的。
例如,如果您的私有密钥文件的名称是my-key-pair.pem,请使用以下命令:步骤二:使用ssh命令连接到实例。
您将指定私有密钥(.pem) 文件和user_name@public_dns_name。
对于Amazon Linux,用户名称是ec2-user。
对于RHEL5,用户名称是root或ec2-user。
对于Ubuntu,用户名称是ubuntu。
对于Fedora,用户名称是fedora或ec2-user。
对于SUSE Linux,用户名称是root 或ec2-user。
另外,如果ec2-user和root无法使用,请与您的AMI 供应商核实。
本次比赛是采用的Ubuntu系统,因此连接方式参考如下命令您将看到如下响应。
输入yes,您将看到如下响应使用SCP 将文件从Linux 传输到Linux 实例在您的本地计算机与Linux 实例之间传输文件的一种方法是使用安全复制(SCP)。
本节介绍了如何使用SCP 传输文件。
这个程序和使用SSH 连接到实例的程序非常相似。
1.在命令shell 中,将目录更改为您启动实例时所指定的私有密钥文件的位置。
2.使用chmod命令确保您的私有密钥不是公开可见的。
例如,如果您的私有密钥文件的名称是my-key-pair.pem,请使用以下命令:3.使用实例的公有DNS 名称将文件传输到您的实例。
举例来说,如果私有密钥文件的名称是my-key-pair、要传输的文件是SampleFile.txt、实例的公有DNS 名称是,则可以使用以下命令将文件复制到ubuntu主目录。
Tip对于Amazon Linux,用户名称是ec2-user。
对于RHEL5,用户名称是root或ec2-user。
AWS EC2 设置root 用户和密码登录操作文档
AWS操作文档目录AWS操作文档 (1)1.创建安全组 (1)1.1.修改默认安全组规则 (1)2.创建密钥对 (2)3.创建实例 (2)4.使用xshell 连接AWS 实例 (6)4.1.设置xshell 用户秘钥管理者 (6)4.2.连接AWS EC2 实例 (8)4.3.设置Root 账号密码 (9)4.4.设置Xshell 工具root 用户和密码 (11)1.创建安全组1.1.修改默认安全组规则➢控制台–> EC2 -> 安全组:增加80、22、8080 端口规则2.创建密钥对➢控制台-> EC2 -> 秘钥对➢下载到本地目录中3.创建实例➢控制台-> EC2 -> 实例:启动实例➢选择免费的类型➢默认下一步➢设置默认存储➢默认下一步➢选择现有的默认安全组➢启动➢选择创建的密钥对➢查看实例列表➢获得外网IP4.使用XSHELL 连接AWS 实例4.1.设置XSHELL 用户秘钥管理者➢Xshell –> 工具–> 用户秘钥管理者➢关闭窗口➢文件-> 新建-> x新建会话属性:输入名称,主机➢设置用户身份验证4.2.连接AWS EC2 实例➢点击:连接➢接收并保存➢连接成功4.3.设置ROOT 账号密码➢提权设置root 密码:$ sudo passwd root➢切换root 用户下,修改ec2-user 的密码:$ su root# passwd ec2-user➢设置sshd_config 文件,ssh 使用用户名和密码登录# sed -ri 's/^#?(PasswordAuthentication)\s+(yes|no)/\1 yes/' /etc/ssh/sshd_config # sed -ri 's/^#?(PermitRootLogin)\s+(yes|no)/\1 yes/' /etc/ssh/sshd_config# sed -ri 's/^/#/;s/sleep 10"\s+/&\n/' /root/.ssh/authorized_keys# systemctl restart sshd.service# touch /root/.Xauthority➢解决警告提示# yum install xorg-x11-xauth xterm –y4.4.设置XSHELL 工具ROOT 用户和密码➢打开Xshell -> 打开-> 创建的连接➢设置root 用户和密码➢Root 用户连接AWS EC2 实例。
Amazon EC2 Terminal User Manual
Amazon EC2Terminal User ManualSUNDE Amazon AWS EC2Customized Terminal is specialized for Amazon EC2cloud computing service.With only an AWS account,the users can access to the Amazon cloud computing platform through the terminal,instead of a PC,to create virtual machine instances,login,etc.The terminal can be used for any other cloud computing platforms which comply with Amazon cloud computing protocol specification.1、Terminal LoginTurn on the terminal to enter the login page.Enter the domain name,access key id and secret access key of the AWS EC2,click login button to access to Amazon.The access key id and secret access key are created automatically by the system when the users register on Amazon official website.They can be found in Security Credentials of the account.For more details please visit.Considering much contents need to be entered,the users can also save the login information to a file named login.txt and move the file to a USB disk root directory.The file format should be:Domain Name=Access Key ID=AKIAI7UZEYA4EPDKJWQSWSecret Access Key=JS9MH2nekLjfi53cR2IPFMfIzu78W+H2nekLjfi52、Terminal SetupClick the setup button of the login page,to enter the setup interface.The users can set up the IP address and screen resolution.On rare occasions, the users need to set up the date and time of the terminal with ctl+t keys,and the DNS server with ctl+s keys.Click Save button to save the setup,or Cancel to go back to setup interface.3、Create a InstanceThe so-called Instance,is the user’s virtual machine on the Amazon cloud computing platform.After login there will list all the user’s virtual machine Instances and operation buttons as follows:Click"new"button to get a guide as follows to create new instance.Choose an image from the Image List to create an Instance,click "next"to choose"private key".On the dropdown list,the users can choose an existed Private Key to create new virtual machine instance,either they can create a new Private Key firstly then later create virtual machine instance with the new Private key.With new Private key for example,enter the name of the Private key on the textbox,click"create a new key"to create the new key.After the key created,It will prompt you to insert USB disk,and let you save the file path of the key.Or,you can choose"without a key"to create the new instance.Please note you will not be able to connect to the Instance unless you already know the password built in to this AMI.Click"Next"to set up security.On Existing Security Groups list,choose an existed security group to create the new Instance,or choose“Click here to Create a new Security Group”.With to create a new security group for example,do as follows:Click"Next"to set up the configuration of the Instance.After set up the parameters,click"Create instance",then the new Instance will appear on the Instance list.4、Actions on InstanceOn the Instance list page,you can"start","terminate"an instance which is not running.For the Instances which is running,you can"terminate","stop","reboot", "connect"them."Refresh"button can refresh the virtual machine instance list.5、Connect an InstanceOn the virtual machine instance list,choose the instance you want to connect.Then click"Connect"button,it will prompt you to choose the Private Key for connection.Insert the USB disk and choose the suitable Private key.It will use the selected Private key to connect the Instance.If the Instance is with a Linux OS,then a user name for connection will be needed.The user name is usually"root",it also may be"ec2-user"or even other user names.To get the exact user name,you can connect to Amazon EC2 website through a browser in a PC,choose the instance and click“connect”in the"Instance Action"ComboBox,then find out the user name of the instance in the popup window.Enter the user name,the terminal will auto run SSH to connect the instance.The following screen shot shows an instance with“ec2-user”user name.If the instance is with a Windows OS,then the terminal will automatically connect to the instance through Remote Desktop Protocal(RDP)and start the Windows login page.After the remote operation ended,you can exit the instance and come back to the login page.There you can re-login,or shut off the power to end the operation directly.HUIYUAN Co.,LTD.info@2012-2。
亚马逊AWS学习——EC2的自定义VPC配置
亚马逊AWS学习——EC2的自定义VPC配置
1 网络配置
EC2即亚马逊AWS云服务中的虚拟主机。
创建EC2实例时如果使用的默认VPC并分配了公有IP是可以上网的。
但我们经常需要自定义的网络环境,这时就需要自己定义VPC和子网了。
1.1 配置VPC
如果你需要自己的VPC而不是系统默认的,一般需要提前建好。
在服务导航中选择VPC。
然后创建一个VPC:
注意CIDR块要设计好,如10.0.0.0/16。
1.2 创建子网
VPC选择之前建好的,CIDR块设置好,如10.0.0.0/24,或者10.0.1.0/24。
1.3 配置igw
igw即Internet Gateway,就是Internet网关啦,想与互联网访问联通igw是必须的。
先创建igw:
然后附加到你的VPC,也就是说让这个igw只在你的VPC内可用:
1.4 创建路由表
接下来要创建路由表。
注意创建的时候要选择你的VPC:
点击下面的“路由”选项卡,增加一条igw路由:
1.5 将EC2实例添加到你的VPC
在创建EC2实例的时候,选择你所创建的VPC和子网:
不要忘了将“自动分配共有IP”设置为“启用”。
最后创建好的EC2服务器,就可以通过公有IP连接了!
需要注意的是,如果igw和路由表等设置是在EC2实例启动之后设置上的,需要重启EC2服务器才能生效。
使用亚马逊例子:
使用亚马逊例子:EC2是Amazon于2006年推出的新一代hosting服务,而本文主要给大家介绍如何从无到有创建一个EC2的实例,并运行一个普通的Apache Web服务,总共包括三大部分:准备帐号、创建实例和启动服务。
准备帐号在使用EC2的服务之前,需要准备一个已激活EC2服务的AWS (Amazon Web Service)帐号。
整个帐号准备的过程有三个步骤组成:1.在AWS的主站点上注册一个账号。
2.通过点击帐号确认信的链接,会进入一个名为“Security Credentials”的页面,在这个页面用户会得到和这个帐号相绑定的密钥对、安全访问密钥以及x.509 安全证书,这些安全凭证将会在SSH 访问和API调用等方面使用到。
3.导航到EC2的页面,并点击“Sign Up For Amazon EC2”来激活EC2服务。
创建实例创建一个EC2实例共有七步组成。
图1. EC2的管理界面第一步:进入Amazon EC2的Web管理界面,在这个页面中会显示了现在使用资源的数量、数据中心的运行情况、文档链接和功能列表等。
接着,点击“Launch Instance”按钮来进入创建EC2实例的流程。
图2. 选择合适的AMI第二步:是选择合适的AMI,在这个选择AMI的界面(图2)中,系统可让用户在三类AMI中进行选择:第一类是“Quick Start”,这类AMI是Amazon推荐的的非常精简的AMI,比较适合初学者,主要有Fedora Core 8、Windows Server 2008和基于HVM技术的CentOS 5.4这三个系列;第二类是“My AMIs”,这类包含一些用户自定义或者加载特点应用的AMI,并且这些AMI权限是用户私有的;第三类是“Community AMIs”,这类AMI是由EC2社区的广大用户创建和维护的,并且是共享的,在量上,这些AMI是非常丰富,到现在为止,广大的EC2用户共上传了5300多个这种类型的AMI。
亚马逊EC2终端操作手册
Amazon EC2终端操作手册SUNDE亚马逊AWS EC2专用终端是为亚马逊EC2云计算服务量身定做的云计算终端。
用户只需拥有一个AWS账户,就可以通过终端连接亚马逊的云计算平台,进行虚拟机实例创建、登录等一系列操作,而无需使用PC机。
该终端还可以用于所有遵循亚马逊云计算协议规范的其他云计算平台。
1、终端登录终端开机后,登录界面如下:输入AWS EC2的domain name、access key id和secret access key后,点击login按钮登录到amazon。
其中access key id 和secret access key 是在亚马逊的官方网站注册在亚马逊的官方网站注册账户账户账户后,后,后,系统自动生系统自动生成的,可以成的,可以在账户的在账户的Security Credentials 选项中找到。
详情请访问 。
由于要输入的内容较多,也可以先把登录信息保存由于要输入的内容较多,也可以先把登录信息保存在名为在名为login.txt 的文件文件中中,并把文件保存到U 盘的根目录,点击read from udisk 按钮自动填入登录信息。
文件格式为:Domain Name=Access Key ID=AKIAI7UZEYA4EPDKJWQSWSecret Access Key=JS9MH2nekLjfi53cR2IPFMfIzu78W+H2nekLjfi52、终端设置在登录界面,点击设置按钮(setup ),将进入终端设置界面。
在设置界面可以设置终端的ip 地址和屏幕分别率地址和屏幕分别率。
在个别情况下需要设置终端的日期时间。
在个别情况下需要设置终端的日期时间或DNS 服务器,服务器,按按ctl+t 键可以设置终端的日期时间,按ctl+s 键可以设置DNS 服务器。
按S ave 按钮保存配置,按C ancel 返回终端登录界面。
3、创建实例所谓实例,就是用户在亚马逊云平台上的虚拟机。
用国内的vps登录亚马逊的ec2
⽤国内的vps登录亚马逊的ec2
问题:为什么不直接在电脑上⽤putty登录?
答:亚马逊的ec2都在国外,我直接登录⼀卡⼀卡的,很慢。
问题:为什么⽤国内的vps登录就快了?
答:⽐如我家是电信的带宽,我⽤天翼云注册⼀个云主机,最便宜那种,⼀年90左右。
然后从PC --> 天翼云主机,因为⼀个线路很快。
从天翼云主机-->亚马逊ec2,也很快。
原因估计是云主机更靠近主⼲⽹吧,猜测。
如何做?
1、在注册亚马逊ec2(免费的那种),选择⽤密钥对登录,这时系统会给你⼀个”XXX.pem",pem结尾的私钥。
2、⽤ scp 命令把这个私钥拷贝到国内主机:scp D:\putty\xxx.pem admin@123.123.123.123:/home/admin/.ssh
3、在国内主机 /root/.ssh/config ⽂件添加信息:
Host myec2
HostName 123.123.123.123
Port 22
IdentityFile ~/.ssh/xxx.pem
User admin。
亚马逊AWS EC2 配置总结
亚马逊AWS EC2 配置总结关于如何申请AWS,服务类型选择等等:/AWSEC2/latest/UserGuide/concepts.html#how-to-get-started在Amazon Linux 上安装LAMP Web 服务器:/AWSEC2/latest/UserGuide/install-LAMP.html以上均为亚马逊官方给出的用户手册,大公司的做派,文档详尽,服务器速度也很快,按文档上的说明很快就可以让你的服务器运行起来,由于经常换不同的电脑使用,记录在这里备查。
据朋友说可以在控制台里制作当前实例的备份,发送给其他账号,可以很快用另一个账号恢复实例,这个功能我没用过,记录一下,怕忘记了。
下来说说遇到的问题吧,经验告诉我们凡事特别顺利的事情,往往隐藏着巨大的问题,不管大神怎么看,我们凡人总是处于这样的困境之中。
--------------------------------------------问题1、session不能夸页面存储问题场景描述:apache+php+mysql全部都配好了,windows下安装了XShell+WinSCP,XShell可以通过ssh远程登录到服务器,使用命令行管理,这个工具稳定性比较好,目前还没出现断线的情况,WinSCP这个是个好工具,可以把本地文件直接拖到远程服务上,而且是图形界面,对于网站开发啥的还是很不错的(说了些题外话)。
我手头有个开发好的php项目,首先使用phpmyadmin把数据库导入进去,测试了一下,可以查到数据,然后通过winSCP把项目文件传到apache的工作目录(/var/html/www)下面,使用公网IP直接访问,登录页面直接就出来了,一阵高兴,然后输入用户名和密码登录,傻眼了,直接被重定向回登录页面,后来打印日志,跟踪错误,发现session在本页可以存入,也可以读出,但是登录成功后,定向到其他页面,所有的session取出来都是空,在网上一通查询,怀疑是权限问题,查找php.ini中对session存储的目录,sudo chmod 777 /tmp(是否该目录请通过phpinfo()查看session的存储目录),重启apache后,问题依旧,这样折腾了两天,感觉需要换个方向,后来偶尔在一个博主文章里找到解决办法。
2023年Amazon Web Services云服务操作指南及界面介绍
2023年Amazon Web Services云服务操作指南及界面介绍随着云计算技术的不断发展,Amazon Web Services(AWS)已经成为企业和个人最重要的云服务提供商之一。
AWS提供了一系列的云计算服务和工具,帮助用户轻松构建、管理和扩展他们的应用程序和基础设施。
本文将为您介绍2023年最新的AWS操作指南,并详细介绍AWS界面的主要特点和功能。
一、AWS操作指南1. 注册AWS账户首先,访问AWS官方网站并创建一个免费账户。
填写必要的信息并完成创建。
2. 选择AWS云服务在AWS控制台中,您可以浏览和选择所需的云服务。
AWS提供了包括计算、存储、数据库、网络、人工智能等多种服务,根据您的需求选择适合的服务。
3. 创建和管理实例AWS EC2(弹性云服务器)是AWS提供的弹性计算服务。
通过EC2,您可以创建和管理虚拟机实例,包括选择实例类型、操作系统、存储和安全设置等。
4. 存储和备份数据AWS S3(简单存储服务)是一种对象存储服务,可用于存储和备份数据。
您可以创建存储桶(bucket)来存储和管理数据,并设定访问权限。
5. 构建和部署应用程序AWS提供了一系列工具和服务来帮助您构建和部署应用程序,如AWS Lambda、Elastic Beanstalk和CodePipeline等。
您可以根据自己的技术需求和偏好选择适合的工具。
6. 监控和管理资源AWS CloudWatch是一种监控和管理AWS资源的服务。
它可以监控计算实例、存储、数据库等资源的性能和健康状态,并提供警报和自动化处理。
7. 安全和访问管理AWS提供了多种安全性和访问管理服务,如Identity and Access Management(IAM)和Web Application Firewall(WAF)。
您可以设置访问权限、加密数据并保护应用程序安全。
二、AWS界面介绍AWS界面是用户与AWS控制台进行交互的主要入口。
AWS_Helps
Amazon Web Services EC2 Getting Started GuideTable of ContentsIntroduction (3)Connecting to your EC2 instance (3)Setting up User Accounts (4)Tomcat (4)Installation (4)Configuration (5)Misc (6)Apache (7)Installation (7)Misc (7)MySQL (7)Installation (7)Configuration (8)PHPMyAdmin (9)Installation (9)Troubleshooting and Helpful Hints (10)2IntroductionAmazon Web Services (AWS) provides organizations with a flexible solution to the problem of deploying services on the web. All of this is done within the “cloud” which serves as the primary delivery method to end users. The cloud uses Amazon’s Elastic Compute Cloud (Amazon EC2) as the web service. This web service allows administrators to quickly deploy EC2 instances with minimal or little configuration. These EC2 instances vary in nature but most are Linux derivatives. In reality, these are just virtual machines accessible from the Internet when configured through the Amazon EC2 web service.NJIT has provided you with an EC2 instance, in which you must use for your project. This EC2 instance is considered to be a base install of a Linux derivative which you must configure appropriately to integrate with AWS. This guide is intended to get you started in preparing the architecture for development.Connecting to your EC2 instanceBy default, your EC2 instance will be accessible by SSH. NJIT’s UCS will have provided you with a private key (typically located in your AFS home directory) to connect to your EC2 instance. This will give you direct root access to your instance. It is recommended that you do not attempt to change this as this is the most secure way of accessing your EC2 instance.3Setting up User AccountsTo setup remote access shell accounts for your fel low classmates, you’ll need to create an account for them and setup a password. Do the following:Note: It is very important that you create a non-dictionary password. Because this box it will be publicly available on the Internet, it will be susceptible to brute-force attacks. By having a password for any of your users, you are at risk of compromise and loss of all of progress made in your in project.After you have successfully created your users, they’ll be able to connect directly to the EC2 ins tance via SSH.TomcatThe Tomcat application server allows execution of Java servlets and JavaServer Pages (JSPs). In the preceding directions, Tomcat version 5 was used. Tomcat version 6 should follow a similar installation and configuration.InstallationTo begin the installation process, we’ll use the YUM installer:After it has successfully installed, start the service and open your browser to http://hostname:8080 (NOTE: you must have requested from NJIT UCS prior to open port 8080 on the EC2 instance, changing the port to 80 will not work due to security restrictions.)45ConfigurationTo configure a user to access Tomcat you’ll need to modify the tomcat -users.xml file located in /etc/tomcat5.6In this file, you can create users and assign roles. The admin and manager roles are built-in that allow access to the manager web interface and administration interface. By default, the user ‘tomcat’ does not have full access to the administrative interface. Any modifications to this file will require that yourestart the Tomcat5 service.Misc∙ Server code for your tomcat web apps is located in /var/lib/tomcat5/webapps. It isrecommended that you put most your code for Tomcat in this directory. ∙ All configuration files are located in /etc/tomcat5.ApacheApache is a fully scalable HTTP web server which allows the serving of web pages.InstallationTo begin the installation process, we’ll use the YUM installer:After it has successfully installed, start the service and open your browser to http://hostname (NOTE: you must have requested from NJIT UCS prior to open port 80 on the EC2 instance.)MiscBy default, all web content is stored in /var/www/html.MySQLMySQL is a relational database management system which allows for fairly robust database architectures with muti-user level access.InstallationTo begin the installation process, we’ll use the YUM installer:After it has successfully installed, start the service.7ConfigurationIn order to begin creating and using the database you’ll need to setup root with administrative access.Log into mysql with the root user:To create a database named ‘cs633’, issue the following c ommand:To grant special privileges to a teammate who will be responsible for administrating the database, issue the following command:Flush privileges to write the privileges:89PHPMyAdminIf you prefer not to create or manage your database via the command line, you can use a graphical interface such as PHPMyAdmin. Prior to installation of PHPMyAdmin it is recommended that you have installed and configured Apache. Refer to the Installing Apache section if you need assistance.InstallationTo begin the installation process, we’ll use the YUM installer:Now point your browser tohttp://hostname/phpmyadmin and login with the root password you setup for the database administrator. Additionally, any user which you configured previously, can access this web interface.Note: if you receive a message such as “Forbidden” or “Access Denied”, you will need to modify the PHPMyAdmin configuration file located at /etc/httpd/conf.d/phpMyAdmin.conf to allow access. To ensure security, it is recommended that you allow PHPMyadmin to be accessible only by a certain IP or IP range. Also, ensure that “deny from all” is uncommented.Troubleshooting and Helpful Hints∙The YUM installer can run into iss ues when it can’t download a specific package and will fail. To fix this issue the following command: yum clean metadata. After issuing this command youshould be able to install the package you previously had trouble with.∙The easiest method to transfer files to your EC2 instance is to use SFTP or SCP. A client such as WinSCP() or FileZilla() can assist you with this. Simply supply your SSH credentials and the hostname to the client. You will then be able to transfer files.∙If you are looking for a package in the YUM repository try issuing the command: yum search <packagename>.∙To see a listing of all packages installed on the current system, issue the following command: yum list.∙To download files directly to the EC2 from the command line, use wget.∙To get a listing of daemons or services currently running, issue the command: ps –e.∙To kill a daemon or service, make note of the PID # and kill it by doing the following: kill <PID#>.∙Just as you can start services you can also shut them down or restart them. To shutdown a service such as the Apache web server you can issue the following command: /etc/init.d/apacheshutdown. To restart it, issue the following command: /etc/init.d/apache restart.10。
AmazonEC2之初体验(一)
AmazonEC2之初体验(⼀)Amazon EC2之初体验由于项⽬的需要,这⼏个⽉都在使⽤Amazon的EC2。
这个东西对于国内的⽤户来说⽐较陌⽣,但是听国外的同事说,这个在美国可是相当流⾏。
这⾥简单介绍⼀下,⼤家有兴趣也可以试试。
EC2全称Amazon Elastic Compute Cloud,是Amazon于2006年推出的新⼀代hosting服务,⽬前尚处于beta阶段,但是使⽤中没有发现什么问题,相当稳定。
EC2的功能介绍:要⽤EC2,有两个概念必须先了解。
Amazon Machine Image (AMI) - An Amazon Machine Image (AMI) is an encrypted file stored in Amazon S3. It contains all the information necessary to boot instances of your software.Instance - The running system based on an AMI is referred to as an instance. All instances based on the same AMI begin executing identically. Any information on them is lost when the instances are terminated or if they fail.对EC2有个⼤概了解之后,就可以开始在⽹上申请使⽤此项服务了。
1.⾸先必须先在Amazon Web Services上注册⼀个⽤户2.注册完毕后,回到Amazon Web Services页⾯,点击左边Browse Web Services中的Amazon Elastic Compute Cloud (Beta),然后在EC2页⾯中,点击右边的Sign Up For This Web Service。
亚马逊云EC2实验指导 Introduction to Amazon Elastic Compute Cloud(Amazon EC2)
Introduction to Amazon Elastic Compute Cloud (Amazon EC2)Table of ContentsIntroduction (3)Overview (3)What is Amazon Elastic Compute Cloud? (3)Topics Covered (3)Login to the AWS Management Console (3)Using qwikLAB to login to the AWS Management Console (3)Gather Your qwik LAB™ Key (4)Create an Amazon Linux Instance from an Amazon Machine Image (AMI) (4)Logging In to Your Instance (5)Additional Resources (6)Conclusion (7)For feedback, suggestions, or corrections, please email: aws-course-feedback@. (7)Copyright © 2013 Amazon Web Services, Inc. and its affiliates. All rights reserved.This work may not be reproduced or redistributed, in whole or in part,without prior written permission from Amazon Web Services, Inc.Commercial copying, lending, or selling is prohibited.For feedback, suggestions, or corrections, please email: aws-course-feedback@.IntroductionOverviewThis guide introduces you to Amazon Elastic Compute Cloud (Amazon EC2) using the AWS Management Console.What is Amazon Elastic Compute Cloud?Amazon EC2 is a web service that provides resizable compute capacity in the cloud. It is also designed to make web-scale computing easier for everyone.Amazon EC2 is more than just a virtual machine. The Amazon EC2 service offers a variety of benefits and features, such as elasticity, complete user control of resources, flexibility, reliability and security. It is also quick and easy to get up and running with Amazon EC2.Topics CoveredThis lab will introduce you to basic Amazon EC2 activities, including:•Logging into the Amazon Management Console•Creating an Amazon Linux Instance from an Amazon Machine Image (AMI)•Finding Your Instance in the Amazon Management Console•Logging into Your InstanceLogin to the AWS Management ConsoleUsing qwikLAB to login to the AWS Management Console1. From your QwikLab Lab screen, click Start Lab.2. You will need the QwikLab-generated username and password to access the AWS ManagementConsole, so Copy the password into the clipboard.3. Click Open Console4. Login to the console:a. User Name: awsstudentb. Password: Use the password in your clipboardGather Your qwik LAB™ Key5. Return to the qwik LAB™ web page and click the Download PEM dropdown box6. Choose PPK if you will be connecting through PuTTY on a Windows system, or PEM if you will be connectingwith a Mac or Linux system.Make note of the file location, as you will need it for connecting to your new instance!Create an Amazon Linux Instance from an Amazon Machine Image (AMI)To get started creating your first Amazon Instance, you will need to access the Amazon EC2 icon on the Amazon Management Console, and utilize the wizard.7. Return to the AWS Management Console which should still be open in your browser.8. Click Amazon EC2 Icon on the AWS Management Console homepage.9. Click the Instances link to create an instance.10. Click Launch Instance button, to begin the process.Note: There are many, different operating systems to leverage.11. In the first dialogue window, Step 1: Choose an Amazon Machine Image, choose the Amazon Linux AMIinstance by clicking Select next to that AMI.Note: You can leave the default 64-bit radio button selected.12. Step 2: Leave the instance type set to the default, which is t1.micro. To continue, click Next: ConfigureInstance Details.13. Step 3: Configure Instance Details, we will leave all of the default options and click Next: Add Storage.Tip: It is worthwhile to note the various options here. This is the location where you would set access, network settings, monitoring, and other options.14. Step 4: Add Storage, keep the default virtual hard drive. Click Next: Tag Instance.Note: You can easily add more virtual hard drives or change the drive size here.15. Step 5: Tag Instance, name your instance by using the tag instance interface. You’ll notice that the left handtext box is populated with the “key” Name and the right hand text box is empty. In the empty box, type a name such as “EC2 Free Lab” and click Next: Configure Security Group.Tip: This is a great place to put a name for your virtual server in the Value field... maybe something creative?16. Step 6: Configure Security Group, accept the default security group, as it allows port 22 (SSH) from anywhereto this Linux instance. Click Review and Launch.17. Step 7: With Review Instance Launch you get an overview of all the settings of your instance. Click Launch tocontinue.18. A key pair, which QwikLab has automatically created for you, should auto-populate in the second drop downbox.19. Click the acknowledgement checkbox stating that you have access to the private key.20. Now, click Launch Instance!Tip: Key pairs are how you access your instance after it is created. If you do not have a key pair, you will NOT be able to access the instance.21. Click View Instances to take a look at the new instance.Tip: Did you know that this can all be done via the command line?Complete! Once the instance state has changed to running, your instance will be ready to use! Now, you will look at logging into that instance.Logging In to Your InstanceNow that you have launched your Amazon EC2 Instance, it is time to log into it.22. As you are already at the Instances view within the Amazon EC2 dashboard, click the selection box next toyour Instance Name [i.e. EC2 Free Lab].23. Find your Public DNS name on this screen, which look something like the following:Public DNS: Tip: Use everything to the right of “Public DNS:” as a connection string to connect to this instance.24. Copy that connection string to your clipboard.MAC and Linux instructions25. On a Mac or Linux computer, modify the permissions of the downloaded PEM file to tighten the access(security) of the file. Be sure to use the correct path to the location that you saved your .pem file earlier. Your command line should look similar to: chmod 600~/Downloads/qwikLAB-l76-121457.pem26. On a Mac or Linux computer, use terminal to SSH to your instance connection string using the SSH identityfile noted earlier with the user name ec2-user. Be sure to use the correct Public DNS and the correct path to your .pem file. Your SSH line will look similar to this:ssh ec2-user@ -i ~/Downloads/qwikLAB-l76-121457.pem27. Ensure you accept the authenticity statement.28. You’re connected!Windows instructions29. Download PuTTY to a location of your choice using the following URL (unless you already have PuTTY):/~sgtatham/putty/download.html30. Double-click putty.exe (your downloaded copy or your existing copy).31. Type ec2-user@ into the Host Name field, then paste the Connection string you copied to your clipboardinto the Host Name input in Putty (using CTRL+V). Your full Host Name field will look something like this:ec2-user@ Note: If you didn’t copy your Public DNS name earlier, you can find it in the AWS Management Console Services > EC2 > Instances. Check the box next to your instance name and the Public DNS should appear on the page.32. Expand the SSH category by double-clicking it.33. Select the Auth category by clicking on the word “Auth” (not the + symbol next to the word “Auth”).34. Click Browse.35. Navigate to the location where you saved the .ppk file earlier in the lab.36. Select the .ppk file you downloaded.37. Click Open.38. In the PuTTY client, click Open.39. When prompted, click Yes to allow PuTTY to cache the server’s host key.40. You are presented with a connected instance! Easy!End Your Lab41. Return to the QwikLab lab homepage and click End Lab to conclude your lab.Additional Resources•For more information about Amazon EC2 and Amazon EC2 pricing, go to the Amazon EC2 product page.•AWS Training and Certification.ConclusionCongratulations! You now have successfully:•Logged into the Amazon Management Console•Created an Amazon Linux Instance from an Amazon Machine Image (AMI)•Found Your Instance in the Amazon Management Console•Logged into Your InstanceFor feedback, suggestions, or corrections, please email: aws-course-feedback@.。
亚马逊云教程1:云是什么,创建并连接EC2
亚马逊云教程1:云是什么,创建并连接EC2 作者注:最近云计算越来越火,生物信息学专业出生的我前段时间也使用了一下亚马逊云AWS其中的一个服务,云上的服务器,EC2。
这里以教程的形式和大家分享一下我的学习路径。
这是一份系列教程,一共7篇。
从“云是什么”开始介绍,然后讲到如何在云上建立并使用服务器,之后介绍了云上多个Python环境的管理和使用方法,conda和jupyter notebook的使用,最后介绍了谷歌的开源机器学习包TensorFlow及其GPU版本的安装方法,和一个简单的机器学习实例,MNIST。
这份教程并不能让大家掌握云、掌握EC2或者是学会机器学习,其主要目的是用一些比喻和基本的案例让没有接触过云的朋友了解其中的一些概念和基本的使用方法,然后深入学习。
所以文中有些步骤并不是直接给出操作方法,而是从介绍这个步骤干了什么事情,以及如何在网上搜索“实现这个步骤的方法”开始的。
主要面向的读者是在个人电脑上有数据分析经验,之后想使用云的朋友。
开始写的时候想着大部分读者可能不是计算机专业出生的,所以前面几篇中用了很多比喻介绍了一些基本概念。
从第五篇开始,大篇幅的基本概念的介绍和比喻减少,专注于实现的步骤,偶尔在新概念旁边使用比喻。
每一篇的结构是“概要、读者、时间、前提、正文、推荐阅读、集锦卡”。
大家可以在推荐阅读中深入学习。
集锦卡是全文核心步骤的集合,可用于后续实现时的参考。
写得略匆忙,后续可能会添加截图和视频帮助理解。
亚马逊云教程1:云是什么,创建并连接EC2概要:云是什么,在亚马逊云创建Ubuntu 16.04虚拟服务器,从本地机器连接到服务器,关闭、重启服务器,AWS计费方式读者:计划使用云的朋友时间:5000字,阅读10min,操作5min前提:一个亚马逊“云”账号首先说一下什么是云(粗浅的理解,懂得朋友请跳过或给予建议)。
我们平时在使用电脑的时候,键盘和主机是连在一起的。
使用过腾讯QQ“远程协助”功能的朋友会用自己的键盘鼠标控制对方的电脑。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
amazon ec2 新手使用指南
最近折腾了下Amazon (亚马逊)EC2 的服务,感觉还行,也是折腾了好久,关键是没有中文文档,折腾起来很费劲,弄好后,特弄个教材上来。
关于亚马逊的EC2 介绍,我就不多说了,我这里主要写如何初次使用,如果创建和连接VM。
如果已经申请帐号,申请帐号需要信用卡,需要支持vista 的或者万事达卡。
需要开通国际支付的功能,以后使用ec2 的服务,直接从信用卡里面支付。
具体的申请方法,不做介绍。
申请帐号成功以后,到/console登录,如下图:
输入登录密码以后,登录到系统控制台,如下图:
点击“Lanuch instance ”装载一个实例,如下图:
点击继续默认
这里也选择默认
到了这一步就要注意了,提示你选择一个公私,或者创建一个公私,这个地方如果是第一次,就需要选择第二项,创建一个“key pair”。
输入key的名称后,点击“创建” ,系统会自动生成一个key,然后提示你保存,如下,这个时候,一定要把这个公私保存好,稍后生成密码的时候需要用到。
点击下一步后,系统会提示你要创建防火墙规则,一般选择默认即可。
意思就是说,如果虚拟机创建成功,如下的端口,可以从外部访问。
也就是亚马逊为你做好防火墙了,这里的端口,外部可以访问,自己根据情况添加,然后点击下一步
点击下一步后,出现实例汇总的情况,如下图
点击launch 按钮,装载这个实例,也就是创建了一个新的vm
点击关闭后,回到系统控制台界面,这个时候,就可以看到已经创建的实例,也就是虚拟机了,如下图:
点击刚才创建的虚拟机,下面就可以看到该虚拟机的一些基本情况,如下图:这里的Public dns 的ip地址,就是稍后登录的域名,不过这个域名每次启动系统都会更改,不知道亚马逊为什么要这样???
好了,系统创建完成了,也开始运行了,远程如何登录呢?
Windows 系统,创建完成以后,要等15分钟以后才能获取到登录到系统的密码!这个时候,就要向亚马逊获取系统登录密码,方法如下:
选择一个实例以后,点击右键,出现一个菜单,选择创建密码,如下图:
需要等15分钟
等15分钟后,就可以了,如下图:
这里就要注意了,这里要输入private key ,这个key 就是刚才创建实例的时候,提示你要下载的公私文件,用记事本把刚才下载的那个 .pem 结尾的文件,然后复制里面所有的内容到里面,点击确定后,就会出现系统的密码啦,用这个密码登录系统就可以了。
如下图:
这个时候,就可以用这个密码登录系统啦,登录后,系统还不错,如下:。