东莞实施“明厨亮灶”

东莞实施“明厨亮灶”的餐饮单位数达11899家

Source: http://www.o769.cn/baixing/Info.asp?ID=7129

民以食为天,食品安全问题总是牵动大众的神经。记者7日从东莞市食药监局获悉,目前越来越多餐饮服务单位主动把后厨“亮”给市民看,全市实施“明厨亮灶”的餐饮单位数已达11899家,覆盖全市餐饮单位逾三分之一。

“明厨亮灶”分六种类别

不少餐馆的后厨门口都贴着“厨房重地,闲人免进”的提示,厨房的卫生状况和食品加工过程并不透明。“谁知道后厨到底卫不卫生呢?所以有时外出吃饭难免会提心吊胆。”很多市民担心。

“为了创新监管模式,强化餐饮服务单位的责任意识,早在2013年,我局就在部分中小学校、幼儿园食堂等餐饮单位率先试点开展‘明厨亮灶’工作。”据市食药监局相关负责人介绍,“明厨亮灶”就是将餐饮服务单位的操作间、凉菜间、洗消间等食品加工制作的关键部位和原料清洗、切配、烹饪、餐具洗消、凉菜加工等重要环节,通过透明玻璃窗(或玻璃幕墙)、电子显示屏、隔断矮墙等方式展示给消费者,实现阳光操作、透明化管理。

据了解,广东省去年也已出台了“明厨亮灶”规范指引——按照新修订的《广东省食品安全条例》第三十二条有关规定,将餐饮“明厨亮灶”建设分为透明式、开放式、视频监控式、参观通道式、组合式、其他形式等六种类别,并结合建设“餐饮服务食品安全信息公示栏”,向消费者展示食品加工制作关键过程,接受消费者监督。

用餐不再“眼不见为净”

昨日中午,记者走进厚街万达广场发现,作为厚街食品安全示范创建对象,这里已经实现“明厨亮灶”工程全覆盖。45家餐饮服务企业,均通过视频监控或透明式厨房等方式,让用餐顾客能看到厨房内部的操作。放眼望去,很多家餐厅在门口挂出了他们的监控电视,上面播放着厨房的实时画面。

记者在一家顺德菜餐厅看到,门口的监控电视中,两个画面对准了原料清洗和切配区域,另有两个画面显示着角落与地面的状况,看起来都比较整洁。餐厅里面还有一个监控电视,这样一来,顾客在选择餐厅前和用餐过程中,都能看到厨房内部的实时情况。

带着全家老小一同用餐的顾女士说:“以前外出吃饭都看不到这些后台操作,‘眼不见为净’。现在食客能直观地看到后面的卫生状况,的确会更放心,但是我们只能看到后厨的卫生情况和厨师的操作过程,食物的用料和材质看不到,希望接下来餐饮单位能公示原材料和辅料来源。”

“食药监部门已经叫我们去开过会,对此事我既支持又担心。”南城一家餐馆的负责人认为,一是会增加企业成本,二是担心泄露一些大厨的炒菜秘方,让竞争对手钻了空子。“如果同行都‘明厨亮灶’,而我们不这样做,那竞争力就弱了很多。所以现在正在考虑,究竟要怎么改。”

学校食堂过半“明厨亮灶”

据市食药监局相关负责人透露,东莞将坚持按照“企业自愿、行业自发、政府引导、主动参与、因地制宜”的工作思路,确定一些新开办基础设施好的餐饮单位、学校食堂、大型以上餐馆及其他高风险类餐饮服务单位作为“明厨亮灶”建设的重点,以点带面,逐步推行,力争用三年时间基本完成全市餐饮服务单位“明厨亮灶”工作目标。

“目前全市已经实施‘明厨亮灶’的餐饮单位数达11899家,其中学校食堂达927家,占学校食堂总数一半以上。”该负责人表示,东莞会严把许可准入,对新开办餐饮服务单位,引导按“明厨亮灶”工程的要求指导建设;对所有餐饮服务单位换发证时,强调“明厨亮灶”作为必要条件重新进行现场核查,建成开放式厨房、使用透明玻璃隔断、采用视频传输等技术。

东莞实施“明厨亮灶”的方案:
“明厨亮灶”实施方案一是用玻璃隔断展现,实现透明厨房 通过玻璃窗口消费者可以看到餐厅后厨师傅做菜的烹饪过程!这也是明厨亮灶最早的展现方式!同时跟据食品安全信息公示牌让监控管理人员和食客及时了解到食品的采购信息。

“明厨亮灶”实施方案二是通过后厨安装高清远程监控摄像设备实时直播将厨房生态——食材选择、烹饪加工、剩菜处理、餐具消毒等所有环节,以及厨房卫生情况、厨师仪表穿着等,一一呈现给食客,保障其知情权与监督权,让他们吃得更放心、吃得更安全。

“明厨亮灶”实施方案三是通过后厨安装高清远程监控摄像设备实时直播将厨房生态——食材选择、烹饪加工、剩菜处理、餐具消毒等所有环节,以及厨房卫生情况、厨师仪表穿着等,一一呈现给食客,保障其知情权与监督权,让他们吃得更放心、吃得更安全。

“明厨亮灶”实施方案四是实现了第三的所有功能还增加了从食品食材种植环境,食材储存、厨房环境、配菜烹调加工等过程就实现了全程透明化,实时性、公开性、透明性的阳光透明厨房,让消费者更放心!

Server Window Update Procedure

Section 1: Introduction

Because window update will impact to server operation, we should handle it carefully. According to the Microsoft paper of “Best Practices for Applying Service Packs, Hotfixes and Security Patches” as appendix in this document, we should apply the patch on needs base, and may not necessary to apply all patches. Moreover, we need to test the patch in testing server before applied to production server. Furthermore, because some application servers may have negative or unforeseen impact after patch update, we advise not to perform window update in application server. Let’s describe the window update procedure in following section for your reference.

Section 2: List of Servers to Window Update

The following servers will be included to perform the window update as below:

 

Server Name Install ip Machine Type & Usage
 

Exclude list : We did not perform the window update in application servers, because it is difficult to evaluate the impact of patch to the application operation. However, if we decide a window update is critical and is necessary to apply, we have to test it in a testing server; then apply to production application servers after testing okay.

Normally, we will exclude the following servers from window update because we installed business application software in them.

Server Name Install ip Machine Type & Usage

 

Section 3: Schedule to Perform Window Update

We plan to perform window update in servers monthly. In order not to affect the month-end operation, we plan to do it during non-office hours in second or third week of a month.

Section 4: Test-Run the Window Update

1. Backup a virtual testing server in PRC via VM snapshot function

2. Run the “Check for Updates” option as below diagram:

  • Generate a list of Window Server Patch Update and review its content as below diagram.

Update Patch List:

Patch List Plan to Update (yes/No) Remark
KB4041083 Yes
KB4049016 Yes
KB4054518 Yes
KB4052978 Yes
KB4033342 Yes
KB2823180 Yes
KB890830 Yes

3. Perform the patch update in the testing server, and report the result as below green highlight column:

Patch List Plan to Update (yes/No) Testing Result   (Pass/Failure)
KB4041083 Yes
KB4049016 Yes
KB4054518 Yes
KB4052978 Yes
KB4033342 Yes
KB2823180 Yes
KB890830 Yes  

4. Resolve any issue if necessary; or not plan to update any issue patch

Section 5: Apply Patch in Production Servers

  1. Backup Virtual Servers:

Local-IT team will create VM snapshot for the following virtual servers:

Server name Install ip Machine Type & Usage Server Backup
 

2. Patch Update PRC Servers:

Local-IT team will perform Patch Update for virtual servers as below list. We will schedule to patch those servers during non-office hour (e.g. 7:00pm during week-day). If reboot require after patch update, we will also reboot during off-office hour.

Server Name Install ip
 

3. IT team will perform Patch Update for Hardware servers as below list.
We will schedule to patch those servers during non-office hour (e.g. 7:00pm during week-day). If reboot require after patch update, we will also reboot during off-office hour.

Server Name Install ip
 

 4. Trouble-Shoot to solve any issue; maybe roll-back the server image or uninstall patch if necessary.

        5. Update the “Patch ID and Date” in below two log tables as highlight in green columns:

Server Patch Update Log
Server name Install ip Machine Type & Usage Server Backup Patch ID & Date
 

 

Appendix: Best Practices for Applying Service Packs, Hotfixes and Security Patches

Reference information from https://msdn.microsoft.com/en-us/library/cc750077.aspx as below:

Service packs, hotfixes and security patches are updates to products to resolve a known issue or workaround.

Moreover, service packs update systems to the most current code base. Being on the current code base is important because that’s where Microsoft focuses on fixing problems. For example, any work done on Windows 2000 is targeted at the next service pack and hotfixes are built against the existing available base.

Individual hotfixes and security patches on the other hand should be adopted on a case-by-case, “as-needed” basis. The majority of security updates released are for client side (often browser) issues. They may or may not be relevant to a server installation. Evaluate the update, if it’s needed, then apply it. If not, assess the risk of applying or not.

  • Apply updates on a needs only basis.

One of the common misconceptions about Microsoft updates is that they are mandatory and/or urgent.

All updates, regardless of their type (whether they are service packs, hotfixes or security patches), are to be applied on an “as-needed” basis. They need to be evaluated individually and treated as important optional updates.

Especially with security patches, the expectation is that it must be an urgent issue and must be deployed quickly. Without trying to detract from the urgency, security patches are very much a relative update; for example, customers using solely Windows NT4 can ignore a patch for a security vulnerability in Windows 2000. However, if the issue is relevant and does plug a security hole, then it should be evaluated urgently.

Only when it addresses or fixes an issue being experienced by the customer should it be considered. Of course, it still needs to be evaluated before being installed.

  • Testing.

The prior points really assist in giving you a feel (before installing) for the potential impact, however, testing allows for the “test driving” and eventual signing off of the update.

Service packs and hotfixes must be tested on a representative non-production environment prior to being deployed to production. This will help to gauge the impact of such changes.

-END-

How to start mining via Antpool & BTC.com

information source: https://support.bitmain.com/hc/en-us/articles/115000211774-Connect-Antminer-S9-T9-S7-to-Pools-Antpool-BTC-com

Connect Antminer S9/T9/S7 to Pools – Antpool/BTC.com

Connect to Antpool


1.Login:https://www.antpool.com/

1.png

 


2. Enter your User ID and password for Bitmain.com to log into Antpool or register a new account.

2.png


3. Click the “Bitcoin”at the upper left of the page. Go to the Settings tab and add a Sub-Account via the button on the right.

3.png


Sub-account must contain only the letters or numbers

4.png


4. Enter the default IP address of the ANTMINER  – Go to the login page, enter the user ID: root, password: root.

5.png
5. Click Miner Configuration, you can fill in 3 groups of mining pool. If the first group is dead, then, it will automatically pointed to the second group. You could fill first 2 groups with Antpool, the third one with BTC.com.

Below is the configuration of Antpool:

stratum+tcp://stratum.antpool.com:3333
stratum+tcp://stratum.antpool.com:443
stratum+tcp://stratum.antpool.com:25

Worker Format: sub-account.miner name

Example: If your sub-account is “antminer”, then your miners could be set up as antminer.1, antminer_1, antminer.2, etc. The miner order will be sorted by the miner name.

Password: (Blank). if you change addresses in bulk, fill it as 123.

 

Click Save & Apply to mine, the miners will be restart.

 

6.png

 

Connect to BTC.com

Account Registration

1. Login the home page: https://pool.btc.com

2. Click the “Sign Up Now ” button:

 

 

3. Complete the informtaion required and create a new account:

 

Sub-Account Configuration

1. Click the user name on the top right and choose create sub-account:

 

2. Fill the blanks and complete creating sub-account:

 

Miner Configuration

1. Node Selection

There is network delay when users connecting miners to different nodes in different area. Selecting the nearest nodes can provide the most stable connection.

North China Mining Address

    stratum+tcp://cn.ss.btc.com:1800
    stratum+tcp://cn.ss.btc.com:443
    stratum+tcp://cn.ss.btc.com:25

South China Mining Address

    stratum+tcp://us.ss.btc.com:1800
    stratum+tcp://us.ss.btc.com:443
    stratum+tcp://us.ss.btc.com:25

America Mining Address

    stratum+tcp://us.ss.btc.com:1800
    stratum+tcp://us.ss.btc.com:443
    stratum+tcp://us.ss.btc.com:25

Europe Mining Address

    stratum+tcp://us.ss.btc.com:1800
    stratum+tcp://us.ss.btc.com:443
    stratum+tcp://us.ss.btc.com:25

 

2. Miner Setting

Format: sub-account.miner name

Example: If your sub-account is “btcminer”, then your miners could be set up as btcminer.001, btcminer.002, etc. The miner order will be sorted by the miner name. Password: (Blank). if you change addresses in bulk, fill it as 123.

3. Miner Conection Setting

Type the IP address of miners into the address bar with a web browser under the local area network. The default account is: username ‘root’, password ‘root’.


Sub-Account Management

1. After signing up on BTC pool, uses can establish multiple sub-accounts for different needs.

Click the current sub-account on top right corner:

 

2. Users can edit every sub-account on this page, such as modifying address and setting alert:

 

 

Information Modification

Click “settings” button on top right of the website, you can modify your account and address as follows:

 

Payment Confirmation

Payment Time

BTC Pool settles all the earnings of last day at UTC 00:00 and sends the payment in 2 hours.

Confirmation Time

The confirmation of TX takes time on Bitcoin Network. The time could be 1 minute or up to 2 hours, which depends on the network status. BTC Pool promises that users receive the payment in the shortest time.

Quality Management Concept – Quality vs Grade & Accuracy vs Precision

Difference between Quality and Grade

Quality and grade is difference. Quality as a delivered performance or result is “the degree to which a set of inherent characteristics fulfill requirements” (ISO 9000). Grade as a design intent is a category assigned to deliverables having the same functional use but different technical characteristics. While a quality level that fails to meet quality requirements is always a problem, a low grade of quality may not be a problem. For example:

  • It may not be a problem if a suitable low-grade software product (one which a limited number of features) is a high quality (no obvious defects, readable manual). In this example, the product would be appropriate for its general purpose of use.
  • It may be a problem if a high-grade software product (one which numerous features) is of low quality (many defects, poorly organized user documentation). In essence, its high-grade feature set would prove ineffective and/or inefficient due to its low quality.

Difference between Accuracy and Precision

The project management team should determine the appropriate levels of accuracy and precision for use in the quality management plan. Precision is a measure of exactness. Accuracy is an assessment of correctness. For example, if the measured value of an item is very close to the true value of the characteristic being meansured. the measurement is more accurate. An illustration of this concept is the comparison of archery targets. Arrows clustered tightly in one area of the target, even if they are not clustered in the bull’s eye, are considered to have high precision. Targets where the arrows are more spread out but equidistant from the bull’s eye are considered to have the same degree of accuracy. Targets were the arrows are both tightly grouped and within the bull’s eye are considered to be both accurate and precise. Precise measurements are not necessary accurate measurements, are accurate measurements are not necessarily precise measurements.

Diary of IT Man – My Road to Pass PMP Exam

pmpIt was a nowadays requirement for any professional to continue study, so, I planned to enhance my project management knowledge which should be useful for my IT management skill. I decided to take a PMP exam and got a PMP certification. PMP stands for Project Management Professional, and it is endorsed by a US’s Project Management Institute (https://www.pmi.org/).

I thought that PMP exam should be easy for me because I had rich experience to handle IT projects. I did not intent to join any course, however, it was a requirement from PMI that a candidate had to register a course, so that I registered a PMP on-line preparing course from https://www.udemy.com/ in Oct 2017. The Udemy PMP course costed only US$10.99, which was a very good price. Although the concept of project management was very generic, I needed to learn many PMP specific terms and definition from Udemy, which were new to me. After I have finished the Udemy on-line course, I could only get 70 marks from its drill test, which I should get 75 marks or above in order to ensure to pass the exam according to the lecturer comment.

After the Udemy course, I borrowed two books from library to self-study: I) “Pass the PMP exam : tools, tips and tricks to succeed” by Sean Whitaker ; ii) “PMP practice makes perfect : over 1000 PMP practice questions and answers” by John Estrella. After I have finished these two books, I still did not comfortable. I searched from web and found a web site  https://edward-designer.com/web/pmp/ which Edward shared his experience about PMP exam. It provided me many useful information.

My final preparation work is to read the PMBOKGuide from PMI, and did more free mock exam questions from web, such as from Oliver Lehmann (Online) and Edwel Mock Exam.

Luckily, I passed the PMP exam in my first in-take. I spent totally 6 months to prepare the exam, and I passed it in Mar 2018.

_____________________________________________________________________

Additional information about Changing of PMP Exam on or after 26 Mar 2018 as below.

The release of the PMBOK® Guide – Sixth Edition in September 2017, the PMP exam will change 26 March 2018. These updates will ensure the exam content is consistent with the PMBOK® Guide.

Although the PMP is not a test of the PMBOK® Guide, it is one of the primary references for the exam. Some of the updates you can expect to see surround lexicon changes and terminology used within the exam as well as harmonization of process groups, tools, and techniques.

The major updates to the sixth edition are summarized below:

  • A new chapter on the role of the project manager has been added to focus on leading projects effectively – competencies, experience, and skills that are all necessary.
  • Two Knowledge Areas have been re-named to more accurately reflect which elements can be managed and which cannot:

o    Time Management is now Schedule Management

o    Human Resource Management is now Resource Management

Every Knowledge Area features four new sections:

  1. Key Concepts
  2. Trends and Emerging Practices
  3. Tailoring Considerations
  4. Considerations for Agile/Adaptive Environments

The sixth edition will also present new content around considerations for agile/adaptive environments and the PMI Talent Triangle®.

We wish you the best of luck on upcoming exam!

MySQL operation script for beginner

Create a new user within the MySQL shell:
mysql> CREATE USER ‘newuser’@’localhost’ IDENTIFIED BY ‘password’;
Create Permissions:
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘newuser’@’localhost’;
Reload all the privileges.
mysql> FLUSH PRIVILEGES;
Your changes will now be in effect.
Revoke a permission:
mysql> REVOKE [type of permission] ON [database name].[table name] FROM ‘[username]’@‘localhost’;
Delete databases with DROP, you can use DROP to delete a user altogether:
mysql> DROP USER ‘demo’@‘localhost’;
To get a list of MySQL users:
mysql> select user,host from mysql.user;
To find the privilege(s) granted to a particular MySQL account:
mysql> show grants for ‘root’@’%’;
After test out your new user, log out by typing
mysql> quit

drop database goldman_wrdp8

CREATE Database goldman_wrdp8

use goldman_wrdp8;

source import_file.sql;
update wp_options SET option_value=’http://goldman168.no-ip.org/goldmanau’ where option_name=’siteurl’;

update wp_options SET option_value=’http://goldman168.no-ip.org/goldmanau’ where option_name=’home’;

extract a gz file?

Use guzip command as follows:
$ gunzip file.gz
OR
$ gzip -d file.gz

Change user password;

MySQL 5.7.6 and later:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';

MySQL 5.7.5 and earlier:

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');

OR

UPDATE mysql.user SET authentication_string = PASSWORD(‘MyNewPass’), password_expired = ‘N’ WHERE User = ‘root’ AND Host = ‘localhost’; FLUSH PRIVILEGES;

IT人在工廠日記 – 工厂員工死亡事件

最近,工厂又發生大件事,一名員工在宿舍被殺身亡,疑似是情殺,但是疑兇其後亦在它處被發現自殺身亡,雖然遇害員工是非工傷死亡,但是因為事件發生在宿舍,工厂仍有一定的責任,根據律師估計,工厂賠償不會超過廿萬元,可是,家屬要求工厂賠償八十萬,認真獅子大開口,家屬不肯讓步,談判失敗。這些大陸人的心態,不管合不合理,有機會便盡刮一筆錢,真令人失望。
現時,家屬開始搗事,在工厂門口擺放祭壇,滋擾工厂,而工厂管理層現階段十分忍讓,非必要時不會找公安或外經幫手。

時近年尾春節,發生此事,真是大吉利事,而且工厂的春茗晚飯也因此取消,各人也沒心情興祝啦!希望此事早點完結,死者入土為安,家屬節哀,重新生活吧!

AWS Managed VPN Connections

Source: http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html

AWS Managed VPN Connections

By default, instances that you launch into a virtual private cloud (VPC) can’t communicate with your own network. You can enable access to your network from your VPC by attaching a virtual private gateway to the VPC, creating a custom route table, updating your security group rules, and creating an AWS managed VPN connection.

Although the term VPN connection is a general term, in the Amazon VPC documentation, a VPN connection refers to the connection between your VPC and your own network. AWS supports Internet Protocol security (IPsec) VPN connections.

Your AWS managed VPN connection is either an AWS Classic VPN or an AWS VPN. For more information, see AWS Managed VPN Categories.

Important

We currently do not support IPv6 traffic through a VPN connection.

For information about how you’re charged for using a VPN connection with your VPC, see the Amazon VPC product page.

Components of Your VPN

A VPN connection consists of the following components. For more information about VPN limits, see Amazon VPC Limits.

Virtual Private Gateway

virtual private gateway is the VPN concentrator on the Amazon side of the VPN connection. You create a virtual private gateway and attach it to the VPC from which you want to create the VPN connection.

When you create a virtual private gateway, you can specify the private Autonomous System Number (ASN) for the Amazon side of the gateway. If you don’t specify an ASN, the virtual private gateway is created with the default ASN (64512). You cannot change the ASN after you’ve created the virtual private gateway. To check the ASN for your virtual private gateway, view its details in the Virtual Private Gateways screen in the Amazon VPC console, or use the describe-vpn-gateways AWS CLI command.

Note

If you create your virtual private gateway before 2018-06-30, the default ASN is 17493 in the Asia Pacific (Singapore) region, 10124 in the Asia Pacific (Tokyo) region, 9059 in the EU (Ireland) region, and 7224 in all other regions.

Customer Gateway

customer gateway is a physical device or software application on your side of the VPN connection.

To create a VPN connection, you must create a customer gateway resource in AWS, which provides information to AWS about your customer gateway device. The following table describes the information you’ll need to create a customer gateway resource.

Item Description
Internet-routable IP address (static) of the customer gateway’s external interface. The public IP address value must be static. If your customer gateway is behind a network address translation (NAT) device that’s enabled for NAT traversal (NAT-T), use the public IP address of your NAT device, and adjust your firewall rules to unblock UDP port 4500.
The type of routing—static or dynamic. For more information, see VPN Routing Options.
(Dynamic routing only) Border Gateway Protocol (BGP) Autonomous System Number (ASN) of the customer gateway. You can use an existing ASN assigned to your network. If you don’t have one, you can use a private ASN (in the 64512–65534 range).If you use the VPC wizard in the console to set up your VPC, we automatically use 65000 as the ASN.

To use Amazon VPC with a VPN connection, you or your network administrator must also configure the customer gateway device or application. When you create the VPN connection, we provide you with the required configuration information and your network administrator typically performs this configuration. For information about the customer gateway requirements and configuration, see the Your Customer Gateway in the Amazon VPC Network Administrator Guide.

The VPN tunnel comes up when traffic is generated from your side of the VPN connection. The virtual private gateway is not the initiator; your customer gateway must initiate the tunnels. If your VPN connection experiences a period of idle time (usually 10 seconds, depending on your configuration), the tunnel may go down. To prevent this, you can use a network monitoring tool to generate keepalive pings; for example, by using IP SLA.

For a list of customer gateways that we have tested with Amazon VPC, see Amazon Virtual Private Cloud FAQs.

AWS Managed VPN Categories

Your AWS managed VPN connection is either an AWS Classic VPN connection or an AWS VPN connection. Any new VPN connection that you create is an AWS VPN connection. The following features are supported on AWS VPN connections only:

  • NAT traversal
  • 4-byte ASN (in addition to 2-byte ASN)
  • CloudWatch metrics
  • Reusable IP addresses for your customer gateways
  • Additional encryption options; including AES 256-bit encryption, SHA-2 hashing, and additional Diffie-Hellman groups
  • Configurable tunnel options
  • Custom private ASN for the Amazon side of a BGP session

You can find out the category of your AWS managed VPN connection by using the Amazon VPC console or a command line tool.

To identify the VPN category using the console

  1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.
  2. In the navigation pane, choose VPN Connections.
  3. Select the VPN connection, and check the value for Category in the details pane. A value of VPN indicates an AWS VPN connection. A value of VPN-Classic indicates an AWS Classic VPN connection.

To identify the VPN category using a command line tool

  • You can use the describe-vpn-connections AWS CLI command. In the output that’s returned, take note of the Category value. A value of VPN indicates an AWS VPN connection. A value of VPN-Classic indicates an AWS Classic VPN connection.In the following example, the VPN connection is an AWS VPN connection.
    aws ec2 describe-vpn-connections --vpn-connection-ids vpn-1a2b3c4d
    {
        "VpnConnections": [
            {
                "VpnConnectionId": "vpn-1a2b3c4d", 
    
                ...
    
                "State": "available", 
                "VpnGatewayId": "vgw-11aa22bb", 
                "CustomerGatewayId": "cgw-ab12cd34", 
                "Type": "ipsec.1",
                "Category": "VPN"
            }
        ]
    }

Alternatively, use one of the following commands:

Migrating to AWS VPN

If your existing VPN connection is an AWS Classic VPN connection, you can migrate to an AWS VPN connection by creating a new virtual private gateway and VPN connection, detaching the old virtual private gateway from your VPC, and attaching the new virtual private gateway to your VPC.

If your existing virtual private gateway is associated with multiple VPN connections, you must recreate each VPN connection for the new virtual private gateway. If there are multiple AWS Direct Connect private virtual interfaces attached to your virtual private gateway, you must recreate each private virtual interface for the new virtual private gateway. For more information, see Creating a Virtual Interface in the AWS Direct Connect User Guide.

If your existing AWS managed VPN connection is an AWS VPN connection, you cannot migrate to an AWS Classic VPN connection.

Note

During this procedure, connectivity over the current VPC connection is interrupted when you disable route propagation and detach the old virtual private gateway from your VPC. Connectivity is restored when the new virtual private gateway is attached to your VPC and the new VPN connection is active. Ensure that you plan for the expected downtime.

To migrate to an AWS VPN connection

  1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.
  2. In the navigation pane, choose Virtual Private GatewaysCreate Virtual Private Gateway and create a virtual private gateway.
  3. In the navigation pane, choose VPN ConnectionsCreate VPN Connection. Specify the following information, and choose Yes, Create.
    • Virtual Private Gateway: Select the virtual private gateway that you created in the previous step.
    • Customer Gateway: Choose Existing, and select the existing customer gateway for your current AWS Classic VPN connection.
    • Specify the routing options as required.
  4. Select the new VPN connection and choose Download Configuration. Download the appropriate configuration file for your customer gateway device.
  5. Use the configuration file to configure VPN tunnels on your customer gateway device. For examples, see the Amazon VPC Network Administrator Guide. Do not enable the tunnels yet. Contact your vendor if you need guidance on keeping the newly configured tunnels disabled.
  6. (Optional) Create test VPC and attach the virtual private gateway to the test VPC. Change the encryption domain/source destination addresses as required, and test connectivity from a host in your local network to a test instance in the test VPC.
  7. If you are using route propagation for your route table, choose Route Tables in the navigation pane. Select the route table for your VPC, and choose Route PropagationEdit. Clear the check box for the old virtual private gateway and choose Save.

    Note

    From this step onwards, connectivity is interrupted until the new virtual private gateway is attached and the new VPN connection is active.

  8. In the navigation pane, choose Virtual Private Gateways. Select the old virtual private gateway and choose Detach from VPCYes, Detach. Select the new virtual private gateway, and choose Attach to VPC. Specify the VPC for your VPN connection, and choose Yes, Attach.
  9. In the navigation pane, choose Route Tables. Select the route table for your VPC and do one of the following:
    • If you are using route propagation, choose Route PropagationEdit. Select the new virtual private gateway that’s attached to the VPC and choose Save.
    • If you are using static routes, choose RoutesEdit. Modify the route to point to the new virtual private gateway, and choose Save.
  10. Enable the new tunnels on your customer gateway device and disable the old tunnels. To bring the tunnel up, you must initiate the connection from your local network.If applicable, check your route table to ensure that the routes are being propagated. The routes propagate to the route table when the status of the VPN tunnel is UP.

    Note

    If you need to revert to your previous configuration, detach the new virtual private gateway and follow steps 8 and 9 to re-attach the old virtual private gateway and update your routes.

  11. If you no longer need your AWS Classic VPN connection and do not want to continue incurring charges for it, remove the previous tunnel configurations from your customer gateway device, and delete the VPN connection. To do this, go to VPN Connections, select the VPN connection, and choose Delete.

    Important

    After you’ve deleted the AWS Classic VPN connection, you cannot revert or migrate your new AWS VPN connection back to an AWS Classic VPN connection.

VPN Configuration Examples

The following diagrams illustrate single and multiple VPN connections. The VPC has an attached virtual private gateway, and your network includes a customer gateway, which you must configure to enable the VPN connection. You set up the routing so that any traffic from the VPC bound for your network is routed to the virtual private gateway.

When you create multiple VPN connections to a single VPC, you can configure a second customer gateway to create a redundant connection to the same external location. You can also use it to create VPN connections to multiple geographic locations.

Single VPN Connection

<br />
            VPN layout<br />

Multiple VPN connections

<br />
            Multiple VPN layout<br />

VPN Routing Options

When you create a VPN connection, you must do the following:

  • Specify the type of routing that you plan to use (static or dynamic)
  • Update the route table for your subnet

Static and Dynamic Routing

The type of routing that you select can depend on the make and model of your VPN devices. If your VPN device supports Border Gateway Protocol (BGP), specify dynamic routing when you configure your VPN connection. If your device does not support BGP, specify static routing. For a list of static and dynamic routing devices that have been tested with Amazon VPC, see the Amazon Virtual Private Cloud FAQs.

When you use a BGP device, you don’t need to specify static routes to the VPN connection because the device uses BGP to advertise its routes to the virtual private gateway. If you use a device that doesn’t support BGP, you must select static routing and enter the routes (IP prefixes) for your network that should be communicated to the virtual private gateway.

We recommend that you use BGP-capable devices, when available, because the BGP protocol offers robust liveness detection checks that can assist failover to the second VPN tunnel if the first tunnel goes down. Devices that don’t support BGP may also perform health checks to assist failover to the second tunnel when needed.

Route Tables and VPN Route Priority

Route tables determine where network traffic is directed. In your route table, you must add a route for your network and specify the virtual private gateway as the target. This enables traffic destined for your network to route via the virtual private gateway and over one of the VPN tunnels. You can enable route propagation for your route table to automatically propagate your network routes to the table for you.

Only IP prefixes that are known to the virtual private gateway, whether through BGP advertisements or static route entry, can receive traffic from your VPC. The virtual private gateway does not route any other traffic destined outside of received BGP advertisements, static route entries, or its attached VPC CIDR.

When a virtual private gateway receives routing information, it uses path selection to determine how to route traffic to your network. Longest prefix match applies; otherwise, the following rules apply:

  • If any propagated routes from a VPN connection or AWS Direct Connect connection overlap with the local route for your VPC, the local route is most preferred even if the propagated routes are more specific.
  • If any propagated routes from a VPN connection or AWS Direct Connect connection have the same destination CIDR block as other existing static routes (longest prefix match cannot be applied), we prioritize the static routes whose targets are an Internet gateway, a virtual private gateway, a network interface, an instance ID, a VPC peering connection, a NAT gateway, or a VPC endpoint.

If you have overlapping routes within a VPN connection and longest prefix match cannot be applied, then we prioritize the routes as follows in the VPN connection, from most preferred to least preferred:

  • BGP propagated routes from an AWS Direct Connect connection
  • Manually added static routes for a VPN connection
  • BGP propagated routes from a VPN connection

In this example, your route table has a static route to an internet gateway (that you added manually), and a propagated route to a virtual private gateway. Both routes have a destination of 172.31.0.0/24. In this case, all traffic destined for 172.31.0.0/24 is routed to the internet gateway — it is a static route and therefore takes priority over the propagated route.

Destination Target
10.0.0.0/16 Local
172.31.0.0/24 vgw-1a2b3c4d (propagated)
172.31.0.0/24 igw-11aa22bb

Configuring the VPN Tunnels for Your VPN Connection

You use a VPN connection to connect your network to a VPC. Each VPN connection has two tunnels, with each tunnel using a unique virtual private gateway public IP address. It is important to configure both tunnels for redundancy. When one tunnel becomes unavailable (for example, down for maintenance), network traffic is automatically routed to the available tunnel for that specific VPN connection.

The following diagram shows the two tunnels of the VPN connection.

When you create a VPN connection, you download a configuration file specific to your customer gateway device that contains information for configuring the device, including information for configuring each tunnel. You can optionally specify some of the tunnel options yourself when you create the VPN connection. Otherwise, AWS provides default values.

The following table describes the tunnel options that you can configure.

Item Description AWS-provided default value
Inside tunnel CIDR The range of inside IP addresses for the VPN tunnel. You can specify a size /30 CIDR block from the 169.254.0.0/16range. The CIDR block must be unique across all VPN connections that use the same virtual private gateway.The following CIDR blocks are reserved and cannot be used:

  • 169.254.0.0/30
  • 169.254.1.0/30
  • 169.254.2.0/30
  • 169.254.3.0/30
  • 169.254.4.0/30
  • 169.254.5.0/30
  • 169.254.169.252/30
A size /30 CIDR block from the 169.254.0.0/16range.
Pre-shared key (PSK) The pre-shared key (PSK) to establish the initial IKE Security Association between the virtual private gateway and customer gateway.The PSK must be between 8 and 64 characters in length and cannot start with zero (0). Allowed characters are alphanumeric characters, periods (.), and underscores (_). A 32-character alphanumeric string.

You cannot modify tunnel options after you create the VPN connection. To change the inside tunnel IP addresses or the PSKs for an existing connection, you must delete the VPN connection and create a new one. You cannot configure tunnel options for an AWS Classic VPN connection.

Using Redundant VPN Connections to Provide Failover

As described earlier, a VPN connection has two tunnels to help ensure connectivity in case one of the VPN connections becomes unavailable. To protect against a loss of connectivity in case your customer gateway becomes unavailable, you can set up a second VPN connection to your VPC and virtual private gateway by using a second customer gateway. By using redundant VPN connections and customer gateways, you can perform maintenance on one of your customer gateways while traffic continues to flow over the second customer gateway’s VPN connection. To establish redundant VPN connections and customer gateways on your network, you need to set up a second VPN connection. The customer gateway IP address for the second VPN connection must be publicly accessible.

The following diagram shows the two tunnels of each VPN connection and two customer gateways.

Dynamically routed VPN connections use the Border Gateway Protocol (BGP) to exchange routing information between your customer gateways and the virtual private gateways. Statically routed VPN connections require you to enter static routes for the network on your side of the customer gateway. BGP-advertised and statically entered route information allow gateways on both sides to determine which tunnels are available and reroute traffic if a failure occurs. We recommend that you configure your network to use the routing information provided by BGP (if available) to select an available path. The exact configuration depends on the architecture of your network.

 

Source: http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/SetUpVPNConnections.html

Setting Up an AWS VPN Connection

Use the following procedures to manually set up the VPN connection. Alternatively, you can let the VPC creation wizard take care of many of these steps for you. For more information about using the VPC creation wizard to set up the virtual private gateway, see Scenario 3: VPC with Public and Private Subnets and AWS Managed VPN Access or Scenario 4: VPC with a Private Subnet Only and AWS Managed VPN Access.

To set up a VPN connection, you need to complete the following steps:

These procedures assume that you have a VPC with one or more subnets.

Create a Customer Gateway

A customer gateway provides information to AWS about your customer gateway device or software application. For more information, see Customer Gateway.

To create a customer gateway using the console

  1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.
  2. In the navigation pane, choose Customer Gateways, and then Create Customer Gateway.
  3. Complete the following and then choose Create Customer Gateway:
    • (Optional) For Name, type a name for your customer gateway. Doing so creates a tag with a key of Name and the value that you specify.
    • For Routing, select the routing type.
    • For dynamic routing, for BGP ASN, type the Border Gateway Protocol (BGP) Autonomous System Number (ASN).
    • For IP Address, type the static, internet-routable IP address for your customer gateway device. If your customer gateway is behind a NAT device that’s enabled for NAT-T, use the public IP address of the NAT device.

To create a customer gateway using the command line or API

Create a Virtual Private Gateway

When you create a virtual private gateway, you can optionally specify the private Autonomous System Number (ASN) for the Amazon side of the gateway. The ASN must be different from the BGP ASN specified for the customer gateway.

After you create a virtual private gateway, you must attach it to your VPC.

To create a virtual private gateway and attach it to your VPC

  1. In the navigation pane, choose Virtual Private GatewaysCreate Virtual Private Gateway.
  2. (Optional) Type a name for your virtual private gateway. Doing so creates a tag with a key of Name and the value that you specify.
  3. For ASN, leave the default selection to use the default Amazon ASN. Otherwise, choose Custom ASN and type a value. For a 16-bit ASN, the value must be in the 64512 to 65534 range. For a 32-bit ASN, the value must be in the 4200000000 to 4294967294 range.
  4. Choose Create Virtual Private Gateway.
  5. Select the virtual private gateway that you created, and then choose ActionsAttach to VPC.
  6. Select your VPC from the list and choose Yes, Attach.

To create a virtual private gateway using the command line or API

To attach a virtual private gateway to a VPC using the command line or API

Enable Route Propagation in Your Route Table

To enable instances in your VPC to reach your customer gateway, you must configure your route table to include the routes used by your VPN connection and point them to your virtual private gateway. You can enable route propagation for your route table to automatically propagate those routes to the table for you.

For static routing, the static IP prefixes that you specify for your VPN configuration are propagated to the route table when the status of the VPN connection is UP. Similarly, for dynamic routing, the BGP-advertised routes from your customer gateway are propagated to the route table when the status of the VPN connection is UP.

Note

If your connection is interrupted, any propagated routes in your route table are not automatically removed. You may have to disable route propagation to remove the propagated routes; for example, if you want traffic to fail over to a static route.

To enable route propagation using the console

  1. In the navigation pane, choose Route Tables, and then select the route table that’s associated with the subnet; by default, this is the main route table for the VPC.
  2. On the Route Propagation tab in the details pane, choose Edit, select the virtual private gateway that you created in the previous procedure, and then choose Save.

Note

For static routing, if you do not enable route propagation, you must manually enter the static routes used by your VPN connection. To do this, select your route table, choose RoutesEdit. For Destination, add the static route used by your VPN connection . For Target, select the virtual private gateway ID, and choose Save.

To disable route propagation using the console

  1. In the navigation pane, choose Route Tables, and then select the route table that’s associated with the subnet.
  2. Choose Route PropagationEdit. Clear the Propagate check box for the virtual private gateway, and choose Save.

To enable route propagation using the command line or API

To disable route propagation using the command line or API

Update Your Security Group

To allow access to instances in your VPC from your network, you must update your security group rules to enable inbound SSH, RDP, and ICMP access.

To add rules to your security group to enable inbound SSH, RDP and ICMP access

  1. In the navigation pane, choose Security Groups, and then select the default security group for the VPC.
  2. On the Inbound tab in the details pane, add rules that allow inbound SSH, RDP, and ICMP access from your network, and then choose Save. For more information about adding inbound rules, see Adding, Removing, and Updating Rules.

For more information about working with security groups using the AWS CLI, see Security Groups for Your VPC.

Create a VPN Connection and Configure the Customer Gateway

After you create the VPN connection, download the configuration information and use it to configure the customer gateway device or software application.

To create a VPN connection and configure the customer gateway

  1. In the navigation pane, choose VPN ConnectionsCreate VPN Connection.
  2. Complete the following information, and then choose Create VPN Connection:
    • (Optional) For Name tag, type a name for your VPN connection. Doing so creates a tag with a key of Name and the value that you specify.
    • Select the virtual private gateway that you created earlier.
    • Select the customer gateway that you created earlier.
    • Select one of the routing options based on whether your VPN router supports Border Gateway Protocol (BGP):
      • If your VPN router supports BGP, choose Dynamic (requires BGP).
      • If your VPN router does not support BGP, choose Static. For Static IP Prefixes, specify each IP prefix for the private network of your VPN connection.
    • Under Tunnel Options, you can optionally specify the following information for each tunnel:
      • A size /30 CIDR block from the 169.254.0.0/16 range for the inside tunnel IP addresses.
      • The IKE pre-shared key (PSK).

      For more information about these options, see Configuring the VPN Tunnels for Your VPN Connection.

    It may take a few minutes to create the VPN connection. When it’s ready, select the connection and choose Download Configuration.

  3. In the Download Configuration dialog box, select the vendor, platform, and software that corresponds to your customer gateway device or software, and then choose Yes, Download.
  4. Give the configuration file to your network administrator, along with this guide:Amazon VPC Network Administrator Guide. After the network administrator configures the customer gateway, the VPN connection is operational.

To create a VPN connection using the command line or API

Editing Static Routes for a VPN Connection

For static routing, you can add, modify, or remove the static routes for your VPN configuration.

To add, modify, or remove a static route

  1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.
  2. In the navigation pane, choose VPN Connections.
  3. Choose Static RoutesEdit.
  4. Modify your existing static IP prefixes, or choose Remove to delete them. Choose Add Another Rule to add a new IP prefix to your configuration. When you are done, choose Save.

Note

If you have not enabled route propagation for your route table, you must manually update the routes in your route table to reflect the updated static IP prefixes in your VPN connection. For more information, see Enable Route Propagation in Your Route Table.

To add a static route using the command line or API

To delete a static route using the command line or API

Replacing Compromised Credentials

If you believe that the tunnel credentials for your VPN connection have been compromised, you can change the IKE pre-shared key. To do so, delete the VPN connection, create a new one using the same virtual private gateway, and configure the new keys on your customer gateway. You can specify your own pre-shared keys when you create the VPN connection. You also need to confirm that the tunnel’s inside and outside addresses match, because these might change when you recreate the VPN connection. While you perform the procedure, communication with your instances in the VPC stops, but the instances continue to run uninterrupted. After the network administrator implements the new configuration information, your VPN connection uses the new credentials, and the network connection to your instances in the VPC resumes.

Important

This procedure requires assistance from your network administrator group.

To change the IKE pre-shared key

  1. Delete the VPN connection. For more information, see Deleting a VPN Connection. You don’t need to delete the VPC or the virtual private gateway.
  2. Create a new VPN connection and specify your own pre-shared keys for the tunnels or let AWS generate new pre-shared keys for you. For more information, see Create a VPN Connection and Configure the Customer Gateway.
  3. Download the new configuration file.

 

Source: http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Scenario4.html

Scenario 4: VPC with a Private Subnet Only and AWS Managed VPN Access

The configuration for this scenario includes a virtual private cloud (VPC) with a single private subnet, and a virtual private gateway to enable communication with your own network over an IPsec VPN tunnel. There is no Internet gateway to enable communication over the Internet. We recommend this scenario if you want to extend your network into the cloud using Amazon’s infrastructure without exposing your network to the Internet.

This topic assumes that you’ll use the VPC wizard in the Amazon VPC console to create the VPC and the VPN connection.

This scenario can also be optionally configured for IPv6—you can use the VPC wizard to create a VPC and subnet with associated IPv6 CIDR blocks. Instances launched into the subnet can receive IPv6 addresses. Currently, we do not support IPv6 communication over a VPN connection; however, instances in the VPC can communicate with each other via IPv6. For more information about IPv4 and IPv6 addressing, see IP Addressing in Your VPC.

Overview

The following diagram shows the key components of the configuration for this scenario.

<br />
					Diagram for scenario 4: VPC with only a virtual private gateway<br />

Important

For this scenario, the Amazon VPC Network Administrator Guide describes what your network administrator needs to do to configure the Amazon VPC customer gateway on your side of the VPN connection.

The configuration for this scenario includes the following:

  • A virtual private cloud (VPC) with a size /16 CIDR (example: 10.0.0.0/16). This provides 65,536 private IP addresses.
  • A VPN-only subnet with a size /24 CIDR (example: 10.0.0.0/24). This provides 256 private IP addresses.
  • A VPN connection between your VPC and your network. The VPN connection consists of a virtual private gateway located on the Amazon side of the VPN connection and a customer gateway located on your side of the VPN connection.
  • Instances with private IP addresses in the subnet range (examples: 10.0.0.5, 10.0.0.6, and 10.0.0.7), which enables the instances to communicate with each other and other instances in the VPC.
  • A custom route table associated with the subnet. The route table contains a route that enables instances in the subnet to communicate with other instances in the VPC, and a route that enables instances in the subnet to communicate directly with your network.

For more information about subnets, see VPCs and Subnets and IP Addressing in Your VPC. For more information about your VPN connection, see AWS Managed VPN Connections. For more information about configuring a customer gateway, see the Amazon VPC Network Administrator Guide.

Overview for IPv6

You can optionally enable IPv6 for this scenario. In addition to the components listed above, the configuration includes the following:

  • A size /56 IPv6 CIDR block associated with the VPC (example: 2001:db8:1234:1a00::/56). AWS automatically assigns the CIDR; you cannot choose the range yourself.
  • A size /64 IPv6 CIDR block associated with the VPN-only subnet (example: 2001:db8:1234:1a00::/64). You can choose the range for your subnet from the range allocated to the VPC. You cannot choose the size of the IPv6 CIDR.
  • IPv6 addresses assigned to the instances from the subnet range (example: 2001:db8:1234:1a00::1a).
  • A route table entry in the custom route table that enable instances in the private subnet to use IPv6 to communicate with each other.
<br />
						IPv6-enabled VPC with a VPN-only subnet<br />

Routing

Your VPC has an implied router (shown in the configuration diagram for this scenario). In this scenario, the VPC wizard creates a route table that routes all traffic destined for an address outside the VPC to the VPN connection, and associates the route table with the subnet.

The following describes the route table for this scenario. The first entry is the default entry for local routing in the VPC; this entry enables the instances in this VPC to communicate with each other. The second entry routes all other subnet traffic to the virtual private gateway (for example, vgw-1a2b3c4d).

Destination Target
10.0.0.0/16 local
0.0.0.0/0 vgw-id

The VPN connection is configured either as a statically-routed VPN connection or as a dynamically routed VPN connection (using BGP). If you select static routing, you’ll be prompted to manually enter the IP prefix for your network when you create the VPN connection. If you select dynamic routing, the IP prefix is advertised automatically to your VPC through BGP.

The instances in your VPC can’t reach the Internet directly; any Internet-bound traffic must first traverse the virtual private gateway to your network, where the traffic is then subject to your firewall and corporate security policies. If the instances send any AWS-bound traffic (for example, requests to Amazon S3 or Amazon EC2), the requests must go over the virtual private gateway to your network and then to the Internet before reaching AWS. Currently, we do not support IPv6 for VPN connections.

Routing for IPv6

If you associate an IPv6 CIDR block with your VPC and subnets, your route table includes separate routes for IPv6 traffic. The following describes the custom route table for this scenario. The second entry is the default route that’s automatically added for local routing in the VPC over IPv6.

Destination Target
10.0.0.0/16 local
2001:db8:1234:1a00::/56 local
0.0.0.0/0 vgw-id

Security

AWS provides two features that you can use to increase security in your VPC: security groups and network ACLs. Security groups control inbound and outbound traffic for your instances, and network ACLs control inbound and outbound traffic for your subnets. In most cases, security groups can meet your needs; however, you can also use network ACLs if you want an additional layer of security for your VPC. For more information, see Security.

For scenario 4, you’ll use the default security group for your VPC but not a network ACL. If you’d like to use a network ACL, see Recommended Rules for Scenario 4.

Your VPC comes with a default security group whose initial settings deny all inbound traffic, allow all outbound traffic, and allow all traffic between the instances assigned to the security group. For this scenario, we recommend that you add inbound rules to the default security group to allow SSH traffic (Linux) and Remote Desktop traffic (Windows) from your network.

Important

The default security group automatically allows assigned instances to communicate with each other, so you don’t have to add a rule to allow this. If you use a different security group, you must add a rule to allow this.

The following table describes the inbound rules that you should add to the default security group for your VPC.

Default Security Group: Recommended Rules

Inbound
Source Protocol Port Range Comments
Private IPv4 address range of your network TCP 22 (Linux instances) Allow inbound SSH traffic from your network.
Private IPv4 address range of your network TCP 3389 (Windows instances) Allow inbound RDP traffic from your network.

Security for IPv6

If you associate an IPv6 CIDR block with your VPC and subnets, you must add separate rules to your security group to control inbound and outbound IPv6 traffic for your instances. In this scenario, the database servers cannot be reached over the VPN connection using IPv6; therefore, no additional security group rules are required.

Implementing Scenario 4

To implement scenario 4, get information about your customer gateway, and create the VPC using the VPC wizard, The VPC wizard creates a VPN connection for you with a customer gateway and virtual private gateway.

To prepare your customer gateway

  1. Determine the device you’ll use as your customer gateway. For information about the devices that we’ve tested, see Amazon Virtual Private Cloud FAQs. For more information about the requirements for your customer gateway, see the Amazon VPC Network Administrator Guide.
  2. Obtain the Internet-routable IP address for the customer gateway’s external interface. The address must be static and may be behind a device performing network address translation (NAT).
  3. If you want to create a statically-routed VPN connection, get the list of internal IP ranges (in CIDR notation) that should be advertised across the VPN connection to the virtual private gateway. For more information, see VPN Routing Options.

Use the VPC wizard to create your VPC and a VPN connection.

To create a VPC using the VPC wizard

  1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.
  2. On the dashboard, choose Start VPC Wizard.
  3. Select the fourth option, VPC with a Private Subnet Only and Hardware VPN Access, and then choose Select.
  4. On the first page of the wizard, confirm the details for your VPC and private subnet. Naming your VPC and subnet helps you identify them later in the console.
  5. (Optional, IPv6-only) For IPv6 CIDR block, choose Amazon-provided IPv6 CIDR block. For Private subnet’s IPv6 CIDR, choose Specify a custom IPv6 CIDR. Specify the hexadecimal pair value for the IPv6 subnet or leave the default value (00).
  6. Choose Next.
  7. On the Configure your VPN page, do the following, and then choose Create VPC:
    • In Customer Gateway IP, specify the public IP address of your VPN router.
    • Optionally specify a name for your customer gateway and VPN connection.
    • In Routing Type, select one of the routing options as follows:
      • If your VPN router supports Border Gateway Protocol (BGP), select Dynamic (requires BGP).
      • If your VPN router does not support BGP, choose Static. In IP Prefix, add each IP range for your network in CIDR notation.

      For more information, see VPN Routing Options.

  8. When the wizard is done, choose VPN Connections in the navigation pane. Select the VPN connection that the wizard created, and choose Download Configuration. In the dialog box, select the vendor for the customer gateway, the platform, and the software version, and then choose Yes, Download.
  9. Save the text file containing the VPN configuration and give it to the network administrator along with this guide: Amazon VPC Network Administrator Guide. The VPN won’t work until the network administrator configures the customer gateway.

For this scenario, you need to update the default security group with new inbound rules that allow SSH and Remote Desktop (RDP) access from your network. If you don’t want instances to initiate outbound communication, you can also remove the default outbound rule.

To update the rules for the default security group

  1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.
  2. Choose Security Groups in the navigation pane, and then select the default security group for the VPC. The details pane displays the details for the security group, plus tabs for working with its inbound and outbound rules.
  3. On the Inbound Rules tab, choose Edit and add rules for inbound traffic as follows:
    1. Select SSH from the Type list, and enter your network’s private IP address range in the Source field; for example, 172.0.0.0/8.
    2. Choose Add another rule, then select RDP from the Type list, and enter your network’s private IP address range in the Source field.
    3. Choose Save.
  4. (Optional) On the Outbound Rules tab, choose Edit, locate the default rule that enables all outbound traffic, choose Remove, and then choose Save.

After your network administrator configures your customer gateway, you can launch instances into your VPC. If you’re already familiar with launching instances outside a VPC, then you already know most of what you need to know to launch an instance into a VPC.

To launch an instance

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
  2. Choose Launch Instance on the dashboard.
  3. Follow the directions in the wizard. Choose an AMI, choose an instance type, and then choose Next: Configure Instance Details.

    Note

    If you intend to use your instance for IPv6 communication, you must choose a supported instance type; for example, T2. For more information, see Amazon EC2 Instance Types.

  4. On the Configure Instance Details page, select the VPC that you created earlier from the Network list, and then select the subnet. Choose Next: Add Storage.
  5. On the next two pages of the wizard, you can configure storage for your instance, and add tags. On the Configure Security Group page, select the Select an existing security group option, and select the default security group. Choose Review and Launch.
  6. Review the settings that you’ve chosen. Make any changes that you need, and then choose Launch to choose a keypair and launch your instance.

In scenario 4, you need a DNS server that enables your VPN-only subnet to communicate with servers in your network. You must create a new set of DHCP options that includes your DNS server and then configure the VPC to use that set of options.

Note

Your VPC automatically has a set of DHCP options with domain-name-servers=AmazonProvidedDNS. This is a DNS server that Amazon provides to enable any public subnets in your VPC to communicate with the Internet over an Internet gateway. Scenario 4 doesn’t have any public subnets, so you don’t need this set of DHCP options.

To update the DHCP options

  1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.
  2. In the navigation pane, choose DHCP Options Sets.
  3. Choose Create DHCP Options Set.
  4. In the Create DHCP Options Set dialog box, in the Domain name servers box, enter the address of your DNS server, and then choose Yes, Create. In this example, your DNS server is 192.0.2.1.
  5. In the navigation pane, choose Your VPCs.
  6. Select the VPC, and then choose Edit in the Summary tab.
  7. Select the ID of the new set of options from the DHCP options set list and then choose Save.
  8. (Optional) The VPC now uses this new set of DHCP options and therefore uses your DNS server. If you want, you can delete the original set of options that the VPC used.

You can now use SSH or RDP to connect to your instance in the VPC. For information about how to connect to a Linux instance, see Connect to Your Linux Instance in the Amazon EC2 User Guide for Linux Instances. For information about how to connect to a Windows instance, see Connect to Your Windows Instance in the Amazon EC2 User Guide for Windows Instances.

How to migrate WordPress from CPanel to AWS EC2

Introduction

If you use WHM/CPanel to manage your server or hosting, then you know how difficult is to upgrade or configure a service, and how annoying is that WHM/CPanel annulled any customization that you need. I know this could be a nuisance and how it complicates the server administration, that’s why I propose you a better hosting option for your WordPress, Amazon Web Services (AWS). Here you’ll find the benefits of this cloud and, in general terms, how to migrate WordPress from CPanel to AWS EC2.

Concepts approach

Let’s get concepts approach to specifically know what are we talking about… CPanel is a control panel with the purpose of managing your hosting and server. It takes total control of the server and installs everything that is commonly needed, like MySQL, FTP, Cron Jobs, etc. CPanel has a moderately intuitive design, but since WHM/CPanel has the server control, it is difficult to customize.
Screenshot_1
An AWS EC2 Instance is a virtual server with the following features:
  • High Availability level.
  • High stability level.
  • Scalable in memory space and server size.
  • The hard disk space is independent of the instance’s size , it can be set according to your needs and increase if you desires.
  • It offers “double” security since, in addition to the default firewall, AWS Security Groups are available, these restrict the ports you prefer.

How to migrate WordPress?

To migrate WordPress, from CPanel to AWS, you will require:
  • CPanel account
  • WordPress application
  • AWS account

1. The first step is to get the compressed directory and the database. The compressed directory, where you’re going to find WordPress, must be as a .tar.gz file; and the database would be in .sql format. To obtain the compressed directory of WordPress (document root) and the database, you can go to “Backup” section in CPanel and select the files you want to export.
After you have the database and the compressed document root on your computer, it is time to start with the creation of the EC2 instance and RDS (database server) on AWS.

2. Once you had logged in your AWS account, you must create the EC2 instance:
Services > EC2 > Instances > “Launch Instance”

Screenshot_2
Screenshot_3

After this step, you will be able to configure its size, volume size, network (VPC), etc.

3. You can create and configure RDS to your database in:
Services > RDS > Instances > “Launch DB instance” or “Get started Now”

Screenshot_4
Screenshot_5

4. Now you will be able to configure it, I recommend you to use MySQL like database manager because it is the most commonly used and a WordPress doesn’t need services or specialized features.

5. The next step is to test RDSconnection, create user and database with the wp-config.php file information of the original WordPress and import the database.

6. Afterwards, you’ll transfer the compressed document root to EC2 instance and uncompress it in /var/www/ directory preferably. Next, you need to edit the new wp-config.php file with the correct credentials and DB host (RDS endpoint, you can see it in:
Services > RDS > Instances > Select your RDS > in the displayed information you can see the ENDPOINT

Screenshot_6

7. Thereafter, will be necessary:

7.1 Update the packages.

sudo apt update

7.2 Install Nginx, PHP and PHP-FPM.

sudo apt install nginx php7.0 php7.0-common php7.0-curl php7.0-mysql php7.0-mcrypt php7.0-fpm

7.3 Configure the vhost.

server {
        listen 443;
        server_name dominio.com www.dominio.com;

        root /var/www/dominio.com;
        index index.php index.html;

        access_log /var/log/nginx/dominio-access.log;
        error_log /var/log/nginx/dominio-error.log;

        location / {
                try_files $uri $uri/ /index.php?$args;
                index index.php index.html;
        }

        location ~* .(jpg|jpeg|gif|css|png|js|ico|html)$ {
                access_log off;
                expires max;
        }

        location ~ .php$ {
                fastcgi_split_path_info ^(.+.php)(/.+)$;
                fastcgi_pass unix:/var/run/php7.0-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        }
}

7.4 Add the following line on /etc/hosts file in your computer/laptop (change 123.123.123.123 to public IP of your instance).

123.123.123.123	dominio.com

7.5 Test the site (example).

Screenshot_7

Why is important to migrate CPanel to AWS?

  • AWS is so easy to use for everyone to quickly and securely host applications in the Cloud.
  • It enables you to select the operating system, programming language, web application platform, database, and other services you need.
  • It is cost-effective, you pay only for what you need.
  • Your WordPress would be reliable.
  • AWS utilizes an end-to-end approach to secure and harden the infrastructure.
  • Total control and the ability to configure the EC2 instance.
  • It allows the database optimization.

Conclusion

We’ve decided the best for you and your WordPress is to migrate from CPanel to AWS. As a result, the migrated WordPress could be configured depending on the site’s needs, but the most important thing is that having Nginx as the web server would make your site faster. The EC2 instance gives you total control of the site because it is not shared and doesn’t have any invasive control panel. The next steps are to optimize the EC2 instance in your WordPress, harden the WordPress, improve the page speed of Google and automate backups.

Information Source: https://cloudacademy.com/amazon-web-services/how-to-install-and-run-wordpress-on-aws-course/

Powered By Goldman Design