Open djraval opened 6 years ago
Hi djraval,
The first argument is the domain you intend to run Pressless on. This will end up being a CNAME record to the AWS API Gateway which executes the Lambda function containing your Wordpress site.
The second argument is the domain that you want to be considered public. You will end up CNAMEing that to S3.
The ACM certificate parameter is the name of the ACM certificate. I see you passed the ARN, but you need to specify the name you gave the certificate when creating/importing it in ACM.
So lets say your existing Wordpress site is hosted on www.myblog.com. This is the setup command you would want to run:
pressless setup pressless.myblog.com www.myblog.com -c myblog.com-certname
. You also need to pass in option -d mysq://username:password@host:port/database
to the previous setup
command in order to tell Wordpress where your database is.
pressless.myblog.com
could really be any subdomain or other domain you own. After setup, deploy and updating your DNS records, you would be able to visit https://pressless.myblog.com/wp-admin/
to install/login. After that, you can then visit http://www.myblog.com
, which is an S3 website bucket. If the initial index.html
doesn't yet exist, you'll be redirected to https://pressless.myblog.com
(APIG/Lambda), which will get the Wordpress output and store it in S3, and then redirect you to back http://www.myblog.com
, which now has the index.html
file in S3.
I also assumed that the certificate ARN was required, however, I still cannot get it to work by using the 'Name' of the certificate for several reasons/steps.
Name
tag specified, tried using ARN.Name
: pressless
: error: Pressless: pressless is not a valid certificate name.
Name
: example.com-pressless
: error:
(node:26373) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Error: Could not find the certificate example.com-pressless.
Pressless: Error: Error: 'wp.example.com' was not created in API Gateway.
Error: Error: Could not find the certificate example.com-pressless.
at createDomainName.catch (/usr/lib/node_modules/pressless/node_modules/serverless-domain-manager/index.js:59:15)
at process._tickDomainCallback (internal/process/next_tick.js:135:7)
My current hunch is that the issue is that I've created the certificate in ap-southeast-2
and it needs to be in us-east-1
. Yep: the certificate must be in us-east-1
.
Note: Edge-optimized endpoints require that the certificate be located in us-east-1 to be used with the CloudFront distribution. -- https://www.npmjs.com/package/serverless-domain-manager
How to get started with pressless i cannot figure out anything I have setup IAM installed aws cli but when i run npm install -g pressless nothing works what should i do and how should i start please help me.
Yeah, I have to say the readme is rubbish lol - I am however very interested in this so I'll install/check it out and do a PR for it.
Sorry for the delay, have yet installed WordPress through pressless
Create a free public certificate in the region us-east-1 using the AWS service ACM.
YES THE REGION MUST BE "us-east-1" This is due to limitations within API Gateway.
After doing this if you try to run "pressless setup ..." you may get the error:
Pressless: Checking size of "wp-content/uploads"...
Pressless: Size of "wp-content/uploads" is 0.012288 MB
Pressless: Setting up...
/usr/local/lib/node_modules/pressless/bin/pressless:130
PRESSLESS_DB_SSL=${dsn.get('driver').indexOf('+ssl')?'true':'false'}
^
TypeError: Cannot read property 'get' of undefined
at Command.<anonymous> (/usr/local/lib/node_modules/pressless/bin/pressless:130:24)
at Command.listener (/usr/local/lib/node_modules/pressless/node_modules/commander/index.js:315:8)
at Command.emit (events.js:182:13)
at Command.EventEmitter.emit (domain.js:442:20)
at Command.parseArgs (/usr/local/lib/node_modules/pressless/node_modules/commander/index.js:654:12)
at Command.parse (/usr/local/lib/node_modules/pressless/node_modules/commander/index.js:474:21)
at /usr/local/lib/node_modules/pressless/bin/pressless:910:13
at /usr/local/lib/node_modules/pressless/node_modules/asciify/index.js:50:3
at /usr/local/lib/node_modules/pressless/node_modules/asciify/lib/figlet-js/figlet.js:92:4
at Object._parseFont (/usr/local/lib/node_modules/pressless/node_modules/asciify/lib/figlet-js/figlet.js:44:3)
This is because specifying your DB is actually required even if you also specified it within wp-config.php. The fact that this is required was not immediately obvious. After this I received the following error:
Also note that when the "-c" option calls for the "name" of your certificate, it is referring to the name as listed in AWS ACM. So the name might be "*.yourdomain.com".
Here is an example of a working command:
pressless setup tester.minus-reality.com wordpress.minus-reality.com -c *.minus-reality.com -d mysql://sqluser:sqlpass@dbhostname:3306/dbname
I have been trying to setup Pressless on a standard wordpress installation, but couldn't run "setup" command.
Instructions say I need 3 arguments:
here is the command I tried to run:
pressless setup djraval.tk s3-ap-southeast-1.amazonaws.com/djraval-static/ -c arn:aws:acm:ap-southeast-1:201826946936:certificate/148e2860-a96e-41ea-bf8f-86064a536f3b
Do guide me over this.