Linux source code installation apache environment

tags: apache  linux


1. Check whether it has been installed
[root@d ~]# rpm -qa | grep httpd
system-config-httpd-1.3.3.1-1.el5
httpd-manual-2.2.3-6.el5

2. Stop and uninstall the httpd service that comes with the Linux system
[root@d ~]# service httpd stop
[root@d ~]# ps -ef | grep httpd
[root @ d ~] # kill -9 pid number (delete one by one)
[root@d ~]# rpm -e system-config-httpd-1.3.3.1-1.el5
[root@d ~]# rpm -e httpd-manual-2.2.3-6.el5
Find out if the apache configuration file exists, delete it if it exists
[root@d ~]# find / -name httpd.conf


3. Download the Apache installation package (httpd-2.4.3.tar.gz or httpd-2.2.23.tar.gz), download address: http://httpd.apache.org /
When I installed Apache, I installed it for different versions, which were different at compile time, and the parameters followed by configure were different.
httpd-2.2.23 version compilation command:
[root @ d ~] # ./configure --prefix = / usr / local / apache2 (the installation directory parameters can be directly installed without any parameters)
[root@d ~]# make
[root@d ~]# make install
httpd-2.4.3 version compilation command:
[root@d ~]# ./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre 
(In addition to specifying the Apache installation directory, also install apr, apr-util, pcre, and specify the parameters)
[root@d ~]# make
[root@d ~]# make install
The problems of apr not found, APR-util not found, pcre-config for libpcre not found occurred when compiling Apache ,
The following is a practical operation to solve these problems of httpd-2.4.3.
http://apr.apache.org/download.cgi download apr-1.4.5.tar.gz, apr-util-1.3.12.tar.gz
http://sourceforge.net/projects/pcre/files/latest/download download pcre-8.31.zip
A. Solve the apr not found problem
  [root@localhost bin]# tar -zxf apr-1.4.5.tar.gz
  [root@localhost apr-1.4.5]# ./configure --prefix=/usr/local/apr
  [root@localhost apr-1.4.5]# make
  [root@localhost apr-1.4.5]# make install
B. Solve the problem of APR-util not found
  [root@localhost bin]# tar -zxf apr-util-1.3.12.tar.gz
  [root@localhost apr-util-1.3.12]# ./configure --prefix=/usr/local/apr-util -with-apr=/usr/local/apr/bin/apr-1-config
  [root@localhost apr-util-1.3.12]# make
  [root@localhost apr-util-1.3.12]# make install
C. Solve the problem of pcre-config for libpcre not found
  [root@localhost ~]# unzip pcre-8.31.zip
  [root@localhost ~]# cd pcre-8.31
  [root@localhost pcre-8.31]# ./configure --prefix=/usr/local/pcre
  [root@localhost pcre-8.31]# make
  [root@localhost pcre-8.31]# make install


If /etc/httpd/httpd.conf already exists, please uninstall or close the web service that comes with the linux system first, execute the command: chkconfig httpd off,
Or you can change the port 80 of the httpd service that comes with Linux to another port, as long as it does not conflict with the port of the Apache service we installed.
Start Apache: / usr / local / apache2 / bin / apachectl start
Stop Apache: / usr / local / apache2 / bin / apachectl stop
Restart Apache: / usr / local / apache2 / bin / apachectl restart


The website is placed in the / usr / local / apache2 / htdocs directory
Pass http: // localhost: 80 in the browser. If you see "It works!" displayed on the page, it means that Apache has passed the verification. If the index suffix of the website is in jsp format,
Then modify the httpd.conf configuration file (/ usr / local / apache2 / conf) and add index.jsp to DirectoryIndex.
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
<IfModule dir_module>
    DirectoryIndex index.html index.php

</IfModule>



Intelligent Recommendation

Linux Red Hat source code package installation apache

1. Experimental preparation Need to install gcc in advance      yum install gcc The installation of source code generally consists of three steps: configuration, compilation, and i...

Installation and configuration of Apache in Linux environment

Installation and configuration of Apache in Linux environment 1. Open httpd.conf 2. Find the position in the figure below and add configuration information (you can use the /virtual + enter key to fin...

Installation of Apache Services in Linux Environment

Apache application scenario 1. Run static page, image. 2. Combine the PHP engine to run the PHP program. 3. Combine Tomcat, RESIN to run JSP, Java program. 4. Do a proxy, load balance Installation env...

Php and apache source code installation

groupadd www useradd -g www www groupadd mysql useradd -g mysql mysql Install apache2 Download httpd-2.4.27.tar.gz curl -O -L https://github.com/apache/httpd/archive/2.4.27.tar.gz curl -O -L https://g...

Source code Apache deployment and installation

surroundings: System environment: centos6.5_x64 Apache version: httpd-2.2.34.tar.gz Deploy and install: The requirements of this experiment environment and meet:  Check if there is httpd service in t...

More Recommendation

Apache source code compilation and installation

Preface Installation process 0x00 download the required source code apache download apr and apr-util download pcre download 0x01 compile and install apr apr-util pcre apache 0x02 test Problems encount...

Apache source code package installation

1. Install apache dependency yum -y install apr apr-devel apr-util apr-util-devel cyrus-sasl-devel expat-devel libdb-devel openldap-devel pcre-devel pcre apr package: Apache portable runtime library, ...

Install Apache in Linux Source Code

2019 Unicorn Enterprise Heavy Glour Recruitment Python Engineer Standard >>> 1 download Apache installation package wget http://apache.fayea.com/apache-mirror/httpd/httpd-2.2.25.tar.gz 2...

Installation management program under Linux environment-source code compilation and installation

Requirements: Compile and install the apache software, modify the bound domain name to www.qqq.com after the installation is successful, start the service, check whether the service is started normall...

nginx-linux environment installation-source code compilation method installation

nginx-linux environment installation. There are many ways, the author starts with the most cumbersome introduction. This method is for referencenginx Chinese Network Installation by source code compil...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top