Possible Errors During Apache installation and configuration in Centos
Httpd: unrecognized service
// Install apache as the system service cp/usr/local/apache2/bin/apachectl/etc/rc. d/init. d/httpd // then vi/etc/rc. d/init. d/httpd add (#! /Bin/sh) chkconfig: 2345 50 90 description: Activates/Deactivates Apache Web Server // Finally, run chkconfig to add Apache to the startup Service Group of the system: chkconfig -- add httpdchkconfig httpd on // then service httpd start
Httpd: cocould not reliably determine the server's fully qualified domain name
// Open httpd. conf in Notepad // remove the # ServerName localhost: 80 comment in it. // Execute httpd // and then access http: // localhost: 80 through a browser. If "It works!" is displayed on the page !" Indicates that apache has been installed and started successfully.
You don't have permission to access/on this server
It turns out that my VM directory is htdocs under the non-apache installation directory, which violates apache's default permission to access the website root. The default virtual host root directory address of apache is ../Apache Software Foundation/Apache2.2/htdocs. You need to modify the httpd. conf file to direct it to other directories. Inhttpd.conf
File to find this section:
<span style="font-size: x-small;">## Each directory to which Apache has access can be configured with respect# to which services and features are allowed and/or disabled in that# directory (and its subdirectories). ## First, we configure the "default" to be a very restrictive set of # features. #<Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Deny from all</Directory></span>
Change it
<Span style = "font-size: x-small;"> # Allow access to external directories <Directory/> Options Indexes FollowSymLinks AllowOverride None </Directory> </span>
Restart httpd.