Support

UNiTE, Remote CLI, eXtract Wizard

#36286 Unite does not replace .htaccess

Posted in ‘UNiTE and Remote CLI’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

PHP version
n/a
Tool
UNiTE
Tool version
n/a

Latest post by thoni56 on Thursday, 09 December 2021 07:00 CST

thoni56

I can't get Unite to replace the .htaccess file with Joomla standard even though I've specified

<replacehtaccess>1</replacehtaccess>

in the siteInfo section. Everything works fine except for this.

Is there any other requirements for this to work? Must a htaccess.txt exist in the root of the original site?

 

nicholas
Akeeba Staff
Manager

First a few words about UNiTE's architecture.

There are two modes of operations. In the legacy mode it would handle the restoration by itself. This only restores the database and does some basic changes to the configuration.php file. This is what was used with Joomla 1.0 to 2.5 inclusive.

Since several years ago we have offered the ANGIE mode which is the recommended one. You enable this with the scripting attribute in the UNITE root tag:

<unite scripting="02_angie">

In this case UNiTE simply extracts the backup archive. Then it calls ANGIE, the restoration script included in the backup archive itself, to perform the actual restoration steps.

Several options, including replacehtaccess, are pass–through, meaning that they are conveyed to ANGIE. If they are supported by the ANGIE version included in the backup archive at backup time they will be taken into account.

The replacehtaccess option downloads a fresh copy of htaccess.txt from Joomla's GitHub repository. It does not care if it exists on your site or not.

So, based on the above, we have to check the following:

  1. Are you using scripting="02_angie" in your XML file?
  2. Did you take a backup archive with a version of Akeeba Backup 8 or 9?
  3. Does your server block file_get_contents where the file is a URL?

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

thoni56

I am currently not using Angie scripting. The backup is from Akeeba 8. My local server, to where I'm restoring, does not block the PHP function file_get_contents(), at least not when running from the command line. Haven't tried it from the webserver yet. Will do that if necesary.

But the remote server does block file accesses for URL:s so I guess that means that I cannot use ANGIE scripting.

nicholas
Akeeba Staff
Manager

I am currently not using Angie scripting.

Therefore the replacehtaccess option has no effect. This is one of the pass–through options. If you are not using ANGIE scripting it does absolutely nothing.

But the remote server does block file accesses for URL:s so I guess that means that I cannot use ANGIE scripting.

Not necessarily, no. First of all, that would only make a difference if you are replacing the .htaccess. Everything else acts locally; nothing is downloaded from an external location.

Second, most servers block PHP file inclusion from a remote URL, not retrieving file content. If your server does block retrieving file content from a remote URL then Joomla itself won't work correctly. Retrieving update information and installing updates requires being able to connect to remote servers and download remote content. Likewise, uploading backups to remote storage requires contacting remote servers.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

thoni56

Ok, I misunderstood your meaning of "pass-through". I interpreted it as if using ANGIE scripting it would be pass through to ANGIE, otherwise it would be handled locally. But you are actually saying that it's not applicable if not using ANGIE, right? 

I started from the joomla.xml example (which does not have any scripting set in the unite root node) so I read only the parts of the documentation that related to the sections. So I missed the only sentence about the scripting, and since it was not mentioned as a prerequisite for e.g. replacehtaccess, I did not know that I needed to.

But thanks for the help. I'll change to ANGIE and it probably will work better.

nicholas
Akeeba Staff
Manager

Correct. What I meant is that these options are always passed through to ANGIE. They do not have an implementation in UNiTE itself.

If something wasn't clear in the documentation please let me know so I can improve it.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

thoni56

In the section about `unite` element it says  "can have the attribute scripting..." while in the bullets it says "must have and be ..." This could perhaps be unified to say "must".

In that section I also miss some information about what "02_angie" means (executing most of the "modifications" on the remote, like you explained above). It also points to the non-existing directory `engine/scripting´ for examples.

In the description of each parameters that is "pass-through" it could be mentioned that they only apply if using ANGIE scripting.

Finally, the joomla.xml example should be updated to use ANGIE scripting. Or better be the same as the example in the documentation. Or even removed since the documentation has a more complete example, to avoid duplication of information.

 

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!