search
HomeOperation and MaintenanceApacheModify the default path of apache server under 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..

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

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

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

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

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

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
This article is reproduced at:博客园. If there is any infringement, please contact admin@php.cn delete
Apache's Continuing Importance: Reasons for Its LongevityApache's Continuing Importance: Reasons for Its LongevityApr 22, 2025 am 12:08 AM

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.

Beyond the Hype: Assessing Apache's Current RoleBeyond the Hype: Assessing Apache's Current RoleApr 21, 2025 am 12:14 AM

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.

Apache's Impact: Web Hosting and Content DeliveryApache's Impact: Web Hosting and Content DeliveryApr 20, 2025 am 12:12 AM

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's Role: Serving HTML, CSS, JavaScript, and MoreApache's Role: Serving HTML, CSS, JavaScript, and MoreApr 19, 2025 am 12:09 AM

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.

What Apache is Known For: Key Features and AchievementsWhat Apache is Known For: Key Features and AchievementsApr 18, 2025 am 12:03 AM

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.

The Enduring Relevance of Apache: Examining Its Current StatusThe Enduring Relevance of Apache: Examining Its Current StatusApr 17, 2025 am 12:06 AM

ApacheHTTPServer remains important in modern web environments because of its stability, scalability and rich ecosystem. 1) Stability and reliability make it suitable for high availability environments. 2) A wide ecosystem provides rich modules and extensions. 3) Easy to configure and manage, and can be quickly started even for beginners.

Apache's Popularity: Reasons for Its SuccessApache's Popularity: Reasons for Its SuccessApr 16, 2025 am 12:05 AM

The reasons for Apache's success include: 1) strong open source community support, 2) flexibility and scalability, 3) stability and reliability, and 4) a wide range of application scenarios. Through community technical support and sharing, Apache provides flexible modular design and configuration options, ensuring its adaptability and stability under a variety of needs, and is widely used in different scenarios from personal blogs to large corporate websites.

Apache's Legacy: What Made It Famous?Apache's Legacy: What Made It Famous?Apr 15, 2025 am 12:19 AM

Apachebecamefamousduetoitsopen-sourcenature,modulardesign,andstrongcommunitysupport.1)Itsopen-sourcemodelandpermissiveApacheLicenseencouragedwidespreadadoption.2)Themodulararchitectureallowedforextensivecustomizationandadaptability.3)Avibrantcommunit

See all articles

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

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor