Linux, Web Server & Database
Install Apache on VPS
Get Apache properly installed and configured on your VPS as your web server.
The Problem
You need Apache specifically (often because your application or hosting instructions assume it), but a default install doesn't have a virtual host for your domain, the right modules enabled, or sensible permissions set up.
About this problem
Apache remains the default choice for many PHP applications and scripts because of its widely-supported .htaccess override system, which lets individual directories control their own rewrite rules and access settings without touching the main server config.
It's commonly needed when migrating an application built with Apache-specific assumptions, or when following hosting instructions that assume cPanel-style Apache behaviour.
What's Included
- Installing Apache and the modules your application actually needs (mod_rewrite, mod_ssl, etc.)
- Setting up a virtual host for your domain with AllowOverride configured correctly
- Setting sane file and directory permissions for web content
- Opening the firewall and confirming the site loads
What's NOT Included
- Installing PHP or a database behind it (separate services)
- SSL certificate setup (see the Let's Encrypt service)
- Fixing .htaccess rules specific to a particular application beyond the initial setup
How It Works
- Install Apache via the distro's package manager and enable required modules (rewrite, headers, ssl as needed).
- Create a virtual host file for your domain with AllowOverride All so .htaccess rules work where expected.
- Set ownership and permissions on the web root matching the Apache process user.
- Open the firewall for ports 80 and 443 and enable the site with a2ensite (Debian/Ubuntu) or equivalent.
- Test the configuration (apachectl configtest) and reload, confirming the domain serves correctly.
In practice: you buy the service, send over whatever access or details the job needs, I investigate and do the work, and you confirm it's resolved before we call it done.
Frequently Asked Questions
- Why do I need mod_rewrite for my website?
- mod_rewrite powers clean/pretty URLs used by WordPress, Laravel and most modern PHP frameworks — without it enabled, those URLs return 404 errors even though the files exist.
- What does AllowOverride All actually do?
- It tells Apache to respect .htaccess files in that directory, which is how most PHP applications configure their own rewrite rules and access restrictions without editing the main server config.
- Why is my .htaccess file being ignored?
- Almost always because AllowOverride is set to None for that directory in the virtual host — the .htaccess file itself is fine, Apache just isn't reading it.
- Can I run Apache and PHP together on a VPS?
- Yes, with either mod_php (Apache loads PHP directly) or PHP-FPM behind a proxy — mod_php is simpler to set up, PHP-FPM is generally more efficient for busier sites.
- How do I know if Apache installed correctly?
- systemctl status apache2 (or httpd on some distros) shows whether it's running, and visiting the server in a browser should show either your site or Apache's default test page.
- Is Apache slower than Nginx?
- Under heavy concurrent load Apache can use more memory per connection than Nginx, but for most small-to-medium sites the real-world difference is negligible compared to application-level performance.