Laravel¿ª·¢£ºÔõÑùʹÓÃLaravel Vapor½«Ó¦ÓóÌÐò°²Åŵ½AWS£¿
Ëæ×ÅÏÖ´úÓ¦ÓóÌÐòÒ»Ö±ÔöÌíºÍÀ©Õ¹£¬Ôƶ˰²ÅÅÒѾ³ÉΪÐí¶àÆóÒµºÍ¿ª·¢ÕßµÄÊ×Ñ¡¡£ÔÚÕâ¸öÁìÓò£¬aws (amazon web services)³ÉΪÁËÒ»ÏîÈÈÃÅÑ¡Ôñ¡£laravelÊÇÒ»ÖÖÊ¢ÐеÄphp¿ò¼Ü£¬ËüÌṩÁËÒ»ÖÖ¼òÆÓÒ×ÓõÄÒªÁìÀ´¿ª·¢¿ìËÙÇÒ¿É¿¿µÄwebÓ¦ÓóÌÐò¡£±¾ÎĽ«ÌÖÂÛÔõÑùʹÓÃlaravel vapor½«Ó¦ÓóÌÐò°²Åŵ½aws£¬Ê¹ÄúµÄÓ¦ÓóÌÐò¸ü¿ì¡¢¸ü¿É¿¿¡¢¸üÇå¾²¡£
×¢²áAWSÕË»§
ҪʹÓÃAWS£¬Ê×ÏÈÐèҪע²áAWSÕË»§¡£×¢²áÃâ·Ñ£¬ÄúÖ»Ðè×¢²á±ã¿ÉʹÓ㬿ÉÊÇÐèÒªÌṩÄúµÄÐÅÓÿ¨ÐÅÏ¢¡£
×°Öò¢ÉèÖÃAWS CLI
AWS CLI (ÏÂÁîÐнӿÚ)ÊÇÓëAWS´ò½»µÀµÄ×î¼òÆÓ·½·¨¡£Í¨¹ýʹÓÃCLI£¬Äú¿ÉÒÔ´ÓÏÂÁîÐÐÇáËɵØÍê³ÉÐèÒªÖÚ¶àµã»÷µÄʹÃü¡£ÔÚÏÂÁîÐÐÖÐÔËÐÐÒÔÏÂÏÂÁî×°ÖÃAWS CLI:
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install
µÇ¼ºó¸´ÖÆ
×°ÖÃÍê³ÉÖ®ºó£¬ÄúÐèҪͨ¹ýÔËÐÐÒÔÏÂÏÂÁîÀ´ÉèÖÃCLI£º
aws configure
µÇ¼ºó¸´ÖÆ
Õâʱ£¬Äú½«±»ÒªÇóÊäÈëÄúµÄAWS Access Key IDºÍSecret Access Key¡£»¹½«ÒªÇóÄúÑ¡ÔñÒ»¸öĬÈÏÇøÓòºÍĬÈÏÊäÌØÊâʽ¡£ÔÚÊäÈëÕâЩÐÅÏ¢Ö®ºó£¬ÄúµÄCLIÒÑ×¼±¸ºÃÅþÁ¬µ½AWS¡£
½¨ÉèLaravelÓ¦ÓóÌÐò
ÈôÊÇÄúÒѾÓÐÁËLaravelÓ¦ÓóÌÐò£¬Äú¿ÉÒÔÌø¹ýÕâ¸ö°ì·¨¡£²»È»£¬Äú¿ÉÒÔʹÓÃLaravel×Ô´øµÄÏÂÁîÐй¤¾ßÀ´½¨ÉèеÄÓ¦ÓóÌÐò¡£ÔËÐÐÒÔÏÂÏÂÁ
composer create-project --prefer-dist laravel/laravel my-app
µÇ¼ºó¸´ÖÆ
Õ⽫ÔÚÄ¿½ñĿ¼Öн¨ÉèÒ»¸öÃûΪmy-appµÄÐÂLaravelÏîÄ¿£¬²¢ÔÚ×°Öúó´òÓ¡¼¸ÐÐÓÐÓõÄÐÅÏ¢¡£
×°ÖÃVapor CLI
VaporÊÇÒ»¸öÓÉLaravelÌṩµÄЧÀÍÆ÷ÖÎÀí¹¤¾ß¡£Ëü¿ÉÒÔÓÃÀ´ÖÎÀíÄúµÄVaporÇéÐκÍʵÀý¡£ÒªÊ¹ÓÃVapor£¬ÎÒÃÇÐèҪװÖÃVapor CLI¡£¿ÉÒÔͨ¹ýÔÚÏÂÁîÐÐÖÐÔËÐÐÒÔÏÂÏÂÁîÀ´×°ÖÃËü£º
composer global require laravel/vapor-cli
µÇ¼ºó¸´ÖÆ
×°ÖÃÍê³Éºó£¬Äú±ØÐèÈ·±£ÄúµÄCLIÒѸüУ¬ÒÔʹÓÃVapor£º
export PATH="$PATH:$HOME/.composer/vendor/bin"
µÇ¼ºó¸´ÖÆ
½¨ÉèVaporÍýÏëºÍÇéÐÎ
ÔÚ½«Ó¦ÓóÌÐò°²Åŵ½Vapor֮ǰ£¬ÎÒÃÇÐèÒªÔÚVaporÖн¨ÉèÍýÏëºÍÇéÐΡ£ÍýÏëÊÇÒ»×é½ç˵ÄúVaporʵÀýµÄ×ÊÔ´µÄÅÌËãºÍ´æ´¢¹æ¸ñ¡£ÇéÐÎÊÇÄúÓ¦ÓóÌÐòµÄÔËÐÐÇéÐΣ¬ÀýÈ翪·¢¡¢Éú²úµÈ¡£
Òª½¨ÉèÍýÏ룬Çë·¿ªhttps://vapor.laravel.com£¬²¢µ¥»÷¡°½¨ÉèÍýÏ롱¡£ÔÚµ¯³ö´°¿ÚÖУ¬ÊäÈëÄúÍýÏëµÄÃû³ÆºÍÍýÏëËùÐèµÄ¹æ¸ñ¡£Òª½¨ÉèÇéÐΣ¬Çëµ¥»÷¡°½¨ÉèÇéÐΡ±²¢ÊäÈëÇéÐÎÃû³Æ¡£Äú¿ÉÒÔÔÚÍýÏëºÍÇéÐÎÉÏÉèÖÃÐí¶àÑ¡ÏÀýÈçʵÀýÊýÄ¿¡¢¿ÉÓÃÇøÓòµÈ¡£
°²ÅÅÓ¦ÓóÌÐò
ÔÚÄúÉèÖúÃÍýÏëºÍÇéÐÎÖ®ºó£¬Laravel Vapor CLI¼´¿É°²ÅÅÄúµÄÓ¦ÓóÌÐò¡£Òª°²ÅÅÓ¦ÓóÌÐò£¬ÇëÔÚÓ¦ÓóÌÐòĿ¼ÖÐʹÓÃÒÔÏÂÏÂÁ
vapor deploy
µÇ¼ºó¸´ÖÆ
Õ⽫ʹÓÃVaporÉèÖÃÎļþÖеÄÉèÖù¹½¨ÄúµÄÓ¦ÓóÌÐò£¬²¢½«Æä°²Åŵ½VaporÇéÐÎÖС£ÔÚ´ËÀú³ÌÖУ¬Vapor CLI»á¸æËßÄúÕýÔÚ±¬·¢µÄÊÂÇ飬ÀýÈçÕýÔÚ¹¹½¨Ó¦ÓóÌÐò¡¢ÉÏ´«Îļþ¡¢ÊÍ·ÅʵÀýµÈ¡£
°²ÅÅÍê³Éºó£¬ÔÚVapor¿ØÖÆ̨µÄ¡°°²ÅÅ¡±²¿·ÖÖÐÉó²é°²ÅÅÏêÇ飬Äú¿ÉÒÔ¿´µ½°²ÅŵÄ״̬ÒÔ¼°¿ÉÒÔÉó²é°²ÅÅÈÕÖ¾¡£
ÕûÀí
ÈôÊÇÄú²»ÔÙÐèÒªVaporʵÀý£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁɾ³ý£º
vapor destroy <app-name>
µÇ¼ºó¸´ÖÆ
Õâ»á×èÖ¹VaporʵÀý²¢É¾³ýËüÃÇ¡£Õâ²»»áÓ°ÏìÄúÔÚAWSÖеÄʵÀý£¬¿ÉÊÇËü½«É¾³ýÄúʹÓÃVapor×¢²áµÄÄÇЩ¡£
½áÂÛ
ÏÖÔÚÄúÒѾ֪µÀÔõÑùʹÓÃLaravel Vapor½«Ó¦ÓóÌÐò°²Åŵ½AWS£¬Ê¹ÓÃVaporµÄÓÅÊÆÊÇÈÃÄú±È¹Å°åµÄAWSЧÀ͸üÈÝÒ×¹¹½¨¡¢°²ÅźÍά»¤LaravelÓ¦ÓóÌÐò¡£VaporÌṩÁËÐí¶àÓÐÓõĹ¦Ð§£¬ÀýÈç×Ô¶¯Ëõ·Å¡¢±¸·ÝºÍ´æµµµÈ£¬¿ÉʹÄúµÄÓ¦ÓóÌÐòµÄÔËάԽ·¢ÈÝÒס£Ñ§»áʹÓÃËü£¬²¢Ò»Ö±ÑµÁ·£¬½«»á¸øÄú´øÀ´¸ü¶àµÄÊÕÒæ¡£
ÒÔÉϾÍÊÇLaravel¿ª·¢£ºÔõÑùʹÓÃLaravel Vapor½«Ó¦ÓóÌÐò°²Åŵ½AWS£¿µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡