Apache installation notes on Linux
Apachei downloaded httpd-2.2.22.tar.bz2 in the source code format. Linux is 64-bit. Check the next version and use CAT/etc/issue to display Red Hat Enterprise linuxserver release 5.4 (tikanga )..
Decompress Bzip2-D *. bz2. The original bz2 file in the main directory disappears and becomes a tar file ......
Then, run tar-xzvf *. Tar to decompress the file, indicating that the file is not in ZIP format .. Dizzy .. Check the parameter and find this suspicious.-Z: does it have the gzip attribute at the same time? That is, do I need to use gzip for compression? I think it may not be in the ZIP format, but use-Z to use gzip to open err. So remove-Z ..
Tar-xvf *. Tar, succeeded, the tar file in the main directory is not seen, a folder httpd-2.2.22
The following three commands are used to query and install apceh on the Internet:
./Configure -- prefix =/usr/local/apache2 -- enable-module = so
Make
Make install
Input./Configure XXXX,The system prompts that the C compiler, K, must be installed with GCC ..
The GCC source code version is 70 m, but it cannot be compiled. It seems that the rpm version is better.
The rpm version of GCC, together with the four RPM dependencies, is not large, that is, about 13 m ......
Run rpm-IGCC. rpm, and the system prompts that many databases cannot be found, depending on a lot of resources ,......
Use Yum to install GCC ...... Fortunately, yum is still running. Run yuminstall GCC, but the system prompts that the package cannot be found ......
Ah, check it. For online installation, you need to set the source and repository URLs. For local installation, you need to set the gcc rpm to full ......
Check the configuration file/etc/yum. Repos. d/create_yum_repo_yourself.repo. It is empty and cannot be installed ......
Baidu to Yum source ...... It is an HTTP address or provided by Sohu. Dizzy, when did Sohu participate in the open source movement. Strange ...... Write those in XML format to create_yum_repo_yourself.repo ..
Next, yuminstall GCC. This time, we are prompted to download and update nine things. 32 m, en is good ...... When prompted whether to download, I wrote a Y ..
A key error occurs ...... Open the file, set gpgcheck to 0, and do not check the key. Now, the GCC is installed.
Suddenly, When I downloaded the gcc rpm manually, I did not pay attention to choosing 64-bit. I don't know if it will affect the GCC rpm, but it won't succeed .......
Then, I./Configure xxxx, FinallyOK.
ThenMake,Why can't I find it?MakeCommand. I remember it was an internal command. Why can't I find it?BinThe directory does not exist. Check the Internet and say you want to install it ...... Ah, this is also a tool.
Rpm-Qa | grep make to check whether make is installed.
No ......
Yum install make, install OK ......
Make again, success ......
Then make install and OK.
Yeah. Two or three hours later, I finally installed Apache.
StartApceh,
/Usr/local/apache2/bin/apachectlstart
Change home page,/usr/local/apache2/htdocs/index.html
Test http: // ip,
Yeha. OK ..
Then set upApacheAuto Start--
Create a file,/Etc/rc. d/init. d/apached,Set to Executable
Write Startup Script:
/Usr/local/apache2/bin/apachectl start