redhat6.5+Aapache httpd 2.4.12 安装

个人实战经验:redhat6.5+Aapache httpd 2.4.12 安装

以下是个人过程记录,还忘指教

redhat机子apache安装日志
准备工作
下载 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     #说明,如果用户不具有root权限,必须手动安装这两个插件
将压缩文件放在http-2.4.12的srclib目录下 解压
  $ 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                      #这里需要注意,如果没有root权限,普通用户是不具有80端口的访问权限的,因此需要修改为其他端口,普通用户才能启动自己安装的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 配置
$ vi tomcat_x/conf/server.conf
#配置关闭端口
<Server port="8006" shutdown="SHUTDOWN">

#配置访问端口
<Connector port="8081" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
#配置AJP端口
<Connector port="8010" protocol="AJP/1.3" redirectPort="8443" />
#配置jvm
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm8080">

6、Start restart stop httpd service
$cd /home/wmj/soft/apache2/bin
#启动apache
$./apachectl start
#重启apache
$./apachectl restart
#停止apache
$./apachectl stop


遇到以下错误

[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.

一般是因为ServerName localhost:8090的配置
另外一个原因是系统默认安装了httpd 我是卸载默认安装的服务后正常的

你可能感兴趣的:(apache httpd,redhat6.5)