web-dev-qa-db-fra.com

Impossible d'accéder / administrateur dans Joomla sur localhost, erreur 403 accès interdit

J'ai reçu un fichier Zip de quelqu'un contenant toutes les données d'un site Joomla. Et il m'a demandé de faire quelques configurations CSS pour changer l'apparence de la page d'accueil. J'ai décompressé le fichier Zip et trouvé un fichier .sql, un dossier de site Joomla et un fichier de sauvegarde .jpa. J'ai collé ce dossier dans le dossier htdocs de xampp et l'ai nommé tp, puis j'ai importé le fichier SQL dans la base de données nouvellement créée et apporté des modifications au fichier de configuration de la base de données.

Maintenant, quand je tape localhost/tp le site fonctionne avec succès, mais lorsque je tape localhost/tp/administrator ça me donne 403 forbidden access error. La note courte est que c'est ma première expérience avec Joomla et je ne sais pas comment résoudre ce problème. Comme la plupart des erreurs 403 sont dues à une erreur dans le fichier .htdocs, c’est pourquoi je donne le code à la fin de cette question.

# @package      Joomla
# @copyright    Copyright (C) 2005 - 2012 Open Source Matters. All rights reserved.
# @license      GNU General Public License version 2 or later; see LICENSE.txt
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations.  It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file.  If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's.  If they work,
# it has been set by your server administrator and you do not need it set here.
## Can be commented out if causes errors, see notes above.
Options +FollowSymLinks
## Mod_rewrite in use.
RewriteEngine On
# Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site block out the operations listed below
# This attempts to block the most common type of exploit attempts to Joomla!
#
# Block out any script trying to base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block out any script that includes a <script> tag in URL.
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL.
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL.
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.
## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
## End - Custom redirects
##
# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root).
##
# RewriteBase /
## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the request is for something within the component folder,
# or for the site root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - Joomla! core SEF Section.
Action php /cgi-php53/php
AddHandler php53 .php
1
M.ibrar

Vous avez également un fichier de sauvegarde .jpa, alors pourquoi prenez-vous tant de maux de tête quand vous configurez Joomla vous-même. Créez le site en utilisant la sauvegarde, suivez le lien suivant => https://www.ostraining.com/blog/joomla/test-site-akeeba-backup/

Vous devez suivre l'étape 4, car les 3 premières étapes montrent comment effectuer une sauvegarde pour obtenir un fichier .jpa.

J'espère que cela t'aides.

1
Pratyush

Quelques questions:

  • Êtes-vous sûr des autorisations sur votre site Web?

  • Que se passe-t-il si vous supprimez le .htaccess fichier de votre dossier principal Joomla (celui que vous avez collé ci-dessus)? Le problème sera-t-il résolu?

  • Aussi, y a-t-il des .htaccess fichier dans votre dossier d’administrateur? S'il y en a un, pouvez-vous l'enlever et voir si cela aide?

  • Que se passe-t-il si vous renommez le dossier plugins en plugins_old - est-ce que ça marchera? Si c'est le cas, votre problème provient d'un plugin de sécurité et vous devez le désactiver à partir de phpMyAdmin (il se trouve dans le #__extensions table).

0
itoctopus

Certaines choses à essayer qui ont parfois fonctionné quand cela m'est arrivé:

  • renommez .htaccess en old.htaccess pour le désactiver temporairement et faites de même s'il en existe un dans le dossier/administrator
  • vérifiez que vos autorisations de fichiers sont OK
  • essayez d’accéder à l’administrateur avec index.php inclus dans le chemin du fichier (par exemple, localhost/tp/administrator/index.php).
0
sigil