Apache 编译安装

BerkeleyDB

1./dist/configure --prefix=/usr/local/BerkeleyDB --enable-dbm --enable-share 2make 3make install

安装完成后,需要将 BerkeleyDB 的动态库,写入 /etc/ld.so.conf,否则有的程序找不到 BerkeleyDB 相应的动态库

1echo "/usr/local/BerkeleyDB/lib" > /etc/ld.so.conf 2ldconfig

Apr

======

    安装 apache http server 和 apr-util,需要依赖于 apr。

1./configure --prefix=/usr/local/apr 2make 3make install

Apr-util

===========

安装 apache http server,需要依赖于 apr-util

1./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr --with-berkeley-db=/usr/local/BerkeleyDB 2make 3make install

Cronolog

apache 日志自动切割工具,可以减小 apache 日志文件大小,提高读写效率

1./configure --prefix=/usr/local/cronolog 2make 3make install

Apache HTTP Server 安装

========================

1./configure --prefix=/usr/local/apache --with-port=8080 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-shared=max --enable-deflate --disable-authn-user --enable-cache 2 --enable-file-cache  --enable-cache-disk --enable-mime-magic --enable-expires --enable-remoteip --enable-static-support --enable-static-htpasswd --enable-info 3make 4make install

Apache HTTP Server 参数设置

ff

Apache HTTP Server service 脚本

================================

将以下内容,写入脚本:/etc/init.d/httpd

1#!/bin/bash 2# 3# httpd Startup script for the Apache HTTP Server 4# 5# chkconfig: - 85 15 6# description: The Apache HTTP Server is an efficient and extensible 7#              server implementing the current HTTP standards. 8# processname: httpd 9# config: /usr/local/apache/conf/httpd.conf 10# config: /etc/sysconfig/httpd 11# pidfile: /var/run/httpd.pid 12# 13### BEGIN INIT INFO 14# Provides: httpd 15# Required-Start: $local_fs $remote_fs $network $named 16# Required-Stop: $local_fs $remote_fs $network 17# Should-Start: distcache 18# Short-Description: start and stop Apache HTTP Server 19# Description: The Apache HTTP Server is an extensible server 20#  implementing the current HTTP standards. 21### END INIT INFO 22 23# Source function library. 24. /etc/rc.d/init.d/functions 25 26if [ -/etc/sysconfig/httpd ]; then 27    . /etc/sysconfig/httpd 28fi 29 30# Start httpd in the C locale by default. 31HTTPD_LANG=${HTTPD_LANG-"C"} 32 33# This will prevent initlog from swallowing up a pass-phrase prompt if 34# mod_ssl needs a pass-phrase from the user. 35INITLOG_ARGS="" 36 37Set HTTPD=/usr/sbin/httpd.worker in /etc/sysconfig/httpd to use a server 38with the thread-based "worker" MPM; BE WARNED that some modules may not 39# work correctly with a thread-based MPM; notably PHP will refuse to start. 40 41# Path to the apachectl script, server binary, and short-form for messages. 42APACHE_HOME=/usr/local/apache 43apachectl=${APACHE_HOME}"/bin/apachectl" 44httpd=${HTTPD-${APACHE_HOME}"/bin/httpd"} 45PROG=httpd 46pidfile=${PIDFILE-/var/run/httpd.pid} 47lockfile=${LOCKFILE-/var/lock/subsys/httpd} 48 49STOP_TIMEOUT=${STOP_TIMEOUT-10} 50RETVAL=0 51 52# The semantics of these two functions differ from the way apachectl does 53# things -- attempting to start while running is a failure, and shutdown 54# when not running is also a failure.  So we just do it the way init scripts 55# are expected to behave here. 56start() { 57    echo -n $"Starting $PROG: " 58    LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd $OPTIONS 59    RETVAL=$? 60    echo 61    [ $RETVAL = 0 ] && touch ${lockfile} 62    return $RETVAL 63} 64 65reload() { 66    echo -n $"Reloading $PROG: " 67    if ! LANG=$HTTPD_LANG $httpd $OPTIONS ->&/dev/null; then 68        RETVAL=6 69        echo $"not reloading due to configuration syntax error" 70        failure $"not reloading $httpd due to configuration syntax error" 71    else 72        # Force LSB behaviour from killproc 73        LSB=1 killproc -p ${pidfile} $httpd -HUP 74        RETVAL=$? 75        if [ $RETVAL -eq 7 ]; then 76            failure $"httpd shutdown" 77        fi 78    fi 79    echo 80} 81 82# When stopping httpd, a delay (of default 10 second) is required 83# before SIGKILLing the httpd parent; this gives enough time for the 84# httpd parent to SIGKILL any errant children. 85stop() { 86    echo -n $"Stopping $PROG: " 87    killproc -p ${pidfile} -d ${STOP_TIMEOUT} $httpd 88    RETVAL=$? 89    echo 90    [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile} 91} 92 93case "$1" in 94  start) 95    start 96    ;; 97  force-reload|reload) 98    reload 99    ;; 100  restart) 101    stop 102    start 103    ;; 104  stop) 105    stop 106    ;; 107  status) 108    status -p ${pidfile} $httpd 109    RETVAL=$? 110    ;; 111  condrestart|try-restart) 112    if status -p ${pidfile} $httpd > &/dev/null; then 113        stop 114        start 115    fi 116    ;; 117  graceful|help|configtest|fullstatus) 118    $apachectl $@ 119    RETVAL=$? 120    ;; 121  *) 122    echo $"Usage: $PROG {start|stop|restart|condrestart|try-restart|force-reload|reload|status|fullstatus|graceful|configtest|help}" 123    RETVAL=2 124esac 125 126exit $RETVAL

chmod +x /etc/init.d/httpd

Apache HTTP Server 开机自启动

===========================

1chkconfig --add httpd 2chkconfig --level 235 httpd on
点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

皕杰报表之UUID

​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

2020年前端实用代码段,为你的工作保驾护航

有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )