A default AbanteCart install exposes several predictable weaknesses the moment it goes live. The admin login sits at a well-known URL, the system/config.php file holds database credentials in plaintext and is often left world-readable, and the storefront responds without a single HTTP security header. None of these are bugs in AbanteCart itself; they are the unavoidable starting state of any fresh deployment that an administrator is expected to tighten. On a shared server where you hold an unprivileged hosting account, the attack surface matters more than usual because a compromised store can lead to credential theft, injected payment skimmers, and spam relaying that threatens the whole account.
The good news is that every hardening step below works entirely within your hosting account. You will use cPanel or DirectAdmin File Manager, .htaccess rules enforced by LiteSpeed, a .user.ini for PHP policy, and the AbanteCart AdminCP itself. No root, no SSH administration, and no server configuration edits are required.
Hide and protect the admin login path
AbanteCart installs its control panel at /index.php?s=admin by default. Because the s=admin entry point is documented and identical across every install, automated scanners hammer it with credential-stuffing attempts within hours of a site appearing in DNS. The first meaningful improvement is changing the secret that unlocks that route. AbanteCart stores a value called the admin unique name (often referred to as the admin secret or SEO admin path) which replaces the predictable s=admin token with a string only you know.
Open system/config.php through File Manager (right-click, Edit). Locate the line defining the admin directory token, which looks similar to this:
define('ADMIN_PATH', 'admin_s3cr3t_9f2a');Change the value to a long, random string of letters and numbers. After saving, your admin becomes reachable only at /index.php?s=admin_s3cr3t_9f2a, and requests to the old s=admin path return a generic storefront response instead of a login form. This single change removes your store from the majority of automated login dictionaries.
Layer a second barrier on top using HTTP Basic Authentication so that bots never reach the PHP login at all. In cPanel, open Directory Privacy, select your admin directory, enable protection, and create a user. In DirectAdmin, the equivalent lives under Password Protected Directories. This generates an .htpasswd file and an .htaccess entry. If you prefer to write it manually, place this in a .htaccess file inside public_html/admin/:
AuthType Basic
AuthName "Restricted Admin"
AuthUserFile "/home/youruser/.htpasswds/admin/passwd"
Require valid-userGenerate the hashed password file through the panel rather than by hand so the hash format matches what LiteSpeed expects. With Basic Auth in place, an attacker must clear a server-level prompt before a single PHP line runs, which stops brute-force load from ever touching your database.
Inside the AdminCP, open System → Settings → System and confirm that session and cookie options are set to secure values. Enable the setting that restricts the admin session to the originating IP range where your workflow allows a stable address, and reduce the session timeout so abandoned logins expire quickly.
Correct file and directory permissions
Overly permissive files are the most common finding in a post-compromise audit. A fresh AbanteCart upload frequently leaves directories at 777 and config files at 666 because an installer could not reliably write otherwise. Those values let any process on a shared host read or overwrite your code. On CloudLinux the per-account isolation reduces cross-tenant risk, but a single vulnerable plugin on your own account can still rewrite a 777 file.
Use File Manager to set sane values. Directories should be 0755 and PHP files 0644. The two configuration files deserve the strictest treatment possible while remaining readable by PHP:
system/config.php 0444
system/config.php (if updates needed) 0644Set config.php to 0444 (read-only) once your store is configured. AbanteCart only writes to it during installation, so a read-only state blocks tampering without breaking the storefront. The writable directories AbanteCart genuinely needs are system/ (cache, logs), image/, download/, and admin/system/; keep those at 0755 with files at 0644. To fix permissions in bulk, select a folder in File Manager, choose Change Permissions, tick Recurse into subdirectories, and apply files and folders separately so you do not accidentally make directories 644 or files 755.
Block direct execution and browsing of sensitive directories. Create a .htaccess file inside public_html/system/ containing:
Require all denied
Options -IndexesThis prevents anyone from fetching cached PHP, logs, or the config directly over HTTP. Add the same Options -Indexes line to your document root to stop directory listings exposing your folder structure.
Add HTTP security headers and PHP policy
AbanteCart does not emit browser security headers on its own, so you add them at the web server layer. Edit the main .htaccess in public_html/ and append a header block. LiteSpeed honours these exactly as Apache would:
<IfModule mod_headers.c>
Header always set X-Content-Type-Options "nosniff"
Header always set X-Frame-Options "SAMEORIGIN"
Header always set Referrer-Policy "strict-origin-when-cross-origin"
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
Header always set Permissions-Policy "geolocation=(), camera=(), microphone=()"
</IfModule>Only add the Strict-Transport-Security line once a valid certificate is active for the domain, which you can confirm or install through cPanel → SSL/TLS Status or DirectAdmin → SSL Certificates. A Content-Security-Policy is powerful but needs tuning against the themes and payment scripts your store loads; start in report-only mode and tighten gradually rather than breaking checkout.
Force HTTPS for every request so login cookies never travel in cleartext. Place this above AbanteCart's SEO rewrite block in the document-root .htaccess:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]Finally, lock down PHP behaviour with a .user.ini in your document root. This file is read by the PHP handler selected in cPanel MultiPHP Manager or the DirectAdmin PHP Selector and lets you disable risky functions without touching a global config:
expose_php = Off
allow_url_include = Off
session.cookie_httponly = On
session.cookie_secure = On
disable_functions = exec,passthru,shell_exec,system,proc_open,popenDisabling those shell functions neutralises the payload most web shells rely on. Confirm the selected PHP version is a currently supported branch in the PHP Selector, because running an end-of-life interpreter undoes every other control here. After applying changes, watch public_html/error_log and the AbanteCart log under system/logs/ for a day to catch any legitimate feature that a disabled function or header unexpectedly blocks, and relax only the specific rule responsible.
Worked through together, a renamed admin path behind Basic Auth, read-only configuration files, denied system directories, enforced HTTPS, and a strict header and PHP policy remove the weaknesses attackers probe for first, all without a single privileged command.