search
HomeOperation and MaintenanceApacheHow to change apache port

How to change apache port

Jun 14, 2019 pm 03:14 PM
apacheport

When using apache to build a PHP development environment, we often encounter situations where the port is occupied. We can kill the process using port 80 or modify the default port 80 of apache. The following article will introduce to you how to modify the apache port. I hope it will be helpful to you.

How to change apache port

Steps to change the apache port:

1. Go to the apache installation directory

How to change apache port

2. Enter the apache configuration file directory conf

How to change apache port

3. Right-click to edit the apache configuration file httpd.conf

How to change apache port

5. Use ctrl f to quickly search for Listen

How to change apache port

. Go to the Listen 80 line and change 80 to another unoccupied port number. I changed it to 90 here and saved the current changes.

How to change apache port

How to change apache port

6. Restart apache to make the new configuration take effect.

Click "Start" > "Run" > Enter cmd > Enter > Navigate to the apache installation directory to the bin directory, and then enter the "httpd-k start" command.

7 , after opening the browser, you can access it through 127.0.0.1:90

The above is the detailed content of How to change apache port. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How to start, stop, and restart Apache?How to start, stop, and restart Apache?Aug 13, 2025 am 07:43 AM

UsesystemctlformodernLinuxsystems:sudosystemctlstart/restart/stopapache2(Debian/Ubuntu)orhttpd(CentOS/RHEL),andsystemctlstatustocheck.2.Onoldersystems,useserviceapache2/httpdstart/stop/restart.3.Useapachectlstart/stop/restart/gracefulforcross-platfor

Solving apache service starts and then stopsSolving apache service starts and then stopsAug 13, 2025 am 07:18 AM

Stop immediately after the Apache service is started is usually caused by configuration errors, port conflicts or lack of dependencies. First, check the error log location problem: 1. Check xampp\apache\logs\error.log in Windows system, check /var/log/apache2/error.log or /var/log/httpd/error_log to find the [error] or [crit] level log; 2. The most common reason is port conflicts. Use the netstat command to check port 80 or 443, which can be solved by changing the Apache listening port to 8080 or terminating the occupied process (such as Skype, IIS).

How to fix apache error log not writingHow to fix apache error log not writingAug 13, 2025 am 06:36 AM

First, check whether the ErrorLog directive in the Apache configuration file is correctly set and not commented, and whether the path is accessible; 2. Ensure that the permissions and ownership of the log files and directories are correct, and that Apache must have write permissions (such as www-data); 3. Check whether security modules such as SELinux or AppArmor block log writing, and adjust the policy if necessary; 4. After modifying the configuration, restart the Apache service and trigger error test log recording; 5. Check the disk space and inode usage to ensure that it is not exhausted; 6. Check whether the system logs such as journalctl or syslog have permission denied or the log cannot be opened; 7. Confirm that the Apache service is

How to configure Apache for PHP?How to configure Apache for PHP?Aug 13, 2025 am 05:26 AM

Install Apache and PHP: Use sudoaptininstallapache2phplibapache2-mod-php on Ubuntu/Debian, use sudoyumininstallhttpdphp or sudodnfininstallhttpdphp on CentOS/RHEL; 2. Enable PHP module: It is usually automatically enabled on Debian/Ubuntu, and can be verified through apache2ctl-M|grepphp. If the available sudoa2enmodphp version number is not enabled and Apache is restarted, CentOS needs to ensure /etc/httpd/conf.d

Why is my Apache redirect from HTTP to HTTPS not workingWhy is my Apache redirect from HTTP to HTTPS not workingAug 12, 2025 am 08:28 AM

EnsuretheHTTPvirtualhostonport80iscorrectlyconfiguredwithaRedirectdirectiveorRewriteRuletoHTTPS;2.Confirmmod_aliasormod_rewriteisenabledusingsudoa2enmodaliasorsudoa2enmodrewriteandrestartApache;3.VerifyApacheislisteningonport80bycheckingListen80inpor

Solving apache address already in use errorSolving apache address already in use errorAug 12, 2025 am 06:41 AM

First,usesudolsof-i:80ornetstattoidentifytheprocessoccupyingport80or443.2.Then,stoptheconflictingprocessusingkill-9onLinux/macOSortaskkill/PID/FonWindows,targetingcommonculpritslikeNginx,Skype,orIIS.3.Optionally,changeApache’sportbyeditingthehttpd.co

How to fix 'AH00558: could not reliably determine the server's fully qualified domain name'?How to fix 'AH00558: could not reliably determine the server's fully qualified domain name'?Aug 12, 2025 am 03:45 AM

SettheServerNameinApacheConfigurationbyopeningthemainconfigfile,typicallylocatedat/etc/httpd/conf/httpd.confor/etc/apache2/apache2.conf,andaddServerNamelocalhost:80oryourdomain,thenrestartApachetoresolvetheAH00558warning.

How to fix Apache CGI script not executing properlyHow to fix Apache CGI script not executing properlyAug 12, 2025 am 12:36 AM

EnsuretheCGImoduleisenabledinApacheusinga2enmodcgiorloadingmod_cgi.so,thenrestarttheserver.2.VerifythescriptisinaproperlyconfigureddirectorywithScriptAliasorExecCGIoptionsenabled.3.Setfilepermissionsto755andownershiptothewebuser(e.g.,www-data).4.Conf

See all articles

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft