Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Fix Apache Errors After Switching to LiteSpeed

This guide helps when Apache gives errors on a server that also runs, or used to run, LiteSpeed.

Dedicated Servers2 min read4 steps

Note: This guide needs root access to the server. It is for VPS and dedicated server owners.

What are Apache and LiteSpeed?

A web server is the program that sends web pages to visitors. Apache and LiteSpeed are two popular ones. LiteSpeed can read Apache's settings, so many servers swap one for the other. But they must not both use the same port at the same time. A port is like a numbered door on the server. Web traffic uses door 80 for normal sites and 443 for secure sites.

Errors often come up when both programs try to use the same door.

Step 1: See which one is running

systemctl status httpd
systemctl status lsws

These show if Apache (httpd) and LiteSpeed (lsws) are running. On Ubuntu, Apache may be called apache2.

Step 2: Check who uses port 80

ss -tlnp | grep ':80'

This lists the program using port 80. Only one program should appear.

Step 3: Read the error log

tail -n 50 /usr/local/apache/logs/error_log

This shows the last 50 lines of the Apache log. Common messages are "Address already in use" and "could not bind to address". Those mean the port is taken.

Step 4: Fix the clash

  1. Decide which server should be in charge. Usually it is LiteSpeed.
  2. Stop the other one.
systemctl stop httpd
  1. Restart LiteSpeed.
systemctl restart lsws
  1. Check your website in a browser.
Tip: On cPanel servers with the LiteSpeed plugin, Apache runs on other ports behind the scenes. Use the LiteSpeed settings in WHM to switch cleanly, rather than stopping services by hand.

Step 5: Check the settings files

A broken line in .htaccess or in the Apache settings can cause errors. Test Apache's settings.

apachectl configtest

This says "Syntax OK" or points to the broken line. Fix that line and try again.

Warning: Back up any settings file before you edit it. A mistake can take all sites offline.

If it still fails, open a support ticket.

Quick recap

  • Apache and LiteSpeed must not share the same ports.
  • Find which program uses port 80 with ss.
  • Stop the one you do not want and restart the other.
  • Use apachectl configtest to find setting mistakes.
  • Back up files before editing.