Home Operation and Maintenance Apache Apache configuration under Windows (Alibaba Cloud ECS as an example)

Apache configuration under Windows (Alibaba Cloud ECS as an example)

May 25, 2019 pm 02:59 PM

1. Basic introduction to Apache

Apache HTTP Server (referred to as Apache) is an open source web server. The web server uses port 80 by default, and usually uses tomcat or php to process dynamic content. , while using mysql as the database, the installation and configuration of tomcat, php and mysql are detailed in other documents. This document is only the installation and configuration of apache. (What is apache server)

2. Apache installation

Download the apache installation package, double-click to start the installation, click Next, the system will appear For setting information, fill in your domain name (for example: test.com) under Network Domain, fill in your server name under Server Name (for example: www.testr.com, that is, the host name plus domain name), and fill in the Administrator's Email Under Address, fill in the contact email address of the system administrator (for example: test@aliyun). All three pieces of information can be filled in arbitrarily, and the website can be configured later.

Choose to install all, we choose to install on the D drive, and the installation is completed. Note: You can also use the PHP integrated environment tool phpStudy to install Apache.

Apache configuration under Windows (Alibaba Cloud ECS as an example)

3. Apache basic configuration

1. One way to start and shut down apache is to operate the icon in the lower right corner.

The other is to start the menu bar operation.

2. Apache logs, access logs and error logs can be viewed through the start menu or under %home%\logs.

3. The configuration file of apache can also be viewed in the start menu bar, or in %home%\conf\.

4. Configure apache site

(1) First configure the domain name and binding site IP. The binding domain name can be set when installing apache. After installation, it can be set in the configuration file %home% \conf\httpd.conf changes the ServerName option.

Binding IP can be set in the Listen option.

(2) Set the home directory of the website, which can be set in the DocumentRoot field in the configuration file.

(3) Setting the homepage of the website can be set through the DirectoryIndex field.

(4) Log settings, you can set the path to the access log in Customlog, and set the format of the log through LogFormat.

Define the path of the error log through the ErrorLog field. LogLevel records the log level. This is set to record logs above warning information.

5.apache virtual host configuration

(1) IP-based virtual host, the meaning of each noun has been explained previously and will not be repeated here.

(2) Domain name-based virtual host

4. PHP configuration

1. Create a new directory php on the D drive and unzip the php package to php.

2. Change the name of D:\php\php.ini-development to php.ini

3. Add the php support module to the apache configuration file httpd.conf.

4. See the database documentation for PHP connection database settings.

Appendix 1

Format and meaning of Apache access log

Example: 192.168.157.1 - - [26/Dec/2012:09:14 :43 0800] "GET /favicon.ico HTTP/1.1" 404 209

1. Client IP 2.-(E-mail) 3.-(Login name), 4. Request time 5. Method Resource protocol 6. Status code 7. Number of bytes sent

Format and meaning of Apache error log

Example: [Wed Dec 26 09:20:46 2012] [error] [client 192.168 .157.1] File does not exist: D:/Program Files/Apache Software Foundation/Apache2.2/htdocs/favicon.ico

1. Time 2. Log level 3. Client IP 4. Error message

The above is the detailed content of Apache configuration under Windows (Alibaba Cloud ECS as an example). For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
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

Hot AI Tools

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.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How do I configure Apache to work with Node.js using mod_proxy? How do I configure Apache to work with Node.js using mod_proxy? Mar 17, 2025 pm 05:18 PM

Article discusses configuring Apache with Node.js using mod_proxy, common issues, load balancing, and security measures. Main focus is on setup and optimization.(159 characters)

How do I configure Apache for streaming video using mod_flvx and mod_h264_streaming? How do I configure Apache for streaming video using mod_flvx and mod_h264_streaming? Mar 17, 2025 pm 05:19 PM

Article discusses configuring Apache for video streaming using mod_flvx and mod_h264_streaming, detailing installation, configuration, optimization, and common issues resolution.

How do I configure Apache for server-side includes (SSI) using mod_include? How do I configure Apache for server-side includes (SSI) using mod_include? Mar 17, 2025 pm 05:19 PM

The article discusses configuring Apache for server-side includes (SSI) using mod_include, detailing steps to enable and configure SSI, and addressing benefits and troubleshooting common issues.Character count: 159

How do I implement HTTP/2 with Apache? How do I implement HTTP/2 with Apache? Mar 17, 2025 pm 05:13 PM

Article discusses implementing HTTP/2 with Apache, its performance benefits, and troubleshooting. Main issue is ensuring correct configuration and verification of HTTP/2.

Apache Performance Tuning: Optimizing Speed & Efficiency Apache Performance Tuning: Optimizing Speed & Efficiency Apr 04, 2025 am 12:11 AM

Methods to improve Apache performance include: 1. Adjust KeepAlive settings, 2. Optimize multi-process/thread parameters, 3. Use mod_deflate for compression, 4. Implement cache and load balancing, 5. Optimize logging. Through these strategies, the response speed and concurrent processing capabilities of Apache servers can be significantly improved.

What are the best tools for monitoring Apache? What are the best tools for monitoring Apache? Mar 17, 2025 pm 05:22 PM

The article discusses top tools for monitoring Apache servers, focusing on their features, real-time capabilities, and cost-effectiveness. It also explains how to use these tools to optimize Apache performance.

Apache Troubleshooting: Diagnosing & Resolving Common Errors Apache Troubleshooting: Diagnosing & Resolving Common Errors Apr 03, 2025 am 12:07 AM

Apache errors can be diagnosed and resolved by viewing log files. 1) View the error.log file, 2) Use the grep command to filter errors in specific domain names, 3) Clean the log files regularly and optimize the configuration, 4) Use monitoring tools to monitor and alert in real time. Through these steps, Apache errors can be effectively diagnosed and resolved.

How do I configure browser caching in Apache using mod_expires? How do I configure browser caching in Apache using mod_expires? Mar 17, 2025 pm 05:12 PM

Article discusses configuring browser caching in Apache using mod_expires. Main issue is optimizing web performance through caching settings.Character count: 159

See all articles