HTTPD(三)--HTTP2.4.9编译安装
生活随笔
收集整理的這篇文章主要介紹了
HTTPD(三)--HTTP2.4.9编译安装
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
httpd編譯安裝
????1.編譯安裝apr
????httpd-2.4.9需要較新版本的apr和apr-util,所以,要先安裝這兩個包,在檢查環境,要確定Development Tools、Server Platform Development、Desktop Platform Development這三個開發包組是否安裝,然后開始編譯安裝
#tar?xf?apr-1.5.0.tar.bz2 #cd?apr-1.5.0 #./configure?--prefix=/usr/local/apr #make?&&?make?install?
????2.編譯安裝apr-util
#tar?xf?apr-util-1.5.3.tar.bz2 #cd?apr-util-1.5.3 #./configure?--prefix=/usr/local/apr-util?--with-apr=/usr/local/apr #make?&&?make?install?
????3.編譯安裝httpd-2.4
#?./configure?--prefix=/usr/local/httpd?--sysconfdir=/etc/httpd --enable-so?--enable--ssl?--enable-cgi?--enable-rewrite?--wi th-zlib?--with-pcre?--with-apr=/usr/local/apr?--with- apr-util=/usr/local/apr-util?--enable-mpms-shared=all?--with -mpm=event?--enable-modules=most?
????4.編譯完成之后,加入變量,否則無法用apachectl啟動
#vim??/etc/profile.d/httpd.sh????????
?
????編輯好之后用source httpd.sh,就加入環境變量了,這就可以啟動了
????#apachetctl
????這樣80端口就監聽了
????????
?
????5.啟用man手冊
????????如果不想用絕對路徑來查看httpd的手冊信息,就要啟用HTTPD的MAN手冊,下面加一條HTTPD的MAN手冊的絕對路徑就可以。以后就可以直接用#man httpd了。
#vim?/etc/man.config????????
?
????6.配置服務啟動
#vim?/etc/rc.d/init.d/httpd????在里面添加下面命令就可了,不過要注意的是還要修改里面的路徑
#!/bin/bash # #?httpd????????Startup?script?for?the?Apache?HTTP?Server # #?chkconfig:?-?85?15 #????????HTML?files?and?CGI. #?processname:?httpd #?config:?/etc/httpd/conf/httpd.conf #if?[?-f?/etc/sysconfig/httpd?];?then #?Start?httpd?in?the?C?locale?by?default. HTTPD_LANG=${HTTPD_LANG-"C"}#?mod_ssl?needs?a?pass-phrase?from?the?user. INITLOG_ARGS="" apachectl=/usr/local/httpd/bin/apachectl httpd=${HTTPD-/usr/local/httpd/bin/httpd} prog=httpd pidfile=${PIDFILE-/usr/local/httpd/logs/httpd.pid} lockfile=${LOCKFILE-/var/lock/subsys/httpd} RETVAL=0start()?{echo?-n?$"Starting?$prog:?"LANG=$HTTPD_LANG?daemon?--pidfile=${pidfile}?$httpd?$OPTIONS[?$RETVAL?=?0?]?&&?touch?${lockfile}return?$RETVAL}stop()?{echo?-n?$"Stopping?$prog:?"killproc?-p?${pidfile}?-d?10?$httpdRETVAL=$?echo[?$RETVAL?=?0?]?&&?rm?-f?${lockfile}?${pidfile}}reload()?{echo?-n?$"Reloading?$prog:?"if?!?LANG=$HTTPD_LANG?$httpd?$OPTIONS?-t?>&/dev/null;?thenRETVAL=$?echo?$"not?reloading?due?to?configuration?syntax?error"elsekillproc?-p?${pidfile}?$httpd?-HUPRETVAL=$?fiecho}#?See?how?we?were?called.case?"$1"?instart)start;;stop)stop;;status)status?-p?${pidfile}?$httpdRETVAL=$?;;start;;condrestart)if?[?-f?${pidfile}?]?;?thenstopstartfi;;reload)reload;;graceful|help|configtest|fullstatus)$apachectl?$@RETVAL=$?;;*)echo?$"Usage:?$prog?{start|stop|restart|condrestart|reload|stattus|fullstatus|graceful|help|configtest}"exit?1esacexit?$RETVAL?????????
?
轉載于:https://blog.51cto.com/kyfish/1541396
總結
以上是生活随笔為你收集整理的HTTPD(三)--HTTP2.4.9编译安装的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 译C#使用设计模式和软件设计原则构建应用
- 下一篇: 代码命名规则