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 ...
随机推荐
- mysql优化之 EXPLAIN(一)
数据库优化最常用的命令就是用explain查看一下写的sql是否用到了索引: 如: (root@localhost) [akapp]>explain select * from sc_activ ...
- centos 7 部署 mysql 报错记录
1. Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY 这是由于yum安装了旧版本的GPG keys造成的,解决办法就是 引用 rpm --i ...
- 深入理解JVM - Java内存模型与线程 - 第十二章
Java内存模型 主内存与工作内存 Java内存模型主要目标:定义程序中各个变量的访问规则,即在虚拟机中将变量存储到内存和从内存中取出变量这样的底层细节.此处的变量(Variable)与Java编程中 ...
- BZOJ 2021 [Usaco2010 Jan]Cheese Towers:dp + 贪心
题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=2021 题意: John要建一个奶酪塔,高度最大为m. 他有n种奶酪.第i种高度为h[i]( ...
- c++迷宫小游戏
c++迷宫小游戏 一.总结 一句话总结: 显示:根据map数组输出图像 走动:修改map数组的值,每走一步重新刷新一下图像就好 1.如果走函数用z(),出现输入s会向下走多步的情况,原因是什么? 向下 ...
- kvm初体验之三:vm的安装及管理
Host: CentOS release 6.4 (Final) Guest: CentOS release 6.6 (Final) 全程以root身份操作 1. host上创建桥br0 参考< ...
- Posix线程编程指南(3)
这是一个关于Posix线程编程的专栏.作者在阐明概念的基础上,将向您详细讲述Posix线程库API.本文是第三篇将向您讲述线程同步. 一.互斥锁尽管在Posix Thread中同样可以使用IPC的信号 ...
- Nginx HTTP Server相关
一.Nginx安装: 采取手动编译安装 对多种重要的选项进行配置 安装前提:常用工具和库,GCC PCRE(Rewrite模块需要) pcre-devel(源码) zlib zlib-devel(源码 ...
- final修饰变量
final修饰基本类型变量 当使用final修饰基本类型变量时,不能对基本类型变量重新赋值,因此基本类型变量不能被改变 final修饰引用类型变量 当使用final修饰引用类型变量时,它保存的仅仅是一 ...
- C++多态的实现条件
#include <iostream> class Person{ public: virtual void say(){ std::cout<<"person&qu ...