Home > Article > Operation and Maintenance > What is the default installation path of apache in linux system
If you use RPM package to install, the installation path should be in the /etc/httpd directory.
(Recommended learning tutorial: apache)
apache configuration file: /etc/httpd/conf/httpd.conf You can modify the relevant access paths and configurations
Apache module path:/usr/sbin/apachectl startup module
Web directory:/var/www/html Project storage path
If you use source code installation, it is generally installed by default in /usr/local/apache2 directory.
If you get an error message when starting apache, you need to check whether the port is occupied, because by default apache starts on port 80. For example, the default page of nginx opens port 80.
The error message is as follows:
[root@localhost ~]# service httpd restart Redirecting to /bin/systemctl restart httpd.service Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details. [root@localhost ~]# service httpd status Redirecting to /bin/systemctl status httpd.service ● httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled) Active: failed (Result: exit-code) since 三 2018-12-05 14:42:42 CST; 11s ago Docs: man:httpd(8) man:apachectl(8) Process: 3640 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE) Process: 3639 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE) Main PID: 3639 (code=exited, status=1/FAILURE) 12月 05 14:42:42 localhost.localdomain httpd[3639]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80 12月 05 14:42:42 localhost.localdomain httpd[3639]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80 12月 05 14:42:42 localhost.localdomain httpd[3639]: no listening sockets available, shutting down 12月 05 14:42:42 localhost.localdomain httpd[3639]: AH00015: Unable to open logs 12月 05 14:42:42 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE 12月 05 14:42:42 localhost.localdomain kill[3640]: kill: cannot find process "" 12月 05 14:42:42 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1 12月 05 14:42:42 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server. 12月 05 14:42:42 localhost.localdomain systemd[1]: Unit httpd.service entered failed state. 12月 05 14:42:42 localhost.localdomain systemd[1]: httpd.service failed. [root@localhost ~]#
You can see the Address already in use error and modify the apache port.
Edit /etc/httpd/conf/httpd.conf
Just restart again.
The above is the detailed content of What is the default installation path of apache in linux system. For more information, please follow other related articles on the PHP Chinese website!