Redhat6.5+Aapache httpd 2.4.12 installation

Personal combat experience: redhat6.5+Aapache httpd 2.4.12 installation

The following is a personal process record, but also forgot to advise

the redhat machine apache installation log
Preparations
Download httpd-2.4.12.tar.gz httpd-2.4.12-deps.tar. gz pcre-8.35.zip

1. Install pcre
     $ ./configure --prefix=/home/bonc/apache2/pcre/pcre --libdir=/home/bonc/apache2/pcre/lib/pcre --includedir=/home /bonc/apache2/pcre/include/pcre
     $make && make install

2. install apr apr-util #Note, if the user does not have root privileges, these two plugins must be installed manually
Put the compressed file in the http-2.4.12 Unzip in the srclib directory
  $ tar -zxvf httpd-2.4.12.tar.gz
  $ tar -zxvf httpd-2.4.12-deps.tar.gz
  $ cd httpd-2.4.12/srclib/apr
   $ ./configure --prefix =/home/bonc/apache2/apr
   $make && make install
     
   $cd httpd-2.4.12/srclib/apr-util
   $./configure --prefix=/home/bonc/apache2/apr-util --with-apr=/home/bonc/apache2/apr
   $make && make install

3. install apache2
    $cd httpd-2.4.12
    $./configure --prefix=/home/bonc/apache2/apache --enable-so --with-apr=/home/bonc/apache2/apr --with- apr-util=/home/bonc/apache2/apr-util/bin --with-pcre=/home/bonc/apache2/pcre/pcre --enable-mods-shared=all --with-mpm=worker -- enable-cache --enable-disk-cache --enable-mem-cache --enable-file-cache
    $make && make install

4. configure apache2
    $ vi /home/bonc/apache2/apache/conf/httpd.conf
Listen 8301 #It should be noted here that if there is no root permission, ordinary users do not have access to port 80, so they need to be modified to other ports, and ordinary users can start their own installed apache

LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_module modules/mod_proxy_blancer.so
LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
LoadModule slotmem_shm_module modules/mod_slotmem_shm.so

#ServerName www.example.com:80
ServerName localhost:8090

#add proxy.conf php.conf
Include conf/extra/proxy.conf

$ vi /home/bonc/apache2/apache/conf/extra/proxy.conf
ProxyRequests Off
ProxyPreserveHost On

ProxyPass /vbap balancer://vbap stickysession=JSESSIONID nofailover=Off
ProxyPassReverse /vbap balancer://vbap
<Proxy balancer://vbap>
BalancerMember http://127.0.0.1:8080/vbap loadfactor=1 route=jvm8080
BalancerMember http://127.0.0.1:8081/vbap loadfactor=1 route =jvm8081
</Proxy>

5. Tomcat configuration
$ vi tomcat_x/conf/server.conf #Configure
shutdown port
<Server port="8006" shutdown="SHUTDOWN"> #Configure

access port
<Connector port="8081" protocol=" HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
#Configure AJP port
<Connector port="8010" protocol="AJP/1.3" redirectPort="8443" />
#Configure jvm
< Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm8080">

6. Start restart stop httpd service
$cd /home/wmj/soft/apache2/bin #Start
apache
$./apachectl start #Restart
apache
$./apachectl restart #Stop
apache
$./apachectl stop


encounter the following error

[bonc@ bonc-qh1 bin]$ apachectl start
httpd: apr_sockaddr_info_get() failed for bonc-qh1
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
(13)Permission denied: Error retrieving pid file run/httpd .pid
Remove it before continuing if it is corrupted.

Usually it is because of the configuration of ServerName localhost:8090.
Another reason is that httpd is installed by default in the system. I uninstalled the service installed by default and it was normal.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327027542&siteId=291194637