How to configure multiple http ports in apache
Method 1: Use httpd-vhosts
(Related recommendations: apache)
Enter the apache configuration directory, such as/ usr/local/apache/conf/
Open the httpd.conf file
Configure multiple listening windows 81, 82
ServerName localhost:81 # Listen 80 Listen 81 Listen 82
Find #Include conf/extra/httpd-vhosts .conf, remove the # sign, uncomment
Enter the /usr/local/apache/conf/extra directory, open the httpd-vhosts.conf file
Configure NameVirtualHost *:81
<VirtualHost *:81> ServerAdmin host1.example.com DocumentRoot "/home/public/web/host1" ServerName localhost:81 ServerAlias localhost:81 ErrorLog "logs/host1.example.com-error_log" #CustomLog "logs/host1.example.com-access_log common" </VirtualHost> <VirtualHost *:82> ServerAdmin host2.example.com DocumentRoot "/home/public/web/host2" ServerName localhost:82 ErrorLog "logs/host1.example.com-error_log" #CustomLog "logs/host1.example.com-access_log common" </VirtualHost>
Method 2: Only modify httpd.conf
Enter the apache configuration directory, such as /usr/local/apache/conf/
Open the httpd.conf file
Configuration Multiple listening windows, 81, 82
Listen 81 Listen 82
and add the following content at the end of the file:
<VirtualHost *:81> DocumentRoot /home/public/web/host1 ServerName localhost:81 </VirtualHost> <Directory /home/public/web/host1> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> <VirtualHost *:82> DocumentRoot /home/public/web/host2 ServerName localhost:82 </VirtualHost> <Directory /home/public/web/host2> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory>
apache directory permission settings for different versions
1, old use
Order allow,deny Allow from all
2, new use
Require all granted
3, new example
#add for WWW Listen 91 <VirtualHost *:91> DocumentRoot "D:/IDE/WWW" ServerName localhost:91 </VirtualHost> <Directory "D:/IDE/WWW"> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory>
The above is the detailed content of How to configure multiple http ports in apache. For more information, please follow other related articles on the PHP Chinese website!

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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Concurrency testing and debugging Concurrency testing and debugging in Java concurrent programming are crucial and the following techniques are available: Concurrency testing: Unit testing: Isolate and test a single concurrent task. Integration testing: testing the interaction between multiple concurrent tasks. Load testing: Evaluate an application's performance and scalability under heavy load. Concurrency Debugging: Breakpoints: Pause thread execution and inspect variables or execute code. Logging: Record thread events and status. Stack trace: Identify the source of the exception. Visualization tools: Monitor thread activity and resource usage.

1. Background of the Construction of 58 Portraits Platform First of all, I would like to share with you the background of the construction of the 58 Portrait Platform. 1. The traditional thinking of the traditional profiling platform is no longer enough. Building a user profiling platform relies on data warehouse modeling capabilities to integrate data from multiple business lines to build accurate user portraits; it also requires data mining to understand user behavior, interests and needs, and provide algorithms. side capabilities; finally, it also needs to have data platform capabilities to efficiently store, query and share user profile data and provide profile services. The main difference between a self-built business profiling platform and a middle-office profiling platform is that the self-built profiling platform serves a single business line and can be customized on demand; the mid-office platform serves multiple business lines, has complex modeling, and provides more general capabilities. 2.58 User portraits of the background of Zhongtai portrait construction

To add a server to Eclipse, follow these steps: Create a server runtime environment Configure the server Create a server instance Select the server runtime environment Configure the server instance Start the server deployment project

How to implement HTTP streaming in C++? Create an SSL stream socket using Boost.Asio and the asiohttps client library. Connect to the server and send an HTTP request. Receive HTTP response headers and print them. Receives the HTTP response body and prints it.

KubernetesOperator simplifies PHP cloud deployment by following these steps: Install PHPOperator to interact with the Kubernetes cluster. Deploy the PHP application, declare the image and port. Manage the application using commands such as getting, describing, and viewing logs.

If the last trouble you have with your iPhone is with the charging port. If you can't confirm charging your iPhone, it won't last long. Leave everything else aside and focus on these tips to fix faulty charging port prompts on your phone. Fix 1 – Check the charging port The first thing you should do is check the charging port on your phone. Step 1 – Disconnect your phone from the power cord. Remove the case/back cover from the phone. Step 2 – Next, check the charging port on your device. Step 3 – Take a small piece of toothpick. Make sure the tips are clean and free of moisture. Step 4 – Use it to clean any dust from the charging socket or any other particles in the slot. Make sure you clean it properly. After this, try to charge your iPhone using the power cord.

How to Implement PHP Security Best Practices PHP is one of the most popular backend web programming languages used for creating dynamic and interactive websites. However, PHP code can be vulnerable to various security vulnerabilities. Implementing security best practices is critical to protecting your web applications from these threats. Input validation Input validation is a critical first step in validating user input and preventing malicious input such as SQL injection. PHP provides a variety of input validation functions, such as filter_var() and preg_match(). Example: $username=filter_var($_POST['username'],FILTER_SANIT

Implementing HTTP file upload security in Golang requires following these steps: Verify file type. Limit file size. Detect viruses and malware. Store files securely.
