How apache is installed in linux

Source: Internet
Author: User
The tangle of installing apache in linux is that installing apache in linux is a very simple process. Three commands can be done, jxvf decompression, make compilation, makeinstall installation is OK. I did not expect that this process is still quite costly. It may be related to the environment. Let's talk about my environment first. -...
The tangle of installing apache in linux is that installing apache in linux is a very simple process. Three commands can be done, jxvf decompression, make compilation, make install installation is OK. I did not expect that this process is still quite costly. It may be related to the environment. Let's talk about my environment first. --------------------------- Linux: cenos5.5 (verification 4.8 will also encounter the following problems) apache: httpd-2.4.1.tar.bz2 www.2cto.com ------------------------- [root @ localhost apache] # tar jxvf httpd-2.4.1.tar.bz2 // Unzip apache compressed package [root @ localhost apache] # cd httpd-2.4.1 // locate under the httpd-2.4.1 folder [root @ localhost httpd-2.4.1] # ls // view the contents under the display httpd-2.4.1 folder [root @ localhost httpd-2.4.1] #. /configure -- help | more // view the installation apache configuration parameters [root @ localhost httpd-2.4.1] #. /configure -- prefix =/usr/local/apache -- enable-so // configure the apache path, followed by the -- enable-so parameter to let the apache core load DSO [root @ localhost httpd-2.4.1] # make // compile apache
Error! Tip: configure: error: APR not found. Please read the documentation on the apache official website can be downloaded to the apr-1.4.6.tar.gz to solve the apr not found problem >>> APR and APR-UTIL: http://apr.apache.org/download.cgi [Root @ localhost apache] # tar-zxf apr-1.4.6.tar.gz [root @ localhost apache] # cd apr-1.4.6 [root @ localhost apr-1.4.6] #. /configure -- prefix =/usr/local/apr [root @ localhost apr-1.4.6] # make [root @ localhost apr-1.4.6] # make install www.2cto.com after installation is complete, compile apache [root @ localhost httpd-2.4.1] # make again error! Tip: configure: error: APR-util not found. Please read the documentation! Or the above apache official website address and then download the apr-util-1.4.1.tar.gz to solve the APR-util not found problem >>>> [root @ localhost apache] # tar-zxf apr-util-1.4.1.tar.gz [root @ localhost apache] # cd apr-util-1.4.1 [root @ localhost apr-util-1.4.1] #. /configure -- prefix =/usr/local/apr-util -- with-apr =/usr/local/apr/bin/apr-1-config [root @ localhost apr-util-1.4.1] # make [root @ localhost apr-util-1.4.1] # make install and then compile apache, an error occurred again! Tip: configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/ , I X! The associations between linux installation software can sometimes crash... /Configure still prompts APR-util not found, add -- with-apr =/usr/local/apr -- with-apr-util =/usr/local/apr-util, and then choose >>> [root @ localhost apache] #. /configure-help | grep pcre -- with-pcre = PATH Use external PCRE library: http://ftp.exim.llorien.org/pcre/
Download pcre-8.30.zip with a large number of list files. Generally, the browser has a search function. you can press ctrl + f to search and locate the file and download it. [Root @ localhost apache] # unzip-o pcre-8.30.zip [root @ localhost apache] # cd pcre-8.30 [root @ localhost pcre-8.30] #. /configure -- prefix =/usr/local/pcre [root @ localhost pcre-8.30] # make [root @ localhost pcre-8.30] # make install compile Apache www.2cto.com [root @ yahoo httpd-2.3.12-beta] #. /configure -- prefix =/usr/local/apache2 -- with-apr =/usr/local/apr -- with-apr-util =/usr/local/apr-util/note, the following parameters must be installed with apr and apr- The util path is consistent. [Root @ localhost httpd-2.4.1] # make [root @ localhost httpd-2.4.1] # make install this compilation installation should no longer report any errors. Haha !! Start apache [root @ localhost bin] # pwd/usr/local/apache/bin [root @ localhost bin] # apachectl stop [root @ localhost bin] # apachectl start check 80 whether the port is occupied [root @ localhost conf] # netstat-an | grep: 80 check if the apache startup service starts [root @ localhost bin] # ps-aux | grep httpdWarning: bad syntax, perhaps a bogu '-'? See/usr/share/doc/procps-3.2.7/FAQroot 2866 0.0 1.2 25164 9556? Ss/usr/sbin/httpd-k startapache 2867 0.0 0.7 25300 5556? S/usr/sbin/httpd-k startapache 2868 0.0 0.6 25300 5444? S/usr/sbin/httpd-k startapache 2869 0.0 0.6 25300 5444? S/usr/sbin/httpd-k startapache 2870 0.0 0.7 25300 5556? S/usr/sbin/httpd-k startapache 2871 0.0 0.6 25164 4796? S/usr/sbin/httpd-k startapache 2872 0.0 0.6 25164 4796? S/usr/sbin/httpd-k startapache 2873 0.0 0.6 25164 4796? S/usr/sbin/httpd-k startapache 2874 0.0 0.6 25164 4796? S: 00/usr/sbin/httpd-k startroot 3141 0.0 0.0 4244 676 pts/1 R +: 00: 00 grep: httpd check whether the apache community page can be opened. http://ip:80/index.html An error is prompted: www.2cto.com

Is the port occupied? Modify the apache configuration file/usr/local/apache/conf/httpd. conf configuration file [root @ localhost conf] vi httpd. find the following line in the conf file: Change Listen 80 to another port, for example, 8080 or 8800. Find the following line: change ServerName www.example.com: 80 to the ip address of the local machine and add the port number, for example, change 192.168.0.105: Port 80 to correct it. the error is always reported. Since I have no experience installing apache in linux, I want to find out which page apache runs by default. So I found the file.../apache/htdocs/index.html (misled by tomcat )! Otherwise, the file You don't have permission to access/index.html on this server in the/var/www/html directory is actually running. Because I have insufficient file permissions. Add a permission to the file! Create a file index.html in/var/www/html [root @ localhost html] # chmod 766 index.html OK! Apache is available. the page is opened normally! The process is tangled and the ending is wonderful! Www.2cto.com ----------- summary --------------
Files to be installed: apr-1.4.6apr-util-1.4.1.tar.bz2pcre-8.30.zip/usr/local/apache installation directory/usr/local/apache/conf/httpd. conf configuration file/usr/local/apache/bin/apachectl stop/start program/var/www/html/create accessible pages in this folder
 
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.