Home › Forums › BulletProof Security Pro › Unable to Copy and Rename the uploads.htaccess file to /uploads/.htaccess
- This topic has 17 replies, 2 voices, and was last updated 7 years, 3 months ago by AITpro Admin.
-
AuthorPosts
-
webstarParticipant
I’m using WordPress 4.6.1 multisite enabled.
I’m having trouble activating UAEG. I get this message:
Failed to activate UAEG BulletProof Mode uploads folder protection. Unable to Copy and Rename the uploads.htaccess file to /uploads/.htaccess
I’m not sure when it happened. I noticed it wasn’t activated and tried to activate it.
Some of the things I tried for this included resetting the UAEG htaccess file. That said it was successful, but, I got the same error message when trying to activate it right after. I also deactivated all plugins except BPS, did the same thing. Still the same message.
I then changed my /uploads/ (recursive) directory to 777 and tried it again, reset UAEG file, activating., still the same message.
Now, I’m having other issues as well that might be related. I can’t install any themes. I get an error saying;
Unable to create directory uploads/2016/11. Is its parent directory writable by the server?
Some of the things I did for this include changing the permissions to 755, 775, 777 (recursively) while turning off auto restore. Still got the same error.
Any idea what else I can do to fix this?
Thanks.
AITpro AdminKeymasterYep, you are definitely on the right track > this is either a folder/file permissions or an Ownership problem. A lot of hosts will automatically lock down a folder if you use 777 folder permissions. This is a protective measure since 777 permissions will allow anyone to be able to write to a folder. Go to the BPS System Info page and copy and paste your website/server info for these things:
Server Type: Apache
Operating System: Linux
WP Filesystem API Method: direct
Server API: cgi-fcgi CGI Host Server TypeFile|Folder Permissions (CGI or DSO)|Script Owner User ID (UID)|File Owner User ID
Copy and paste the entire table information.AITpro AdminKeymasterI received your email with the info requested above. At this point the problem is not a folder/file permissions or Ownership problem – both are ok/correct. Your particular server uses standard folder permissions: 755. I believe this problem may be a Network|Multisite specific problem with your particular/specific website. What the problem is exactly I am not sure. Try these things first in order – Step #1 and then #2. If doing the steps below does not work then I will need to login to your site to figure out what the problem is.
1. Reinstall WordPress > Dashboard > Updates > Reinstall now button.
2. Re-run the BPS Pro Wizards again.webstarParticipantI re-installed WP and then ran the BPS Pro pre-installation wizard. I got this message in blue.
Your current Root .htaccess file is not locked. In order to ensure that the Setup Wizard completes successfully your files will NOT be locked by BPS Pro F-Lock. Your F-Lock settings will be set to “Checking & Alerts Off”
So, I continued with the setup and everything was green, except the original issue, which was red.
BulletProof Security Pro Uploads Anti-Exploit Guard (UAEG) SetupError: Unable to create or update File /wp-content/uploads/.htaccess
AITpro AdminKeymasterThe email you sent to me below is a great clue and there is definitely something wrong going on with your /uploads/ folder, but the BPS System Info folder permissions or Ownership checks are not revealing exactly what that problem is. Check your /uploads/ folder and see if there is already an .htaccess file in that folder. If you do find an .htaccess file then send it to me so I can take a look at it. If you do not find an htaccess file in your /uploads/.htaccess folder then you will need to contact your host support folks so they check your /uploads/ folder for any problems. There may be some strange folder corruption problem occurring. Also do you have any other plugins installed that do anything with the /uploads/ folder, such as protect it or something else?
One thing I should mention. Let me know if you think it makes a difference.
I installed WP using the DreamHost installer. Enabled multisite right away. Installed my plugins except yours.Then I replaced the uploads folder with files I needed. Not sure if this part is causing an issue. But, I guess what I sent you should have revealed an issue. Then I installed BPS Pro.
In the meantime, I’ll follow the directions you sent me.
Thanks.
AITpro AdminKeymasterOk here is where you are at. Logged in and isolated where the UAEG problem is occurring, but it is not something I can fix from your WordPress Dashboard or you will need to deactivate all of your other plugins to see if another plugin is causing this problem or you will need to contact your host support if this is not caused by another plugin that you have installed.
Troubleshooting solutions other etc.
################################################
UAEG htaccess file
########################I have isolated where the problem is, but it is not a BPS bug and I cannot figure out what is causing this problem. It is not a WordPress problem. It is not a BPS Pro bug/code problem. So it is either being caused by another plugin you have installed or some type of limitation/restriction on your web host at a higher level or their is damage/corruption to the /uploads/ folder. This is something that you will need contact your web host about or you can first try deactivating all of your other plugins and then check the BPS Pro System Info page under: SQL Database Info|WordPress Site Info|Misc Checks > Plugins Folder: wp-content/plugins > you should see a path to your WordPress uploads folder. Currently there is no path displayed to your /uploads/ folder because something is breaking this code below:
What this code does is uses the standard WP function: wp_upload_dir() to get the /uploads/ folder path. This is a standard WP thing. You can pass this information on to your host so they know exactly what to look at.$bps_Uploads_Dir = wp_upload_dir(); $UploadsHtaccess = $bps_Uploads_Dir['basedir'] . '/.htaccess';
########################
Fixed Custom Code redirect code:
########################
This is not valid htaccess redirect code below. What is missing is the full url where you are redirecting to needs to be the entire url. I have replaced your redirect code with valid redirect code. Also you cannot use Regex with the Redirect directive. You must use RedirectMatch if you want to use Regex code such as a question mark: ?Redirect 301 /finding-alternative-short-term-jobs/ /canadian-jobs-consultants-freelancers-contractors/ Redirect 301 ?/blog/why-avoid?-snack-foods/ /category/blog/ Redirect 301 /seo-specialist/ /seo-specialist-consultant/ Redirect 301 /sas-sample-data/ /category/sas-resources/sashelp/ Redirect 301 /about-sas-software/ /sas-consultant/ Redirect 301 /annuity-calculator/ /annuity-calculator-future-value/
RedirectMatch 301 ^/finding-alternative-short-term-jobs/$ https://cedricliem.com/canadian-jobs-consultants-freelancers-contractors/ RedirectMatch 301 ^/blog/why-avoid?-snack-foods/$ https://cedricliem.com/ategory/blog/ RedirectMatch 301 ^/seo-specialist/$ https://cedricliem.com/seo-specialist-consultant/ RedirectMatch 301 ^/sas-sample-data/$ https://cedricliem.com/category/sas-resources/sashelp/ RedirectMatch 301 ^/about-sas-software/$ https://cedricliem.com/sas-consultant/ RedirectMatch 301 ^/annuity-calculator/$ https://cedricliem.com/annuity-calculator-future-value/
#########################
Plugin Firewall AutoPilot Mode
#########################
Plugin Firewall AutoPilot Modes was trying to create a whitelist rule repeatedly, but the whitelist rule was not valid because the file no longer actually exists.
Solution: deleted the Security Log file and created a new blank security log file.[Plugin Firewall AutoPilot Mode New Whitelist Rule(s) Created: November 30, 2016 – 1:55 pm]
Whitelist Rule: /wordpress-seo/js/dist/wp-seo-admin-global-350.min.jsAITpro AdminKeymasterI just thought of another possible cause for this problem. Have you added/created any code in your wp-config.php file that does anything with your /uploads/ folder path? Open and check your wp-config.php file and post any code that you find that has anything to do with your /uploads folder path.
webstarParticipantI don’t recall doing anything like that, but, I’ll take a look.
AITpro AdminKeymasterOh wow I just noticed what must be causing this problem from the folder permissions info you emailed to me. The path to your /uploads/ folder has an additional slash in front of the wp-content folder:
..//wp-content/uploads
Besides some code in your wp-config.php file using an invalid path, I am not sure where that extra slash could be coming from, but yeah that would definitely be causing the problem. Physically check your folders (FTP or web host control panel) and make sure there is not some kind of mistake with folder names. Something like having 2 wp-content folders or some other odd folder naming problem.webstarParticipantThat’s great, thanks!
I was just about to send a message to my host with your note and preparing to delete everything and re-install one by one assuming they can’t help. Although, maybe figuring out where this extra slash is coming from will take just as long.
Anyways, thanks again. I’ll look into this.
AITpro AdminKeymasterThe extra slash is coming from one of these 3 possibilites in this order: 1. Your wp-config.php file. 2. Another plugin you have installed. 3. Your theme. So that means you would check your wp-config.php file first. Next you would deactivate all of your other plugins and check the BPS System Info page to see if the problem still exists. Next switch your Theme and check the BPS System Info page to see if the problem still exists. You may want to deactivate your plugins one by one and check the BPS System Info page. Then deactivate the next plugin and check the BPS System Info page, etc etc etc.
Also like I said before you need to check the physical structure of your folders using FTP. You said you manually uploaded your /uploads/ folder. So want you to check everything to make sure all of your folders look ok.
AITpro AdminKeymasterThis is what you would be checking for on the BPS System Info page. This is what you should see when the Uploads Folder is seen correctly.
Plugins Folder: wp-content/plugins
Uploads Folder: wp-content/uploads
WP Permalink Structure: /%postname%/What I currently saw on your BPS System Info page is this:
Plugins Folder: wp-content/plugins
[there is a blank space here instead of the path to your uploads folder]
WP Permalink Structure: /%postname%/webstarParticipantThanks for all your notes. I can’t say enough about your support!
But, I didn’t read any of this (last 2 posts I mean) before I made my changes! I found this link:
https://premium.wpmudev.org/blog/change-default-wordpress-uploads-folder/
And I basically just added 1 line to my wp-config.php file:
define(‘UPLOADS’, ‘wp-content/uploads’);
And that did it.
Although I could go through all the stuff you mentioned above and isolate the errant plugin and let the author know, (I’m sure it’s not my theme because it’s StudioPress and I’m sure an issue like this would have been discovered already), I’m going to have to leave it for now as this issue has wasted enough of my time already.Thanks again for the support and fixing my redirects. You went over and above what’s expected. Greatly appreciated.
AITpro AdminKeymasterSo are you saying the problem is fixed or not? Can you activate UAEG now?
webstarParticipantYes, it’s fixed and my other issue (unrelated to BPS Pro) regarding uploading a theme to my secondary sites is fixed too.
-
AuthorPosts
- You must be logged in to reply to this topic.