AWS Lightsail w/ wordpress - Need to enable mod_expires - but can't find where

Keywords: WordPress - AWS - How to - Other
Description:
Just tweaking a cache plugin on my website and W3 Plugin support team recommend to enable mod_expires — Where and how I can do that…?

Thank You in Advance!

Hello @Artur,

To enable the mod_expires module you will need to edit the main Apache configuration file at /opt/bitnami/apache2/conf/httpd.conf and uncomment the line below so that it looks like this:

...
LoadModule expires_module modules/mod_expires.so

And restart apache:

$ sudo /opt/bitnami/ctlscript.sh restart apache

You can check the module is enabled running:

$ /opt/bitnami/apache2/bin/apachectl -M | grep expire

I go to

`/opt/bitnami/apache2/conf/httpd.conf`

and do not see a

'LoadModule expires_module modules/mod_expires.so'

I create this line and restarted my instance
Also when try to RUN your command for check

    '$ /opt/bitnami/apache2/bin/apachectl -M | grep expire expires_module (shared)'

I have some message command not found - please see attached image

Hello @Artur,

It is strange you do not have the expires_module line in the config file httpd.conf, could you check if it is present with this command:

$ cat /opt/bitnami/apache2/conf/httpd.conf | grep expires_module

That should output the line you need to uncomment.

Regarding the missing command, please try running the command without the initial $, as this is used to represent in written form that the line is a command to be run on a console. There is no need for the instance to be restarted, running the command to restart apache should suffice for the change to take effect.

Regards,
Francisco de Paz

Thank You for superfast response!
I do not know about the $ — I am sorry this command lines magic is new for me

When I go to my FTP I find 2 nd file and this line have this line for some reason I can fin this on published file but when run Your command now I see both of the comment and uncomment

see attached images

So this mines that this is working correct?

This backup file have this line - for some reason the published do not have
I just added and restarted

Hello @Artur,

Don’t worry about it! Yes, it seems the mod_expires module is now enabled in Apache.

Regards,
Francisco de Paz

Ok Great - thank you!!!