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

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Enable Apache’s HTTP/2 module with sudo a2enmod http2, then add Protocols h2 http/1.1 inside the site’s HTTPS virtual host. Validate the configuration, reload Apache, and verify negotiation with an HTTP/2-capable client such as curl. A normal browser deployment uses HTTP/2 over TLS (the h2 protocol); cleartext h2c is a specialized server-to-server case.

What enabling HTTP/2 changes

Apache implements HTTP/2 through mod_http2. Enabling the module makes the Protocols directive available; the directive then determines which application protocols Apache advertises and accepts. For a public website, the usual setting is Protocols h2 http/1.1 in the TLS virtual host that serves the site.

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

h2 means HTTP/2 negotiated over TLS. Browsers normally use this path through TLS Application-Layer Protocol Negotiation (ALPN). Keeping http/1.1 in the list gives clients that cannot use HTTP/2 a normal fallback. HTTP/2 is therefore an additional protocol choice, not a replacement that requires every client to support it.

h2c is HTTP/2 over a cleartext connection. Apache documents it, but it is not the normal browser configuration for an internet-facing HTTPS site. Enabling it casually can expose a protocol path you did not intend to provide. Use it only when a controlled server-to-server requirement is understood.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.

Check the Ubuntu host before changing Apache

Use a supported, updated release

Historical Ubuntu advisories record mod_http2 availability, build, and denial-of-service issues that affected older release and package combinations. Before changing configuration, confirm that the machine runs a supported Ubuntu release and has current security updates installed. If the host is on an old release, upgrading or applying the available security updates is safer than forcing a module configuration onto an obsolete package.

Package names and configuration paths below assume Ubuntu’s packaged Apache installation. Confirm the installed Apache version and the package state with your normal system administration process before proceeding. Apache supports mod_http2 from Apache HTTP Server 2.4.17 onward, but the Ubuntu package still needs to include and support the module for your release.

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

Identify the HTTPS virtual host

HTTP/2 must be enabled in the virtual host that actually answers the HTTPS request. Look for the site’s <VirtualHost *:443> block in the enabled Apache site configuration. Ubuntu commonly keeps site definitions in /etc/apache2/sites-available and enables them through links in /etc/apache2/sites-enabled; the exact filename depends on how the site was created and whether a certificate tool generated it.

Confirm the block’s ServerName and any ServerAlias values match the hostname you will test. If several HTTPS sites share the server, putting the directive in the wrong block can leave the intended site on HTTP/1.1 or change a different site instead.

Enable HTTP/2 in Apache on Ubuntu

  1. Enable the module with a2enmod

    Run:

    sudo a2enmod http2

    Ubuntu’s a2enmod utility enables a module by creating links under /etc/apache2/mods-enabled. A module can have both a .load file and a .conf file, so enabling it through the utility is preferable to hand-editing the module directory. If the command reports that the module is unavailable, check the Apache package and Ubuntu release rather than copying configuration from another system.

  2. Make sure HTTPS and TLS are already working

    HTTP/2 browser negotiation normally occurs on an HTTPS virtual host. Confirm that the site already loads over https://, that its certificate is valid for the hostname, and that the TLS virtual host contains the existing certificate and document-root directives. Ubuntu’s Apache setup uses mod_ssl for TLS; enabling HTTP/2 does not create a certificate or convert an HTTP-only site into an HTTPS site.

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

    Do not troubleshoot HTTP/2 by removing certificate checks or weakening the site’s TLS policy. Clients can reject HTTP/2 when the protocol or cipher policy offered by the server is unsuitable, even though the same endpoint might still work with HTTP/1.1.

    Rank #2
    EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
    • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
    • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
    • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
    • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
    • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
  3. Add the protocol directive to the TLS virtual host

    Edit the configuration file for the site’s HTTPS virtual host and place the directive inside that block:

    <VirtualHost *:443>
        ServerName example.com
        # Keep the site's existing certificate and document-root directives
        Protocols h2 http/1.1
    </VirtualHost>

    Replace example.com with the real hostname and retain the certificate, key, logging, proxy, and document-root settings already used by the site. The important line is Protocols h2 http/1.1. Apache’s directive can be scoped per virtual host, so one HTTPS site can use HTTP/2 while another remains HTTP/1.1-only.

    Do not add h2c to this public TLS example merely because you have seen it in a generic Apache configuration. h2c is cleartext HTTP/2; it is appropriate only for a deliberately designed, controlled connection between compatible systems.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  4. Validate the syntax before reloading

    Ask Apache to parse every enabled configuration file:

    sudo apache2ctl configtest

    A successful check normally reports Syntax OK. If Apache reports an error, note the filename and line number, correct that problem, and run the test again. Do not reload a configuration that has failed validation.

  5. Reload Apache gracefully

    After the syntax check succeeds, reload the service:

    sudo systemctl reload apache2

    A reload applies the new module and virtual-host settings without intentionally stopping the service. Ubuntu also documents restarting Apache after module changes; use a full restart when a reload does not apply the change or when your operational procedure requires one:

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
    Rank #3
    Sale
    BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
    • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
    • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
    • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
    • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
    • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
    sudo systemctl restart apache2

    Because a restart has a larger impact than a reload, use it only after the configuration test succeeds and you understand the maintenance implications.

  6. Verify that the module is loaded

    Inspect Apache’s loaded-module list:

    apache2ctl -M | grep http2

    The output should identify the HTTP/2 module, commonly as http2_module. This check confirms that Apache loaded the module, but it does not prove that a particular hostname negotiated HTTP/2; that requires a client-side test against the intended HTTPS URL.

  7. Test protocol negotiation from a client

    Use an installed curl build with HTTP/2 support:

    curl -I --http2 https://example.com/

    For a more detailed trace, use:

    curl -v --http2 https://example.com/

    In a successful negotiation, the verbose exchange identifies HTTP/2 and the response status is shown with an HTTP/2 protocol line, such as HTTP/2 200. The exact wording depends on the curl and TLS builds installed on the client. If curl says that the --http2 option is unsupported, that client was built without HTTP/2 support; test from another HTTP/2-capable client instead of treating that error as an Apache failure.

    Test the public hostname, not just an IP address. Hostname selection, the certificate, ALPN, and the matching TLS virtual host all participate in negotiation.

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

Choose the right Protocols configuration

Configuration Transport Typical use Scope and caution
Protocols h2 http/1.1 HTTP/2 over TLS, with HTTP/1.1 fallback Normal browser-facing HTTPS site Place it in the specific <VirtualHost *:443> block so only that site is changed.
Protocols h2c http/1.1 Cleartext HTTP/2, with HTTP/1.1 Controlled server-to-server connection where h2c is explicitly required Do not enable it on a public site without understanding the cleartext exposure and client behavior.
Protocols h2 h2c http/1.1 TLS HTTP/2 and cleartext HTTP/2 Specialized server context or mixed controlled deployments Broader than a normal browser setup; it permits cleartext negotiation as well.
Directive in global server context Depends on the protocols listed Policy intended for many or all virtual hosts Can affect sites you did not intend to change. Per-virtual-host placement is easier to reason about for a single website.

Apache documents both protocol schemes and allows the directive in different configuration contexts. The placement determines which virtual hosts inherit the setting. For one public domain, the least surprising configuration is the TLS-only line inside that domain’s HTTPS virtual host.

How TLS, ALPN, and fallback affect the result

ALPN selects the protocol during TLS

When a browser connects over HTTPS, the client and server use TLS ALPN to agree on an application protocol. The h2 identifier represents HTTP/2 over TLS. If the client does not offer HTTP/2, or Apache cannot accept it under the negotiated TLS policy, the connection can use the advertised http/1.1 fallback.

HTTP/2 does not repair a broken HTTPS site

A certificate mismatch, an incorrect ServerName, an incomplete certificate chain, or a TLS virtual host that is not the one serving the request can all make an HTTP/2 test misleading. First establish that the exact hostname loads through the intended certificate and virtual host. Then inspect whether the client and server negotiated the protocol.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Keep the fallback unless you have a specific reason not to

Listing http/1.1 alongside h2 preserves compatibility for clients that lack HTTP/2 support. Removing the fallback is a policy decision with wider compatibility consequences and is not required to enable HTTP/2.

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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common failures

Invalid command 'Protocols'

This message usually means that mod_http2 is not loaded or that the installed Apache build does not provide it. Run:

sudo a2enmod http2
apache2ctl -M | grep http2

Then check the installed Apache package and version. If a2enmod cannot find the module, update the supported Ubuntu package or move the host to a supported release. Do not solve the error by leaving an unknown directive in production configuration.

The browser still reports HTTP/1.1

Check the request path in this order:

  • Make sure the test URL uses https:// and reaches the expected hostname.
  • Confirm that Protocols h2 http/1.1 is inside the matching <VirtualHost *:443> block, not only in an unrelated site or an unused file.
  • Verify that mod_http2 appears in apache2ctl -M.
  • Confirm that the certificate and TLS virtual host are the ones being served for that hostname.
  • Check that the TLS protocol and cipher policy is acceptable to HTTP/2 clients. Apache notes that unsuitable TLS settings can cause clients to refuse HTTP/2 and fall back to HTTP/1.1.
  • Repeat the test with an HTTP/2-capable curl build and its verbose output so you can distinguish client limitations from server negotiation.

The wrong site changed

If another domain began negotiating HTTP/2, or the intended domain did not change, inspect directive scope. A setting in global server context can affect more virtual hosts than intended, while a setting in the wrong HTTPS block affects a different site. Move the directive into the exact <VirtualHost *:443> block identified by its ServerName and aliases, then validate and reload again.

The reload fails

Run sudo apache2ctl configtest and follow the reported filename and line number. Typical causes include a misspelled directive, an unmatched virtual-host tag, or an edit made to a file that is not valid for the installed Apache version. Correct the syntax first; a service reload should be the final step, not a way to discover whether the file parses.

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

The module was enabled but requests remain unchanged

Enabling a module and configuring a protocol are separate actions. The a2enmod command loads the module, while the Protocols directive advertises the allowed protocols for a server or virtual host. Confirm both states independently: inspect apache2ctl -M for the module and inspect the active HTTPS virtual-host file for the directive. Then test the public hostname after the reload.

An old Ubuntu installation has inconsistent behavior

Older Ubuntu releases and package revisions have had documented mod_http2 availability and security limitations. If the module is missing, behaves differently from current documentation, or the package has known historical issues, apply current security updates or upgrade the operating system before continuing. A configuration copied from a newer Apache package is not a substitute for a supported server.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

Configure several HTTPS sites safely

Apache can serve many TLS virtual hosts from one machine. Decide per site whether HTTP/2 is appropriate, then place the directive only in the selected site blocks:

<VirtualHost *:443>
    ServerName one.example
    Protocols h2 http/1.1
    # existing TLS and site directives
</VirtualHost>

<VirtualHost *:443>
    ServerName two.example
    # This site remains on its existing protocol policy
</VirtualHost>

After editing multiple files, run one configuration test and one reload. Verify each hostname separately because a successful negotiation for one virtual host does not prove that another host has the same certificate, ALPN behavior, or protocol directive.

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

Rollback and maintenance

Remove HTTP/2 from one site

To return a site to its previous protocol policy, remove or comment out its Protocols h2 http/1.1 line, run sudo apache2ctl configtest, and reload Apache. Leave the module enabled if other virtual hosts still use HTTP/2; module enablement is global to the Apache instance, while the protocol choice can be per virtual host.

Disable the module entirely

Only disable mod_http2 when no enabled site needs it. Use Ubuntu’s module utility rather than deleting files manually:

sudo a2dismod http2
sudo apache2ctl configtest
sudo systemctl reload apache2

Any remaining Protocols h2 ... directive will fail validation after the module is disabled, so remove those directives first or disable the module only after confirming they are no longer present.

Keep the change auditable

Record the edited virtual-host file, the output of apache2ctl configtest, the reload time, and the client command used for verification. Future package upgrades can replace or alter generated site files, and an audit trail makes it clear whether a later HTTP/1.1 fallback came from configuration, TLS policy, client capability, or a package change.

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.

HTTP/2 enablement checklist

  • Ubuntu is supported and current security updates are installed.
  • Apache is new enough to provide mod_http2, and the Ubuntu package includes it.
  • The exact HTTPS virtual host for the hostname has been identified.
  • sudo a2enmod http2 completed successfully.
  • The site already has working HTTPS, a valid certificate, and an appropriate TLS policy.
  • Protocols h2 http/1.1 is inside the intended <VirtualHost *:443> block.
  • sudo apache2ctl configtest reports valid syntax.
  • Apache was reloaded or restarted only after validation.
  • apache2ctl -M | grep http2 shows the module.
  • An HTTP/2-capable client confirms negotiation against the public hostname.

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.