Skip to content
Bdazzil Marketing

Blog Web Design

How to Secure a Website Against Server Attacks

Most website security advice focuses on the application: plugins, passwords and themes. That matters, but a large share of serious incidents start one level down, at the server. Exposed login

7 minute read

Most website security advice focuses on the application: plugins, passwords and themes. That matters, but a large share of serious incidents start one level down, at the server. Exposed login services, outdated operating system packages, open database ports and overly generous file permissions give attackers a route that no security plugin can close. Web server hardening is the discipline of reducing that attack surface so the server offers as little as possible to anyone probing it.

Automated scanners test servers around the clock, regardless of company size or location, and businesses in Dubai and Abu Dhabi are no exception. When we plan hosting for web design projects, server configuration is part of the brief, and it stays under review through our website maintenance service. This guide covers the measures that make the biggest difference, in plain terms.

Know what you are defending

Start with an inventory. You cannot harden what you have not listed.

  • Servers and environments: production, staging and any old servers still running a previous version of the site.
  • Exposed services: web (ports 80 and 443), SSH, FTP, control panels, database ports, mail services.
  • Software stack: operating system, web server (Nginx, Apache or LiteSpeed), PHP or other runtimes, database engine, control panel.
  • People with access: developers, agencies, hosting support and former staff whose credentials may still work.
  • Data held: customer inquiries, orders, accounts and uploaded documents, which determines the impact of a breach under the UAE Personal Data Protection Law (Federal Decree-Law No. 45 of 2021).

On managed hosting, much of the server layer is the provider’s responsibility. Ask them in writing which of the measures below they handle and which remain yours.

Lock down administrative access

Administrative access is the most valuable target on any server.

  • Use SSH keys instead of passwords, and disable password authentication for SSH entirely.
  • Disable direct root login. Administrators sign in with named accounts and use sudo when they need extra privileges, which also creates an audit trail.
  • Restrict access by IP address where practical, or place administrative services behind a VPN.
  • Protect control panels such as cPanel or Plesk with multi-factor authentication and IP restrictions.
  • Remove FTP. Use SFTP instead, since FTP sends credentials unencrypted.
  • Review accounts quarterly and revoke access for anyone who no longer needs it, including previous agencies and freelancers.

Patch and minimize the software stack

Unpatched software is one of the most common routes into a server. Attackers often begin scanning for a newly published vulnerability within hours of disclosure.

  1. Enable automatic security updates for the operating system where your setup allows, and schedule regular maintenance windows for everything else.
  2. Run supported versions of PHP, the database engine and the web server. Versions past end of life no longer receive security fixes.
  3. Remove what you do not use: unused services, sample files, default pages, old PHP versions and abandoned test sites.
  4. Hide version information in server headers and error pages, so scanners learn less about your stack.
  5. Test updates on staging first for business-critical sites, then apply them promptly to production.

Network controls: firewalls and a WAF

Network controls decide what traffic reaches the server at all.

Host firewall

Configure a firewall to deny all incoming connections by default and allow only what is needed, usually ports 80 and 443 for the website and SSH from approved addresses. Database ports should never be open to the internet. If the database runs on a separate server, allow connections only from the web server.

Web application firewall

A WAF inspects web requests and blocks common attack patterns such as SQL injection, cross-site scripting and malicious bots. It can run at the server level or at a CDN edge. An edge WAF also absorbs much of the traffic from volumetric attacks before it reaches your server, and lets you hide the origin server’s IP address.

Rate limiting and brute force protection

Limit how many requests an address can make to login pages, search endpoints and forms. Tools such as Fail2ban watch logs and block addresses that repeatedly fail to authenticate. This protects WordPress login pages, XML-RPC endpoints and SSH alike.

Isolate the application and protect the data

If an attacker does get a foothold, isolation limits the damage.

  • Run each site under its own system user, so a compromise of one site cannot read another’s files.
  • Set strict file permissions. The web server should not be able to write to application code, only to specific upload and cache folders. Block execution of PHP in upload directories.
  • Protect configuration files containing database credentials and API keys from web access.
  • Give the database user only the privileges it needs, and use separate credentials for each application.
  • Enforce HTTPS with modern TLS settings, and add security headers such as HSTS, X-Content-Type-Options and a Content-Security-Policy.
  • Keep secrets out of code repositories and rotate keys when team members leave.

Web server hardening through monitoring and response

Hardening is not a one-time job. Configurations drift, new vulnerabilities appear and access lists grow. Ongoing web server hardening depends on seeing what is happening.

ControlWhat it tells you
Centralized logsWho logged in, from where, and what requests hit the site
File integrity monitoringUnexpected changes to code or configuration files
Uptime and performance alertsUnusual load, errors or downtime that may signal an attack
Vulnerability scanningOutdated software and misconfigurations before attackers find them
Offsite backupsA clean point to restore from if prevention fails

Keep logs off the server itself, since an attacker with access may delete them. Store backups separately, with at least one copy that the web server cannot modify or delete.

Have an incident plan

Write down, before you need it, who to call, how to take the site offline safely, how to preserve evidence, and how to restore from a known clean backup. If personal data may have been affected, your obligations under the PDPL, or the DIFC or ADGM regimes where they apply, include assessing the breach and notifying the relevant authority and, in some cases, the people affected. Take legal advice on the specifics.

A practical hardening checklist

  • SSH keys only, root login disabled, admin access restricted by IP or VPN.
  • Automatic security updates enabled and supported software versions in use.
  • Firewall denying all but required ports, database ports closed to the internet.
  • WAF and rate limiting in front of login and form endpoints.
  • One system user per site, strict permissions, no PHP execution in uploads.
  • HTTPS with modern TLS and security headers.
  • Offsite logs, file integrity alerts and regular vulnerability scans.
  • Immutable offsite backups with tested restores.
  • Quarterly review of access, software and firewall rules.

Frequently asked questions

Is server hardening my responsibility or my host’s?

It depends on the hosting type. On shared and fully managed hosting, the provider handles most of the operating system, firewall and patching. On a VPS, dedicated server or unmanaged cloud instance, most of the responsibility is yours or your developer’s. Ask your host for a written list of what they manage, then cover the remaining gaps.

Does a security plugin protect my server?

A security plugin protects the application it runs in, such as WordPress. It cannot close open ports, patch the operating system, fix file permissions set at server level or stop attacks on SSH. Plugins are a useful layer, but they sit on top of server hardening rather than replacing it.

How often should a web server be reviewed?

Apply security patches as soon as practical, with critical fixes within days. Review firewall rules, user accounts and software versions at least quarterly, and after any team change, hosting move or major update. Continuous monitoring and automated vulnerability scans fill the gaps between reviews.

Can a CDN replace server security?

No. A CDN with a WAF blocks many attacks at the edge and can hide your origin IP address, which is valuable. The server still needs hardening, because attackers may find the origin directly, and some threats, such as stolen credentials or vulnerable plugins, pass through the CDN as legitimate traffic.

Protecting the foundation of your website

Server security rarely gets attention until something goes wrong, yet it protects everything built on top of it: your content, your customer data and your reputation. A hardened server with limited access, current software, strict isolation and active monitoring makes your site a far harder target.

If you would like an independent review of your hosting setup or help tightening it, we would be glad to discuss it with you.

Keep reading

Free Growth Audit

Tell us about your project

A few details and we'll reply within one business hour, with a 30-minute call and a written plan to follow.

Sunday to Thursday, 9am to 6pm UAE time. Replies within one business hour.