Home Operation and Maintenance Apache Modify the default path of apache server under linux

Modify the default path of apache server under linux

Feb 03, 2021 am 11:04 AM
apache linux

Modify the default path of apache server under linux

Introduction:

Apache (transliterated as Apache) is the world's number one Web server software. It can run on almost all widely used computer platforms and is one of the most popular web server-side software due to its cross-platform and security features. It is fast, reliable and can be extended through a simple API to compile interpreters such as Perl/Python into the server.

The specific method is as follows:

1: Check whether apache has been installed on the server, stop and uninstall the system's own apache service

The command is:

rpm -qa|grep httpd
rpm -e --nodeps httpd-tools..
Copy after login

Modify the default path of apache server under linux

2: After the uninstallation is completed, upload all the packages required for httpd service installation

Modify the default path of apache server under linux

The installation package cloud disk address is: http: //pan.baidu.com/s/1qYTgomo Password: nk7z

I uploaded it to the /usr/local directory, then decompressed and installed

Three: Install the above installation packages in order Installation

Install apr, solve the problem of apr not found

Modify the default path of apache server under linux

##Install apr-util, solve the problem of apr-util not found

Modify the default path of apache server under linux

Install pcre and solve the problem of pcre not found

Modify the default path of apache server under linux

Install httpd

[root@zdhcs5 local]# tar zxvf httpd-2.4.7.tar.gz
[root@zdhcs5 local]# cd httpd-2.4.7
[root@zdhcs5 httpd-2.4.7]# ./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre  (除了指定Apache的安装目录外,还要安装apr、apr-util、pcre,并指定参数)
[root@zdhcs5 httpd-2.4.7]# make
[root@zdhcs5 httpd-2.4.7]# make install
Copy after login

Four: Start the apache service and verify that the installation is successful, browse When the "it works" appears when entering the URL into the browser, the installation is successful

1 [root@zdhcs5 bin]# cd /usr/local/apache2/bin/
2 [root@zdhcs5 bin]# ./apachectl start
Copy after login

Modify the default path of apache server under linux

5: Modify the apache default display path to a custom path

My custom path is an automated result Report path, that is, you can see the automation result report running on the Linux server by opening the URL

My custom automation result report path is (under the autotest user): /home/autotest/workspace/auto-project /test-output/html

There are two things that need to be modified when modifying the apache configuration file:

1 [root@zdhcs5 local]# vi /usr/local/apache2/conf/httpd.conf
Copy after login

The first part: modify the path


Before modification:

Modify the default path of apache server under linux

After modification:

Modify the default path of apache server under linux

Second point: Modify the user and group, the reason why the daemon user is modified to autotest It is to allow apache to have permission to access my custom path, because my custom path is under the autotest user

Before modification:

Modify the default path of apache server under linux

After modification:

Modify the default path of apache server under linux

Save and exit, restart the apache service:

1 [root@zdhcs5 local]# cd /usr/local/apache2/bin
2 [root@zdhcs5 bin]# ./apachectl stop
3 [root@zdhcs5 bin]# ./apachectl start
Copy after login

After successful startup, in order to prevent the error report of no permission when accessing the address in the browser, we still need to modify it The permissions of the entire path of the custom file are 755

The custom path is configured as above:/home/autotest/workspace/auto-project/test-output/html

Use the autotest user to execute the following Command: (autotest is the user of your custom path), according to the actual modification,

1 [autotest@zdhcs5 html]$ chmod -R 775 /home/autotest/workspace/auto-project/test-output/html
Copy after login
Then go to the browser to verify whether it is successful, refresh the browser address just now:

Modify the default path of apache server under linux

Now you have installed apache under Linux and modified the default path to a custom path.

Related recommendations:

apache tutorial

The above is the detailed content of Modify the default path of apache server under linux. 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

Video Face Swap

Video Face Swap

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

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)

What computer configuration is required for vscode What computer configuration is required for vscode Apr 15, 2025 pm 09:48 PM

VS Code system requirements: Operating system: Windows 10 and above, macOS 10.12 and above, Linux distribution processor: minimum 1.6 GHz, recommended 2.0 GHz and above memory: minimum 512 MB, recommended 4 GB and above storage space: minimum 250 MB, recommended 1 GB and above other requirements: stable network connection, Xorg/Wayland (Linux)

How to run java code in notepad How to run java code in notepad Apr 16, 2025 pm 07:39 PM

Although Notepad cannot run Java code directly, it can be achieved by using other tools: using the command line compiler (javac) to generate a bytecode file (filename.class). Use the Java interpreter (java) to interpret bytecode, execute the code, and output the result.

How to switch Chinese mode with vscode How to switch Chinese mode with vscode Apr 15, 2025 pm 11:39 PM

VS Code To switch Chinese mode: Open the settings interface (Windows/Linux: Ctrl, macOS: Cmd,) Search for "Editor: Language" settings Select "Chinese" in the drop-down menu Save settings and restart VS Code

What is the main purpose of Linux? What is the main purpose of Linux? Apr 16, 2025 am 12:19 AM

The main uses of Linux include: 1. Server operating system, 2. Embedded system, 3. Desktop operating system, 4. Development and testing environment. Linux excels in these areas, providing stability, security and efficient development tools.

How to use VSCode How to use VSCode Apr 15, 2025 pm 11:21 PM

Visual Studio Code (VSCode) is a cross-platform, open source and free code editor developed by Microsoft. It is known for its lightweight, scalability and support for a wide range of programming languages. To install VSCode, please visit the official website to download and run the installer. When using VSCode, you can create new projects, edit code, debug code, navigate projects, expand VSCode, and manage settings. VSCode is available for Windows, macOS, and Linux, supports multiple programming languages ​​and provides various extensions through Marketplace. Its advantages include lightweight, scalability, extensive language support, rich features and version

vscode Previous Next Shortcut Key vscode Previous Next Shortcut Key Apr 15, 2025 pm 10:51 PM

VS Code One-step/Next step shortcut key usage: One-step (backward): Windows/Linux: Ctrl ←; macOS: Cmd ←Next step (forward): Windows/Linux: Ctrl →; macOS: Cmd →

How to type multiple lines of comments in vscode How to type multiple lines of comments in vscode Apr 15, 2025 pm 11:57 PM

VS Code The methods of multi-line commenting are: 1. Shortcut keys (Ctrl K C or Cmd K C); 2. Manually add comment symbols (/ /); 3. Select menu ("Comment Block"); 4. Use extensions; 5. Recursive comments (/* /) and block comments ({/ and /}). Multi-line comments help improve code readability and maintainability, but overuse should be avoided.

How to set shortcut keys for sublime How to set shortcut keys for sublime Apr 16, 2025 am 09:15 AM

To set the shortcut keys for Sublime Text, follow these steps: Open the shortcut key settings file Key Bindings - User. Add shortcut key settings using the format { "keys": ["key combination"], "command": "command" }. Save changes. Reload the shortcut key settings for the changes to take effect.

See all articles