Home >Operation and Maintenance >Apache >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
[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 start
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 755The custom path is configured as above:/home/autotest/workspace/auto-project/test-output/htmlUse 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:
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!