Home > Article > Backend Development > How to modify configurations such as changing the Apache port_PHP tutorial
How to change the Apache port : Find the httpd.conf file in the conf directory under the Apache installation directory. Open it and find "Listen". The number next to Listen is the port number, which is "Listen 80" by default. In the previous PHP topic, we mentioned that when installing and configuring Apache, we will encounter the problem of port conflict with the IIS HTTP port, because the IIS HTTP port is also 80 by default. Then we can change the Apache port here to avoid conflicts, for example, it can be changed to: Listen 8011. After making the changes, don’t forget to restart the Apache service for the configuration to take effect.
How to change the IIS port: If you want to keep the Apache service and the IIS service at the same time, but do not want to change the default port 80 of Apache, then the only way is to change the IIS port. Start->Run->Enter: inetmgr->Internet Information Services->Local Computer->Website->Right-click "Default Website"->Properties->Select the "Website" tab->Modify Just the TCP port. Finally, don’t forget to restart the IIS service.
How to configure and change the address path of the Apache web service directory on this machine : By default, Apache's wwwroot is the htdocs directory under the Apache installation directory. If you want to change the location of this directory , then open httpd.conf and find DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs" and
How to configure and change the Apache homepage file name: When you enter, for example, http://localhost, Apache will open the index.html file by default. If you want to modify the homepage file or add a homepage file , still open httpd.conf, find DirectoryIndex index.html, and modify index.html to the file name you want, such as main.php. If you want to add multiple homepage files, you can separate them with spaces. The order of the files is the priority of reading the homepage files. Restart the Apache service.
Okay, after understanding these basic configuration methods and concepts, we can make our system more smoothly!