Skip to main content

How to Change Apache's Default HTTP Port on Linux (Debian/Ubuntu)

HardReset.InfoDecember 31, 20254 min11 views
4 connections·7 entities in this video→

Verifying Apache Status and Default Port

  • 🎯 Verify Apache 2 status using sudo systemctl status apache2 to ensure it's active and running.
  • πŸ’‘ Test the default HTTP port (80) by navigating to http://localhost or http://localhost:80 in your browser to confirm Apache is accessible.

Editing Apache Configuration File

  • πŸ› οΈ Access the Apache configuration file by using the command sudo nano /etc/apache2/ports.conf.
  • πŸ“Œ Locate the Listen 80 directive within the ports.conf file.

Changing and Restarting Apache Service

  • ⚑ Modify the Listen directive from 80 to your desired port, for example, 7000.
  • πŸ’Ύ Save the changes by pressing Ctrl+O, Enter, and exit the editor with Ctrl+X.
  • πŸ”„ Restart the Apache service to apply the changes with sudo systemctl restart apache2.

Verifying the New Port Configuration

  • βœ… Confirm that Apache is running again using sudo systemctl status apache2.
  • πŸš€ Test the new port by accessing http://localhost:7000 in your browser to ensure Apache is now listening on the custom port.
Knowledge graph7 entities Β· 4 connections

How they connect

An interactive map of every person, idea, and reference from this conversation. Hover to trace connections, click to explore.

Hover Β· drag to explore
7 entities
Chapters2 moments

Key Moments

Transcript16 segments

Full Transcript

Topics10 themes

What’s Discussed

Apache HTTP ServerApache2LinuxHTTP Portports.confListen DirectivesystemctlDebianUbuntuTerminal Commands
Smart Objects7 Β· 4 links
ProductΒ· 1
LocationΒ· 1
ConceptsΒ· 5