Because it was not installed last time, centos was uninstalled and re-installed this afternoon. After the system is installed, PHP and other applications are not installed first. The installation of apache started directly, but it was not successful for the first time.
Check the error message. We can see that a GCC is not installed, So we installed GCC with YUM.
Yum install gcc
And then reinstall apache!
CentOS Apache installation is still quite common, so I have studied how to install CentOS Apache. Here I will share it with you and hope it will be useful to you. CentOS is a community of Open Source Software contributors and users. The following describes how to install CentOS Apache.
1. Download: apache2.2.4
[Root @ localhost ~] # Cd/usr/local/src/
[Root @ localhost src] # wget
Http://archive.apache.org/dist/httpd/httpd-2.2.4.tar.gz
[Root @ localhost src] # chmod + x httpd-2.2.4.tar.gz
[Root @ localhost src] # tar-zxvf httpd-2.2.4.tar.gz
2. Install CentOS Apache and set compiler compilation Parameters
[Root @ localhost src] # cd httpd-2.2.4
[Root @ localhost httpd-2.2.4] #. /configure -- prefix =/usr/local/apache2 -- enable-so -- enable-rewrite = share -- enable-proxy-ajp = share -- enable-dav = share -- enable-dav-fs
# Note:
-- Prefix =/usr/local/apache2
Set the CentOS Apache installation directory. Here, it is set to be installed in/usr/local/apache2. If you want to uninstall or upgrade CentOS Apache in the future, you can directly Delete this directory.
-- Enable-so
Specify to allow DSO (dynamic sharing of images)
-- Enable-rewrite = share
Enable Rewrite to achieve URL static. We recommend that you enable this feature.
-- Enable-dav-fs
Enable WebDAV support and svn server. Appendix: What is webDAV? And how to apply it?
For other additional settings, use./configure -- help.
3. Install and compile CentOS Apache:
[Root @ localhost httpd-2.2.4] # make; make install
# If no error occurs, Apache is installed in the/usr/local/apache2 directory.
4. Start the service:
[Root @ localhost httpd-2.2.4] #/usr/local/apache2/bin/apachectl start
5. Determine the startup status:
[Root @ localhost apache2] # netstat-utl
# If you see this line, your CentOS Apache has been started.
# Access It works in a browser !, It indicates that CentOS Apache is successfully installed. Congratulations!
This article is from "Thinking"