分类 默认分类 下的文章

OS: Ubuntu 22, Apache2 has beeen installed

enabled rewrite

sudo a2enmod rewrite

add .htaccess to replace index.php

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.*)$ index.php/$1 [L]
RewriteRule ^(.*)$ index.php [E=PATH_INFO:$1,QSA,PT,L]
</IfModule>

# Disable directory browsing
Options -Indexes

git tags

  1. Delete the tag on any remote before you push

    git push origin :refs/tags/<tagname>
  2. Replace the tag to reference the most recent commit

    git tag -fa <tagname>
  3. Push the tag to the remote origin

    git push origin master --tags
  4. create a new tag

    git tag -a <tagname>

What can do

Good at all simple business, not dependent on the server, can be used with API-Gateway.
Only need sample functions.

What to do

first of all, we need a AWS account.
launch AWS Console

Create a Function

goto Lambda->Dashbord click the button Create function
enter a name for this function
create a new role for this function.
select Runtime as Nodejs 8.10 (this only nodejs code)
see: Lamda Functions
see: Using an IAM Role

hander is important

The module-name.export value in your function. For example, "index.handler" would call exports.handler in index.js.