Closed y-chen closed 1 year ago
The htaccess configuration looks good. Please remember that you should have edited an existing "/opt/bitnami/apache/conf/vhosts/htaccess/wordpress-htaccess.conf" file, is that correct?
Regarding the permissions issue, you can try reconfiguring the permissions allowing daemon to write in all folders and files
https://github.com/bitnami/vms/issues/22#issuecomment-1143906974
@jotamartos having the same issues, I was able to add the config for wp-rocket but I still see the warning. I don't think that it is a permission issue:
ls -l
inside /opt/bitnami/conf/vhosts/htaccess
-rw-r--r-- 1 bitnami bitnami 6075 Mar 2 08:47 wordpress-htaccess.conf
-rw-r--r-- 1 root root 5310 Feb 27 12:17 wordpress-htaccess.conf.save
ls -l
inside /opt/bitnami/wordpress
-rw-rw-r-- 1 bitnami daemon 405 Dec 15 12:12 index.php
drwxrwxr-x 2 bitnami daemon 4096 Dec 15 12:21 licenses
-rw-rw-r-- 1 bitnami daemon 19915 Dec 15 12:12 license.txt
-rw-rw-r-- 1 bitnami daemon 7389 Dec 15 12:12 readme.html
drwxrwxr-x 2 bitnami daemon 4096 Dec 15 14:38 tmp
-rw-rw-r-- 1 bitnami daemon 7205 Dec 15 12:12 wp-activate.php
drwxrwxr-x 9 bitnami daemon 4096 Dec 15 12:21 wp-admin
-rw-rw-r-- 1 bitnami daemon 351 Dec 15 12:12 wp-blog-header.php
-rw-rw-r-- 1 bitnami daemon 2338 Dec 15 12:12 wp-comments-post.php
lrwxrwxrwx 1 bitnami daemon 32 Feb 23 16:41 wp-config.php -> /bitnami/wordpress/wp-config.php
-rw-rw-r-- 1 bitnami daemon 3001 Dec 15 12:12 wp-config-sample.php
lrwxrwxrwx 1 bitnami daemon 29 Feb 23 16:41 wp-content -> /bitnami/wordpress/wp-content
-rw-rw-r-- 1 bitnami daemon 5543 Dec 15 12:12 wp-cron.php
drwxrwxr-x 27 bitnami daemon 12288 Dec 15 12:21 wp-includes
-rw-rw-r-- 1 bitnami daemon 2494 Dec 15 12:12 wp-links-opml.php
-rw-rw-r-- 1 bitnami daemon 3985 Dec 15 12:12 wp-load.php
-rw-rw-r-- 1 bitnami daemon 49135 Dec 15 12:12 wp-login.php
-rw-rw-r-- 1 bitnami daemon 8522 Dec 15 12:12 wp-mail.php
-rw-rw-r-- 1 bitnami daemon 24587 Dec 15 12:12 wp-settings.php
-rw-rw-r-- 1 bitnami daemon 34350 Dec 15 12:12 wp-signup.php
-rw-rw-r-- 1 bitnami daemon 4914 Dec 15 12:12 wp-trackback.php
-rw-rw-r-- 1 bitnami daemon 3236 Dec 15 12:12 xmlrpc.php
I do not know where wp-rocket is writing. I understand it's trying to write inside the wp-content folder that is a symlink to /bitnami/wordpress/wp-content. Can you check if that folder is writable by the daemon user/group?
You can also try moving the folder instead of using a symlink as explained here
Thanks for your response, seems like that wp-rocket wants to write wp-config.php
or .htaccess
.
The permissions look fine to me (/bitnami/wordpress/wp-content
folder):
-rw-rw-r-- 1 bitnami daemon 2475 Feb 27 06:52 advanced-cache.php
drwxrwxr-x 2 bitnami daemon 4096 Feb 23 16:43 ai1wm-backups
drwxrwxr-x 3 bitnami daemon 4096 Feb 23 17:30 backups-dup-pro
drwxrwxr-x 7 bitnami daemon 4096 Feb 23 17:30 cache
-rw-rw-r-- 1 bitnami daemon 28 Feb 24 08:24 index.php
drwxrwxr-x 5 bitnami daemon 12288 Feb 24 08:25 languages
drwxrwxr-x 40 bitnami daemon 4096 Mar 2 16:00 plugins
drwxrwxr-x 3 bitnami daemon 4096 Feb 23 17:30 plugins_new
drwxrwxr-x 9 bitnami daemon 4096 Feb 23 17:30 themes
drwxrwxr-x 2 bitnami daemon 4096 Mar 2 16:00 upgrade
drwxrwxr-x 21 bitnami daemon 12288 Mar 2 17:09 uploads
drwxrwxr-x 2 bitnami daemon 4096 Feb 23 17:30 w3tc-config
drwxrwxr-x 2 bitnami daemon 4096 Feb 24 06:11 wp-rocket-config
I even tried to set /bitnami/wordpress
to 777 but still, the warning persists.
Hello,
my suspect is that the plugin isn't checking if the change is applied, but if the file writable.
Another error I had before was this one:
Adding manually the line to wp-config.php
didn't fix the error, but making the file writable did.
Maybe the same is happening for .htaccess
, WP-Rocket is trying to write in a file that doesn't exist in Bitnami's image.
You can try creating the file and set the correct permissions for the plugin to write it.
touch /opt/bitnami/wordpress/wp-content/plugins/wp-rocket/.htaccess
sudo chown bitnami:daemon /opt/bitnami/wordpress/wp-content/plugins/wp-rocket/.htaccess
sudo chmod g+w /opt/bitnami/wordpress/wp-content/plugins/wp-rocket/.htaccess
Note: I used /opt/bitnami/wordpress/wp-content/plugins/wp-rocket/.htaccess as an example path, please use the correct one.
However, I'd also contact the wp-rocket plugin's developers to let them know about this issue. If the folder is writable by the daemon user, the plugin should be able to create the file and add the needed content.
This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.
Where can we see complete block to be added to .htaccess
. I was warned WP Rocket could not write, but I only had option to copy missing code once and do not see it now.
Hi @jasperf,
If you need to update the .htaccess information, you need to take into account that we disable those files by default due to security and performance reasons. You can learn more about that here:
https://docs.bitnami.com/general/apps/wordpress/administration/use-htaccess/
If you need to add new information, you will need to edit the wordpress-htaccess.conf file as explained in the docuementation and add/edit the block of code related to the folder of the .htaccess file and include the content inside. For example, if you need to create a .htaccess file inside the /opt/bitnami/wordpress/wp-content/plugins/wp-rocket folder, you will need to add/edit this block:
<Directory "/opt/bitnami/wordpress/wp-content/plugins/wp-rocket">
NEW CODE TO ADD HERE
</Directory>
Hi @jasperf,
If you need to update the .htaccess information, you need to take into account that we disable those files by default due to security and performance reasons. You can learn more about that here:
https://docs.bitnami.com/general/apps/wordpress/administration/use-htaccess/
If you need to add new information, you will need to edit the wordpress-htaccess.conf file as explained in the docuementation and add/edit the block of code related to the folder of the .htaccess file and include the content inside. For example, if you need to create a .htaccess file inside the /opt/bitnami/wordpress/wp-content/plugins/wp-rocket folder, you will need to add/edit this block:
<Directory "/opt/bitnami/wordpress/wp-content/plugins/wp-rocket"> NEW CODE TO ADD HERE </Directory>
What would be the general way to allow the specific plugin complete access to the .htaccess folder? I have a plugin with a folder named "hide-my-wp" that I need to give complete access to the .htaccess folder.
If you want to enable the usage of the .htaccess files, please set AllowOverride All
in the /opt/bitnami/apache/conf/vhosts/APPNAME-vhost.conf
and /opt/bitnami/apache/conf/vhosts/APPNAME-https-vhost.conf
files. Remember to restart Apache for the changes to take effect.
Note: In this case replace APPNAME with wordpress
Thank you, do I restart with this command?
sudo /etc/init.d/apache2 restart
That doesn't work with Bitnami. The script to restart the services is
sudo /opt/bitnami/ctlscript.sh restart apache
Yes, I figured that out the hard way. I haven't had coffee. I will close my other ticket, too. Thanks again.
Describe your issue as much as you can
I am having this warning after restoring a Wordpress site on an AWS Lightsail instance running Bitnami Wordpress image:
I can't find
.htaccess
anywhere, reading the docs the file name and location has been changed but also how it work.On this point I didn't get how to edit the files to dismiss that warning. What I tried is to change
AllowOverride None
toAllowOverride All
in/opt/bitnami/apache/conf/vhosts/APPNAME-vhost.conf
and in/opt/bitnami/apache/conf/vhosts/htaccess/APPNAME-htaccess.conf
I added anotherDirectory
tag like this:But then the web server doesn't go up anymore and I get a
502 Bad Gateway
error.How can I correctly dismiss that warning message?