When using mac os for web development, you will encounter the situation that port 80 is already occupied. This problem can be solved through the following steps.
1. Use lsof -i:80 to check the processes currently occupying port 80, and kill them if there are any. (Recommended learning: apache use)
2. Turn off the startup of mac’s own apache.
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
If you want it to be started one day, change unload to load:
sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist
3. This is also the most common one. Mac prohibits ordinary users from accessing 1024 The following ports, including port 80. If you want to access through port 80, you need to use port forwarding. The command is as follows:
sudoipfw add fwd 127.0.0.1,1081 tcp from any to 127.0.0.1 80 in
It roughly means to do port forwarding, port 80 to 1081, so that the web services point to 1081 of nginx (equivalent to the original port 80)
About ipfw command:
a. View rules: sodu ipfw list
localhost:sbin lq$ sudo ipfw list 00100 fwd 127.0.0.1,1081 tcp fromany to 127.0.0.1 dst-port 80 in 65535 allow ip from any to any
b. Delete rules: sodu ipfw delete 100 [The deletion rule is: 00100 fwd 127.0.0.1,1081 tcp from any to 127.0.0.1 dst-port 80 in】
c. New rule: sudo ipfw add fwd 127.0.0.1,1081tcp from any to 127.0.0.1 80 in
The above is the detailed content of How to stop apache that comes with the system. For more information, please follow other related articles on the PHP Chinese website!

Apache is an open source web server software that is widely used in website hosting. Installation steps: 1. Install using the command line on Ubuntu; 2. The configuration file is located in /etc/apache2/apache2.conf or /etc/httpd/conf/httpd.conf. Through module extensions, Apache supports static and dynamic content hosting, optimizes performance and security.

Apache is still widely used, but its market share has dropped from more than 50% in 2010 to less than 30% in 2023. Its advantage lies in its stability and reliability, which is suitable for enterprise-level applications that require these characteristics; its disadvantage is that multi-process models consume a lot of resources under high concurrency, and Nginx performs better in high concurrency processing.

The core features of ApacheWebServer include modular design, virtual host configuration, security settings and performance optimization. 1) Modular design enables flexible extensions by loading different modules, such as mod_rewrite for URL rewriting. 2) Virtual host configuration allows multiple websites to be run on one server. 3) Security settings provide SSL/TLS encryption and access control. 4) Performance optimization involves enabling KeepAlive, adjusting MPM configuration, and enabling cache.

Reasons for Apache's continued importance include its diversity, flexibility, strong community support, widespread use and high reliability in enterprise-level applications, and continuous innovation in emerging technologies. Specifically, 1) The Apache project covers multiple fields from web servers to big data processing, providing rich solutions; 2) The global community of the Apache Software Foundation (ASF) provides continuous support and development momentum for the project; 3) Apache shows high stability and scalability in enterprise-level applications such as finance and telecommunications; 4) Apache continues to innovate in emerging technologies such as cloud computing and big data, such as breakthroughs from ApacheFlink and ApacheArrow.

Apache remains important in today's technology ecosystem. 1) In the fields of web services and big data processing, ApacheHTTPServer, Kafka and Hadoop are still the first choice. 2) In the future, we need to pay attention to cloud nativeization, performance optimization and ecosystem simplification to maintain competitiveness.

ApacheHTTPServer has a huge impact on WebHosting and content distribution. 1) Apache started in 1995 and quickly became the first choice in the market, providing modular design and flexibility. 2) In web hosting, Apache is widely used for stability and security and supports multiple operating systems. 3) In terms of content distribution, combining CDN use improves website speed and reliability. 4) Apache significantly improves website performance through performance optimization configurations such as content compression and cache headers.

Apache can serve HTML, CSS, JavaScript and other files. 1) Configure the virtual host and document root directory, 2) receive, process and return requests, 3) use .htaccess files to implement URL rewrite, 4) debug by checking permissions, viewing logs and testing configurations, 5) enable cache, compressing files, and adjusting KeepAlive settings to optimize performance.

ApacheHTTPServer has become a leader in the field of web servers for its modular design, high scalability, security and performance optimization. 1. Modular design supports various protocols and functions by loading different modules. 2. Highly scalable to adapt to the needs of small to large applications. 3. Security protects the website through mod_security and multiple authentication mechanisms. 4. Performance optimization improves loading speed through data compression and caching.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Atom editor mac version download
The most popular open source editor

WebStorm Mac version
Useful JavaScript development tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function
