Home>Article>Operation and Maintenance> 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..
2: After the uninstallation is completed, upload all the packages required for httpd service installation
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
##Install apr-util, solve the problem of apr-util not found Install pcre and solve the problem of pcre not found 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 installFour: 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 start5: 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.confThe first part: modify the path
1 [root@zdhcs5 local]# cd /usr/local/apache2/bin 2 [root@zdhcs5 bin]# ./apachectl stop 3 [root@zdhcs5 bin]# ./apachectl startAfter 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/htmlThen go to the browser to verify whether it is successful, refresh the browser address just now: Now you have installed apache under Linux and modified the default path to a custom path. Related recommendations:
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!