Linux上安装Apache服务器
http://httpd.apache.org/download.cgi
#创建httpd用户
groupadd httpd
useradd -g httpd -s /sbin/nologin -M httpd tar zxvf httpd-2.4..tar.gz
cd httpd-2.4.
./configure --prefix =/usr/local/apache
make && make install
编译apache时可能会出错:
#./configure --prefix……检查编辑环境时出现:
checking for APR... no
configure: error: APR not found . Please read the documentation
解决办法:
安装 apr apr-util pcre
https://apr.apache.org/download.cgi
./configure --prefix=/usr/local/apr
make && make install
./configure --prefix=/usr/local/apr-util -with-apr=/usr/local/apr/bin/apr-1-config
make && make install
编译apr-util时报错:make[1]: *** [xml/apr_xml.lo] Error 1
解决方法:yum -y install expat-devel
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
pcre-8.38.zip
./configure --prefix=/usr/local/pcre
make && make install
然后安装Apache:
./configure --prefix=/usr/local/apache/ --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre/ make && make install /usr/local/apr-util/lib/libaprutil-.so: undefined reference to `XML_ParserCreate'
/usr/local/apr-util/lib/libaprutil-.so: undefined reference to `XML_GetErrorCode'
/usr/local/apr-util/lib/libaprutil-.so: undefined reference to `XML_SetUserData'
/usr/local/apr-util/lib/libaprutil-.so: undefined reference to `XML_ErrorString'
/usr/local/apr-util/lib/libaprutil-.so: undefined reference to `XML_SetEntityDeclHandler'
/usr/local/apr-util/lib/libaprutil-.so: undefined reference to `XML_ParserFree'
/usr/local/apr-util/lib/libaprutil-.so: undefined reference to `XML_SetElementHandler'
/usr/local/apr-util/lib/libaprutil-.so: undefined reference to `XML_StopParser'
/usr/local/apr-util/lib/libaprutil-.so: undefined reference to `XML_Parse'
/usr/local/apr-util/lib/libaprutil-.so: undefined reference to `XML_SetCharacterDataHandler'
collect2: ld returned exit status
make[]: *** [htpasswd] Error
make[]: Leaving directory `/root/zhouw/package/httpd-2.4./support'
make[]: *** [all-recursive] Error
make[]: Leaving directory `/root/zhouw/package/httpd-2.4./support'
make: *** [all-recursive] Error
make 时上面报错,尝试用 apr-1.5.2 版本
下载地址: http://archive.apache.org/dist/apr/
wget http://archive.apache.org/dist/apr/apr-1.5.2.tar.gz
wget http://archive.apache.org/dist/apr/apr-util-1.5.2.tar.gz
安装方法与上面 1.6版本一样,果然成功了。应该是 CentOS7 才支持 apr-1.6 版本。
安装完成后,切到安装目录,/usr/local/apache
# vim conf/httpd.conf #配置“Listen”和“ServerName”属性;
Listen 80
ServerName localhost
# ./bin/apachectl configtest
Syntax OK
# 启动httpd
/usr/local/apache/bin/apachectl start | stop | restart
或者:
cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
/etc/init.d/httpd start
Linux上安装Apache服务器的更多相关文章
- 【转】如何在win10(64位系统)上安装apache服务器
如何在win10(64位系统)上安装apache服务器 今天装了Apache服务器,下面是我总结的方法: 一,准备软件 1.64位的apache版本 传送门:http://www.apacheloun ...
- [运维] 如何在 Linux 上安装 Nginx 服务器(一)
原因 因为小程序对素材的大小是由要求的, 所以为了简化小程序上的内存要求, 在Linux上安装nginx来作为静态资源服务器, 这篇为第一篇, 主要介绍怎么在Linux上安装nginx, 下一篇将会介 ...
- 如何在win10(64位系统)上安装apache服务器
今天装了Apache服务器,下面是我总结的方法: 一,准备软件 1.64位的apache版本 传送门:http://www.apachelounge.com/download/ 2.VC11运行库 下 ...
- linux上安装apache
1 安装aprtar -zxvf apr-1.4.2.tar.gz cd apr-1.4.2.tar.gz ./configure --prefix=/usr/local/aprmake & ...
- linux上安装apache以及httpd.conf基本配置
1.yum安装apache #yum install httpd -y 2.随系统自启动 #chkconfig httpd on 3.开启apache #service httpd start PS: ...
- [转]CentOS6 Linux上安装ss5服务器
本文章转自:http://blog.csdn.net/cuiyifang/article/details/10346239 最后我增加了添加防火墙规则的部分.感谢作者. ss5是常见的socks5 p ...
- linux 上安装apache 出现 configure: error: APR not found. Please read the documentation错误
今日编译apache时出错: #./configure --prefix……检查编辑环境时出现: checking for APR... noconfigure: error: APR not fou ...
- 在Linux系统上查看Apache服务器的错误日志
错误日志和访问日志文件为系统管理员提供了有用的信息,比如,为 Web 服务器排障,保护系统不受各种各样的恶意活动侵犯,或者只是进行各种各样的分析以监控 HTTP 服务器.根据你 Web 服务器配置的不 ...
- 在Linux上用Apache搭建Git服务器
在Linux上用Apache搭建Git服务器 最近在学Linux,终于在Linux上用Apache搭建起了Git服务器,在此记录一下. 服务器:阿里云服务器 Linux版本:CentOS 6.5 ...
随机推荐
- Java for LeetCode 091 Decode Ways
A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' - ...
- NodeJs如何全局统一处理异常,实现RestFull风格
当在controller中处理客户端发来的数据时,我们会去校验数据,当数据错误时,我们会给客户端返回一个信息,如: export function add (req, res, next) { con ...
- i=i+2 与i+=2
i=i+2 比 i+=2多了一次对变量 i 的运算.后者效率高
- 创建一个HTML5与JQuery结合的幻灯片
1. [代码][JavaScript]代码 $(window).load(function(){ //我们监听了 window.load 事件,因此我们确定幻灯片上的所有图片都能够正确进行加载. ...
- SGU 495 Kids and Prizes:期望dp / 概率dp / 推公式
题目链接:http://acm.sgu.ru/problem.php?contest=0&problem=495 题意: 有n个礼物盒,m个人. 最开始每个礼物盒中都有一个礼物. m个人依次随 ...
- python学习笔记:第五天( 列表、元组)
Python3 列表 序列是Python中最基本的数据结构.序列中的每个元素都分配一个数字 - 它的位置,或索引,第一个索引是0,第二个索引是1,依此类推. Python有6个序列的内置类型,但最常见 ...
- 「洛谷 P1801」黑匣子
好像很久没有更过博客了,因为博主这几周很忙.其实是在搞颓. 题意很难懂,所以就不重复了.其实是懒. 一眼看上去这是个 \(Splay\) 裸题,直接插入一个数,查询区间第 \(K\) 大,但是这样太不 ...
- [原创]java操作word生成水印
应用场景 为了保护版权或辨别文件的真伪,有时需要在生成的Word文件中动态添加水印,PageOffice组件的WaterMark类就封装了给在线编辑的Word文件添加水印这一功能,调用接口非常简单. ...
- 【HDU 3487】Play with Chain Splay
题意 给定$n$个数序列,每次两个操作,将区间$[L,R]$拼接到去掉区间后的第$c$个数后,或者翻转$[L,R]$ Splay区间操作模板,对于区间提取操作,将$L-1$ Splay到根,再将$R+ ...
- ES6 generator 基础
参考文档 harmony:generators Generator是ES6的新特性,通过yield关键字,可以让函数的执行流挂起,那么便为改变执行流程提供了可能. 创建Generator functi ...