Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk11 min

WordPress Site Not Accessible on Ubuntu: Causes and Fixes

A practical, layer-by-layer guide to fixing WordPress access problems on Ubuntu, including default Apache pages, 403/404/500 errors, database failures, admin redirect loops and broken permalinks.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A WordPress site on Ubuntu is reachable only when every layer in the request chain works: the hostname resolves to the right machine, a web server accepts the connection and selects the right virtual host, PHP executes, WordPress can reach its database, files have suitable permissions, rewrite rules route WordPress URLs, and the configured site URL matches the address you are using. Diagnose those layers in that order instead of reinstalling WordPress at random.

Understand what “not accessible” means

“I cannot access my WordPress site” describes several different failures. A browser timeout occurs before Apache or Nginx can respond. An Apache default page means a web server answered, but probably selected the wrong virtual host. A 403 is an access-control or filesystem problem; a 404 can be a rewrite problem; a 500 or blank page usually indicates a PHP failure; and “Error establishing a database connection” means WordPress reached PHP but could not complete its database connection.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use this request chain as your map: hostname and port reachability → virtual-host selection → PHP execution → database connection → filesystem access → rewrite and URL rules → HTTPS and supported runtime versions. Fix the first broken link, then test again.

Classify the exact symptom first

Record the complete URL, whether the test is from the Ubuntu machine or another device, the HTTP status, and what the browser displays. Run curl -I locally so a browser extension or cached page does not obscure the result.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
Observed result Likely layer First useful check
Connection refused or timeout Service, address, listener, firewall, or DNS systemctl status apache2 or nginx, ss -ltnp, and hostname resolution
Apache “It works” page or another site Apache virtual-host order or hostname mismatch apachectl -S, enabled sites, ServerName, and DocumentRoot
403 Forbidden Directory rules, ownership, traversal, or missing index Web-server error log, parent-directory permissions, and index configuration
404 only on posts or pages Apache mod_rewrite, .htaccess, or Nginx routing Rewrite configuration, then resave permalinks
500 Internal Server Error or blank page PHP fatal error, incompatible extension, plugin/theme, or runtime mismatch PHP-FPM/PHP and web-server error logs
PHP source downloads in the browser PHP is not installed, enabled, or connected to the web server PHP handler and FPM/Apache module configuration
“Error establishing a database connection” Database service, credentials, grants, hostname, or PHP database extension Database service status, wp-config.php, grants, and PHP modules
Home page works but /wp-admin redirects or loops WordPress URL values, HTTPS/proxy headers, or rewrite rules WordPress Address, Site Address, scheme, and proxy configuration

1. Verify the hostname, listener, and service

First determine whether the request reaches Ubuntu at all. On the Ubuntu host, check the web server and database services:

sudo systemctl status apache2
sudo systemctl status nginx
sudo systemctl status mysql
sudo systemctl status mariadb

Only one web server normally needs to own ports 80 and 443. A stopped service, a failed configuration reload, or two services competing for the same port can prevent access. Confirm listeners with:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo ss -ltnp | grep -E ':80|:443'

From the Ubuntu machine, test the requested hostname and a local address separately:

getent hosts example.test
curl -I http://example.test
curl -I http://127.0.0.1

Replace example.test with the hostname in the browser. If the local address responds but the hostname resolves elsewhere, correct DNS or add a temporary entry to the client’s /etc/hosts file, mapping the hostname to the Ubuntu machine’s LAN address. A public hostname must resolve to the public address and forward ports 80 and 443 to Ubuntu; a private development hostname can point directly to the local address. Do not diagnose WordPress until the hostname reaches the intended server.

If the service is running but remote requests time out, inspect the host firewall and any router or cloud firewall for TCP 80 and 443. A refusal generally means the address is reachable but no process is accepting the connection; a timeout more often indicates filtering, an incorrect address, or a service listening only on another interface.

2. Make Apache select the WordPress site

Canonical’s Ubuntu WordPress procedure uses the upstream WordPress release rather than the older package in the Ubuntu archive, places the files at /srv/www/wordpress, sets DirectoryIndex index.php, grants Apache access to that directory, enables the site and rewrite module, maps the hostname, and reloads Apache. Missing any one of those settings can produce the default page, 403, 404, or a PHP error.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Inspect the virtual-host map and the active configuration:

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
sudo apachectl -S
sudo apache2ctl configtest

The enabled host should contain the hostname the browser requests, the actual WordPress document root, an index rule that includes index.php, and a directory block that permits access. A minimal structure is:

<VirtualHost *:80> ServerName example.test DocumentRoot /srv/www/wordpress DirectoryIndex index.php <Directory /srv/www/wordpress> Require all granted AllowOverride FileInfo Limit </Directory> ErrorLog ${APACHE_LOG_DIR}/wordpress-error.log CustomLog ${APACHE_LOG_DIR}/wordpress-access.log combined </VirtualHost>

Use the real hostname and path; do not copy this as a substitute for your distribution’s complete configuration. Enable the intended site and rewrite module, disable the default site when it is answering first, test syntax, and reload:

sudo a2ensite wordpress.conf
sudo a2dissite 000-default.conf
sudo a2enmod rewrite
sudo apache2ctl configtest
sudo service apache2 reload

If you need the default site for another application, leave it enabled but give the WordPress host an exact ServerName and, where necessary, an appropriate ServerAlias. The first matching default virtual host can answer requests sent to an unrecognised hostname, so always test with the same host name that appears in the request.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a 403, read the Apache error log while making one request:

sudo tail -f /var/log/apache2/error.log

Messages about access being denied, a missing index, or inability to traverse a parent directory identify different fixes. Do not solve a 403 by making the entire filesystem world-writable.

3. Check Nginx routing when Apache is not in use

Nginx uses a server block rather than Apache’s virtual-host files. Verify the active configuration and reload only after a syntax test:

sudo nginx -t
sudo systemctl reload nginx

The selected block must have the requested server_name, the WordPress directory as root, and index index.php. WordPress requests normally need a front-controller rule such as try_files $uri $uri/ /index.php?$args;. PHP files must be passed to PHP-FPM through fastcgi_pass, with the script filename built from the document root and requested URI. A typical PHP location contains include fastcgi_params and fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; the socket or TCP address must match the installed PHP-FPM service.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Check Nginx’s access and error logs while reproducing the failure. If static files work but PHP downloads, the PHP-FPM location is absent or invalid. If the home page works but every post returns 404, the try_files rule is missing or points to the wrong document root.

4. Confirm PHP is actually executing

WordPress currently recommends PHP 8.3 or newer. PHP 7.4 may still run some WordPress installations for compatibility, but it is end-of-life and no longer receives normal security maintenance. A version mismatch can surface as a blank page, 500 response, or fatal error after an update.

Check both the command-line version and the web-server handler:

php -v
php -m | grep -E 'mysqli|pdo_mysql|mysqlnd'

The command-line version is not always the version used by Apache or PHP-FPM. Confirm the enabled Apache PHP module or the PHP-FPM pool configured in Nginx. The MySQL-compatible extension is required; without it, WordPress cannot connect even when the database server is healthy. On Ubuntu, the package is commonly named php-mysql for the active PHP series, but install the package that matches your supported runtime rather than mixing releases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a controlled test, create a temporary file in the document root containing <?php phpinfo();, request it once, and delete it immediately. The page reveals the web runtime, loaded extensions, and configuration path. Leaving a phpinfo page publicly available exposes sensitive environment details. A PHP source download instead of rendered output means the request is bypassing PHP entirely; fix the Apache module or Nginx-to-FPM handler before investigating WordPress.

When a 500 appears after enabling a plugin or theme, inspect the PHP error log and the web-server error log at the exact request time. A PHP fatal error names the file and line that failed. Disable the suspected extension through the WordPress files or database only after preserving a backup, then restore it once the incompatible code is updated.

5. Repair the database connection

WordPress recommends MariaDB 10.11 or newer or MySQL 8.0 or newer. MySQL 5.5.5 may still be accepted by older WordPress versions, but it is end-of-life and unsuitable for a secure new deployment.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Check that the database service is running and accepting local connections:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo systemctl status mysql
sudo systemctl status mariadb
sudo ss -ltnp | grep 3306

Open wp-config.php and compare these four values character for character with the database server:

  • DB_NAME: the database that contains the WordPress tables.
  • DB_USER: the account used by WordPress.
  • DB_PASSWORD: the current password for that account.
  • DB_HOST: usually localhost or a specific database hostname and port.

Test the same account independently, without printing its password in shell history where possible. A privileged administrator can inspect the account and grants in MySQL or MariaDB. The WordPress user needs privileges on the WordPress database, not merely permission to connect to the server. Ubuntu’s installation example creates the database and user, then grants database privileges; reproduce that principle with a unique password and the correct host component.

If the database connects from the command line but WordPress still reports an error, verify that PHP’s mysqli or PDO MySQL extension is loaded by the web runtime, not only by the CLI. Also check whether a local socket is being used for localhost while the server expects TCP on 127.0.0.1, or vice versa. Read the database log for authentication, corruption, or too-many-connections messages before changing credentials.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

6. Correct ownership and permissions without opening the whole site

Apache or Nginx must be able to traverse the parent directories and read WordPress core files. It needs write access only where WordPress must upload media, install updates, or create cache files, normally selected locations under wp-content. WordPress documents incorrect permissions as a cause of failed uploads, updates, and writes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Inspect the path one directory at a time:

namei -l /srv/www/wordpress/index.php
stat -c '%U:%G %a %n' /srv/www/wordpress /srv/www/wordpress/wp-config.php

On a standard Ubuntu Apache installation, the service account is commonly www-data. Set ownership deliberately for the files and directories that the web server must read, and grant write access only to the required content directories. Keep core PHP files owned by an administrative account when your update process supports FTP, SSH, or a deployment user; alternatively, use a carefully scoped group arrangement. The correct choice depends on who performs updates.

wp-config.php contains database credentials. Restrict it to the owner and an appropriate group, such as mode 640 or 600 where your deployment permits, while ensuring the web server can still read it. If tightening this file causes a 500, check the error log and group membership rather than reverting to world-readable permissions. Avoid recursive commands that make every file executable or writable; they create a larger compromise surface and can hide the original fault.

7. Restore pretty permalinks and administrative routes

If the front page loads but posts, pages, or /wp-admin paths return 404, the server is usually not handing unknown paths to WordPress’s front controller. On Apache, enable mod_rewrite and permit the .htaccess directives in the WordPress directory with an appropriate AllowOverride value. Confirm that /srv/www/wordpress/.htaccess is readable by the web server and contains the standard WordPress rewrite rules generated for your installation.

After correcting Apache, sign in to the dashboard and open Settings → Permalinks. Click Save Changes once, even without changing the selected structure. WordPress rewrites the rules and flushes its stored permalink configuration. Do not repeatedly flush permalinks while the server still denies .htaccess; that only masks the underlying configuration error.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

On Nginx, there is no .htaccess processing. Put the equivalent try_files rule in the correct server block, test with nginx -t, reload Nginx, and then save the permalink settings. A rule pointing at a different root can make the home page appear functional while every deep URL fails.

8. Correct WordPress URLs and HTTPS behavior

WordPress stores two related addresses. WordPress Address (URL) identifies where the WordPress core files live; Site Address (URL) is the public address visitors use. They are often identical, but they can differ when WordPress is installed in a subdirectory. An incorrect value can redirect every request to an unreachable hostname, force HTTP when the site is served over HTTPS, or create an endless redirect loop.

Once local HTTP access works, check Settings → General and make both values match the hostname and scheme actually served. If the dashboard is inaccessible, inspect the corresponding home and siteurl values in the WordPress options table using a database backup and a controlled update, or define temporary constants in wp-config.php while repairing the database values. Remove temporary overrides after the permanent values are corrected.

Use HTTPS for production. WordPress lists HTTPS as part of its current recommended baseline. If TLS terminates at a reverse proxy, the proxy must forward the original scheme and the web server must trust that header only from the proxy. Otherwise WordPress may believe every HTTPS request is HTTP and redirect repeatedly. Check certificate validity, port 443, and mixed HTTP/HTTPS hostnames after the basic site is reachable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Validate the repair in a fixed sequence

  1. Run curl -I against the exact hostname and scheme users will use. Confirm the status and the Location header are expected.
  2. Open the home page in a private browser window to avoid cached redirects.
  3. Open /wp-login.php and /wp-admin/; confirm there is no loop, 403, or missing stylesheet.
  4. Open one page, one post, and a nonexistent URL. This distinguishes working rewrites from a site that only serves the front page.
  5. Upload a small image and check that its URL loads. A successful page request with failed uploads usually indicates wp-content permissions.
  6. Watch the relevant access and error logs while repeating one failed request, then stop the log command and remove any temporary diagnostic files.
  7. Record the PHP, database, Apache or Nginx, and WordPress versions so a future change can be correlated with a failure.

Prevent the same outage

  • Keep PHP at a currently supported WordPress-recommended version, and plan upgrades before an older release reaches end of life.
  • Use MariaDB 10.11 or newer or MySQL 8.0 or newer for new deployments; do not treat legacy compatibility as a security recommendation.
  • Back up both the database and wp-content before changing plugins, themes, PHP, or web-server configuration.
  • Keep a copy of the working virtual-host or server-block file and test configuration syntax before every reload.
  • Grant write permission only where WordPress needs it, protect wp-config.php, and review logs after updates.
  • Use a stable hostname, valid HTTPS certificate, and documented proxy or DNS settings so URL changes do not strand the administrator.

The official WordPress requirements describe Apache or Nginx as the recommended, feature-rich servers and identify PHP, a supported MySQL-compatible database, and HTTPS as the core baseline. Ubuntu’s setup guidance adds the practical pieces—hostname mapping, document root, directory access, rewrite support, and an Apache reload. Checking those pieces in order turns an apparently mysterious outage into a testable configuration problem.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.