AWS Loadbalancer infront of OLS + Wordpress

#1
Hi,

I am a complete noob with OLS and I've facing some challenges.
OLS is currently hosted on an EC2, also Wordpress has been installed.
I would like to implement AWS Elastic Load Balancer in front of the webserver.

I've checked /usr/local/lsws/conf/httpd_config.conf to see which virtualHosts there are and where the vhRoot is.
path: /home/<placeholder>/wordpress/<placeholder>

In /home/<placeholder>/wordpress/<placeholder>/.htaccess, i've changed rewrite part:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/healthcheck\.php$
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

In /home/<placeholder>/wordpress/<placeholder>, I've created a simple healthcheck.php.
When I do a `curl localhost/healthcheck.php`, I receive a 404 not found.

Does someone have tips or ideas?
 

Cold-Egg

Administrator
#2
If you want to use AWS Elastic Load Balancer, you might also want to find a way to sync / share the cache folder between your servers in order to serve the valid cached file.

If no rewrite, can you visit the healthcheck.php directly?
 
#3
If you want to use AWS Elastic Load Balancer, you might also want to find a way to sync / share the cache folder between your servers in order to serve the valid cached file.

If no rewrite, can you visit the healthcheck.php directly?
Removing `RewriteCond %{REQUEST_URI} !^/healthcheck\.php$` ?
 

Cold-Egg

Administrator
#6
That's odd, whether it matches the rewrite rule or not, it should not cause a 404 issue. Just want to clarify with you again.
"Still receive 404 not found. " means curl returns a 404, or from the browser?
"When I browse to the website <placeholder>.com/healthcheck.php I do receive an OK " Which means, browsing it on your browser works?
 
#7
That's odd, whether it matches the rewrite rule or not, it should not cause a 404 issue. Just want to clarify with you again.
"Still receive 404 not found. " means curl returns a 404, or from the browser?
"When I browse to the website <placeholder>.com/healthcheck.php I do receive an OK " Which means, browsing it on your browser works?
Correct, when I login to the machine and do a ` curl localhost/healthcheck.php `, i receive a 404 not found.
When i use a web browser and i browse to ` <placeholder>.com/healthcheck.php `, I receive an a-OK
 

Cold-Egg

Administrator
#8
Hi,
This is my guess, maybe the localhost or 127.0.0.1 is not included in your OLS listener or virtual host domain. Please try to curl again with the domain name. Let us know if it works.
 
#9
Hi,
This is my guess, maybe the localhost or 127.0.0.1 is not included in your OLS listener or virtual host domain. Please try to curl again with the domain name. Let us know if it works.
On the webserver it self, when i ` curl <placeholder>.com/healthcheck.php ` i receive an a-OK. So that seems to work and your theory is correct.
 
#16
Any idea how it works for ALB + OLS portal? OLS Portal is hosted on 5458.
Using ` telnet <domainname>.com 5848 ` does seems to work. Only on the webbrowser, it's probably not redirecting correctly.
 
Last edited:
Top