EasyEngine / easyengine

Command-line control panel for Nginx Server to manage WordPress sites running on Nginx, PHP, MySQL, and Let's Encrypt
https://easyengine.io
MIT License
2.11k stars 434 forks source link

Only homepage caches, and Let's Encrypt certification conflict with EE 4 RC1 #1272

Closed Endda closed 5 years ago

Endda commented 5 years ago

If you feel the issue is an EasyEngine core specific issue, please attach the output of the following commands.

System Information


So I wanted to test out RC1 last night and did so on a fresh install of Wordpress.

I used the command. . .

to create the site and then just published some test posts. The NGINX Helper plugin was installed and activated, and the WP Redis plugin was installed and activated (which they should be, I presume).

However, only my homepage was being cached.

Opening up a Chrome incognito tab and going to the website ShaylahLeigh.com (was the URL I tested this install on), and then opened up the Chrome console before switching to the network tab.

I saw HIT/BYPASSon the home page (which indicates a cached page), but any other post that I went to (even when switching back and forth between the homepage and any of the four posts) showed BYPASS/BYPASS to indicate that the page wasn't being cached for some reason.


The second issue brought up in the title has to do with the Let's Encrypt certification. With EasyEngine 3, I could create my website using its compatible command listed above, and then go into Settings -> General and change the website URL from just blah.com to www.blah.com.

I have 7 or so websites up on EasyEngine 3 using this method and the Let's Encrypt certification works on the www. version just like it works on the non-www. version (Even though WordPress does a redirect to the www. version.

However, as you can see from going to ShaylayLeigh.com I am getting told the following error. . .

"This server could not prove that it is www.shaylahleigh.com; its security certificate is from shaylahleigh.com. This may be caused by a misconfiguration or an attacker intercepting your connection."

caaol commented 5 years ago

Have you ever tested admin-tools? When I visited http://xx.com/ee-admin, I made an authentication, but I jumped to the front page.

caaol commented 5 years ago

And my other post is showed BYPASS/BYPASS

caaol commented 5 years ago

lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.5 LTS Release: 16.04 Codename: xenial

ee cli info +-------------------+-----------------------------------------------------------------------------------+ | OS | Linux 4.11.8-041108-generic #201706290836 SMP Thu Jun 29 12:38:45 UTC 2017 x86_64 | | Shell | /bin/bash | | PHP binary | /usr/bin/php7.2 | | PHP version | 7.2.11-3+ubuntu16.04.1+deb.sury.org+1 | | php.ini used | /etc/php/7.2/cli/php.ini | | EE root dir | phar://ee.phar | | EE vendor dir | phar://ee.phar/vendor | | EE phar path | /root | | EE packages dir | | | EE global config | /opt/easyengine/config/config.yml | | EE project config | | | EE version | 4.0.0-rc.1 | +-------------------+-----------------------------------------------------------------------------------+ wp --allow-root --info -bash: wp: command not found

caaol commented 5 years ago

The first issue,When you set up permalink, the problem may be solved, and I have solved it.

Endda commented 5 years ago

Have you ever tested admin-tools? When I visited http://xx.com/ee-admin, I made an authentication, but I jumped to the front page.

I'm not sure what the admin tools are.

Going to shaylahleigh.com/ee-admin and ignoring the SSL error, I get the following error. . .

"www.shaylahleigh.com redirected you too many times. Try clearing your cookies. ERR_TOO_MANY_REDIRECTS"

But I can overwrite that setting by making an edit to the wp-config.php file hardcoding the URL without the www part.

So after finding it (EE3 had sites at /var/www/ but now they are in /var/lib/docker/volumes/ (that took a while to find). So I put these lines in wp-config.php to bypass the www/SSL issue I was having

define('WP_HOME','http://shaylahleigh.com'); define('WP_SITEURL','http://shaylahleigh.com');

and now https://ShaylahLeigh.com is accessible. I can go and login like normal but I can't remove the www. part from Settings -> General as it's grayed out from it being hardcoded in wp-config.php.

Endda commented 5 years ago

The first issue,When you set up permalink, the problem may be solved, and I have solved it.

I thought it may have been a permalink issue before, so last night I changed it /%postname%/ but I was still getting BYPASS/BYPASS on individual posts.

and I have no idea what ee-admin is. I get a 404 when trying to go to https://shaylahleigh.com/ee-admin

Endda commented 5 years ago

Should the --ssl=le not work on www prefixes like it did on EE3?

Do I need to do something like

with EE4? because that didn't do anything with EE3 so that's why I didn't try it with EE4

mrrobot47 commented 5 years ago

Do I need to do something like ee site create www.shaylahleigh.com --type=wp --cache --admin-user=user--admin-pass=pass --ssl=le

@Endda Yes, that is correct. Please refer the following issue and the specified comment which was the final decision that has been implemented: https://github.com/EasyEngine/easyengine/issues/1021#issuecomment-393842656

This will soon be released in the documentation. CC: @kirtangajjar

mrrobot47 commented 5 years ago

and I have no idea what ee-admin is. I get a 404 when trying to go to https://shaylahleigh.com/ee-admin

@Endda till the documentation is fully released. Please check ee help admin-tools. You can set it up for a site using ee admin-tools enable <site-name>, then only will you get them on the url: http://example.com/ee-admin/

Endda commented 5 years ago

Do I need to do something like ee site create www.shaylahleigh.com --type=wp --cache --admin-user=user--admin-pass=pass --ssl=le

@Endda Yes, that is correct. Please refer the following issue and the specified comment that was the final decision that has been implemented: #1021 (comment)

This will soon be released in the documentation. CC: @kirtangajjar

Oh okay. thank you for that information. I was always curious why it wasn't like that in EE3, but it worked by letting WordPress do the redirect, so that's cool.

Endda commented 5 years ago

and I have no idea what ee-admin is. I get a 404 when trying to go to https://shaylahleigh.com/ee-admin

@Endda till the documentation is fully released. Please check ee help admin-tools. You can set it up for a site using ee admin-tools enable <site-name>, then only will you get them on the url: http://example.com/ee-admin/

Ah, I will look into that either this weekend or after work on Monday. Thank you

Endda commented 5 years ago

So now that the website back up, is there any idea as to why I'm getting BYPASS/BYPASS instead of cache hits?

Do I need to install something other than NGINX Helper and WP Redis to get those HIT/BYPASS entries in Chrome's console?

Also, would I need to install another caching plugin to get a full suite of a cached website (browser cache, page cache, db cache, img/css/js/etc cache)? Or is EE4's cache option handling all of that for me?

If not would something like WP Rocket, W3 Total Cache or WP Super Cache be the go-to choice here? Again, if not, what would be recommended to compliment WP Redis with EE4 to cache as much as possible?

caaol commented 5 years ago

@mrrobot47 But http://example.com/ee-admin/ can not visit.

mrrobot47 commented 5 years ago

@Endda Can you share the url that you're hitting. You can obfuscate out the domain name. I would just like to know the entire url/query string with it if any.

Do I need to install something

No. nginx-helper and WP Redis are already installed and configured for the site if --cache flag is passed.

mrrobot47 commented 5 years ago

@mrrobot47 But http://example.com/ee-admin/ can not visit.

@caaol can you be more specific. What is the issue that you're facing right now?

Endda commented 5 years ago

@Endda Can you share the url that you're hitting. You can obfuscate out the domain name. I would just like to know the entire url/query string with it if any.

Do I need to install something No. nginx-helper and WP Redis are already installed and configured for the site if --cache flag is passed.

I have included it in this thread. These are the domains I am hitting in Chrome's incognito tab (which worked just fine to show me HIT/BYPASS messages with EE3

Last night I was able to get HIT/BYPASS on the homepage of just https://shaylahleigh.com/ but testing today showed that as BYPASS/BYPASS.

In any case, both last night and today I am getting BYPASS/BYPASS on all of those pages in Chrome's incognito tab using Chrome's network tab in its console

Endda commented 5 years ago

Trying to do some tests with Pingdom and GTMetrix and GTM is giving me the following error

While Google Pagespeed Insights says

So I may need to delete the test site and set it up again with www. and ssl=le for better testing

mrrobot47 commented 5 years ago

So I may need to delete the test site and set it up again with www. and ssl=le for better testing

Yes.

Also, don't trust browsers a lot in matters of cache.

➜  ~ curl -XGET -IL https://shaylahleigh.com/tests/
HTTP/1.1 200 OK
Server: nginx
Date: Sat, 03 Nov 2018 16:53:18 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 56955
Connection: keep-alive
Vary: Accept-Encoding
X-Pingback: https://shaylahleigh.com/xmlrpc.php
Link: <https://shaylahleigh.com/wp-json/>; rel="https://api.w.org/"
Link: <https://shaylahleigh.com/?p=5>; rel=shortlink
X-SRCache-Fetch-Status: HIT
X-SRCache-Store-Status: BYPASS
X-Powered-By: EasyEngine v4.0.0-rc.1
caaol commented 5 years ago

@mrrobot47 I used ee admin-tools enable wxmovie.club install admin tools, When I visited https://wxmovie.club/ee-admin/ , It still stays on my front page,and https://wxmovie.club/ee-admin/phpinfo.php ,File not found.

Endda commented 5 years ago

So I may need to delete the test site and set it up again with www. and ssl=le for better testing Yes.

Also, don't trust browsers a lot.

HTTP/1.1 200 OK
Server: nginx
Date: Sat, 03 Nov 2018 16:53:18 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 56955
Connection: keep-alive
Vary: Accept-Encoding
X-Pingback: https://shaylahleigh.com/xmlrpc.php
Link: <https://shaylahleigh.com/wp-json/>; rel="https://api.w.org/"
Link: <https://shaylahleigh.com/?p=5>; rel=shortlink
X-SRCache-Fetch-Status: HIT
X-SRCache-Store-Status: BYPASS
X-Powered-By: EasyEngine v4.0.0-rc.1

I mean, if that HIT/BYPASS is correct in the browser but the browser is just reporting it incorrectly. Then that's cool. But if that HIT/BYPASS indicator is only showing up in a terminal and the browser isn't caching anything, then that's an issue.

Getting HIT/BYPASS from a terminal doesn't help anything if the Browser is ignoring the cache (which could be why it's showing BYPASS/BYPASS). People don't browse websites with a terminal CURL command.

But I understand it's RC1 beta and all. I will remake the site with www. and let's encrypt later today. Thank you for your help.

mrrobot47 commented 5 years ago

@caaol thanks for reporting that the admin-tools url is not working properly and redirecting in wrong manner to home page. Can you please create an issue for the same here: https://github.com/EasyEngine/admin-tools-command It will be looked into soon and resolved by rc.2 or a newer nightly even sooner.

mrrobot47 commented 5 years ago

@Endda here is the output from my chrome browser for your url.

image

It will work for sure in browser if it is working in terminal. It is just that it takes time and lots of opening and closing in case of browsers at times in testing. But stay assured the cache will work perfectly. Thanks a lot for testing. Keep on testing and reporting the issues you face :)

Endda commented 5 years ago

It will be looked into soon and resolved by rc.2 or a newer nightly even sooner.

Do you know if the "ee cli update" command will update our RC1 builds to the latest nightly, or is will that only work from RC1 to RC2 to RCX to Stable?

mrrobot47 commented 5 years ago

ee cli update --nightly will install the latest nightly.

ee cli update [--stable] [--nightly] [--yes]

  Default behavior is to check the releases API for the newest stable
  version, and prompt if one is available.

  Use `--stable` to install or reinstall the latest stable version.

  Use `--nightly` to install the latest built version of the develop branch.
  While not recommended for production, nightly contains the latest and
  greatest, and should be stable enough for development and staging
  environments.
Endda commented 5 years ago

No. nginx-helper and WP Redis are already installed and configured for the site if --cache flag is passed.

But when I check the website in Google Pagespeed Insights. . .I am told that I need to "leverage browser cache" and lists files like. . .

So there are some things that aren't being cached in this current EE4 --cache method. Is there a preferred way of optimizing these?

kirtangajjar commented 5 years ago

But when I check the website in Google Pagespeed Insights. I am told that I need to "leverage browser cache" and lists files like

Can you create another issue for this?

kirtangajjar commented 5 years ago

@Endda Closing this issue as it has been fixed in v4.0.