linux 下 Apache 安装
2016-02-19 00:53
351 查看
一,准备
1,安装
apr
下载地址:http://apr.apache.org/download.cgi
[root@ubuntu:/work/soft/apache]# tar jxvf apr-1.5.0.tar.bz2
[root@@ubuntu:/work/soft/apache/apr-1.5.0]# ./configure --prefix=/usr/local/apr
[root@@ubuntu:/work/soft/apache/apr-1.5.0]# make
[root@@ubuntu:/work/soft/apache/apr-1.5.0]# make install
2,安装
apr-util
下载地址:http://apr.apache.org/download.cgi
[root@ubuntu:/work/soft/apache]# tar
jxvf apr-util-1.5.3.tar.bz2
[root@@ubuntu:/work/soft/apache/apr-util-1.5.3]# ./configure --prefix=/usr/local/apr-util
--with-apr=/usr/local/apr
[root@@ubuntu:/work/soft/apache/apr-util-1.5.3]# make
[root@@ubuntu:/work/soft/apache/apr-util-1.5.3]# make install
3,安装
pcre
下载地址:http://pcre.org/
[root@ubuntu:/work/soft/apache]# tar
jxvf pcre-8.35.tar.bz2
[root@@ubuntu:/work/soft/apache/pcre-8.35]# ./configure --prefix=/usr/local/pcre
[root@@ubuntu:/work/soft/apache/pcre-8.35]# make
[root@@ubuntu:/work/soft/apache/pcre-8.35]# make install
注意:如果在安装
pcre 时,遇到问题:configure: error: You need a C++ compiler for C++ support.
解决方法:sudo
apt-get
install build-essential
二,安装apache
下载地址:http://httpd.apache.org/
[root@ubuntu:/work/soft/apache]# tar
jxvf httpd-2.4.9.tar.bz2
[root@@ubuntu:/work/soft/apache/httpd-2.4.9]# ./configure --prefix=/usr/local/apache2
--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre
[root@@ubuntu:/work/soft/apache/httpd-2.4.9]# make
[root@@ubuntu:/work/soft/apache/httpd-2.4.9]# make install
三,配置
1,修改配置文件
否则会出现问题:
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
解决方法:
[root@ubuntu:/work/installed/apache]# sudo
gedit conf/httpd.conf
把:
# ServerName
www.example.com:80
改为:
ServerName
localhost:80
2,启动
[root@ubuntu:/work/installed/apache]# ./bin/apachectl
start
3,开机启动
打开文件:/etc/rc.local
添加:/work/installed/apache/bin/apachectl
start
四,参考文件
1,http://blog.csdn.net/chenxiaohua/article/details/2047757
2,http://blog.163.com/hlz_2599/blog/static/142378474201182811611382/
1,安装
apr
下载地址:http://apr.apache.org/download.cgi
[root@ubuntu:/work/soft/apache]# tar jxvf apr-1.5.0.tar.bz2
[root@@ubuntu:/work/soft/apache/apr-1.5.0]# ./configure --prefix=/usr/local/apr
[root@@ubuntu:/work/soft/apache/apr-1.5.0]# make
[root@@ubuntu:/work/soft/apache/apr-1.5.0]# make install
2,安装
apr-util
下载地址:http://apr.apache.org/download.cgi
[root@ubuntu:/work/soft/apache]# tar
jxvf apr-util-1.5.3.tar.bz2
[root@@ubuntu:/work/soft/apache/apr-util-1.5.3]# ./configure --prefix=/usr/local/apr-util
--with-apr=/usr/local/apr
[root@@ubuntu:/work/soft/apache/apr-util-1.5.3]# make
[root@@ubuntu:/work/soft/apache/apr-util-1.5.3]# make install
3,安装
pcre
下载地址:http://pcre.org/
[root@ubuntu:/work/soft/apache]# tar
jxvf pcre-8.35.tar.bz2
[root@@ubuntu:/work/soft/apache/pcre-8.35]# ./configure --prefix=/usr/local/pcre
[root@@ubuntu:/work/soft/apache/pcre-8.35]# make
[root@@ubuntu:/work/soft/apache/pcre-8.35]# make install
注意:如果在安装
pcre 时,遇到问题:configure: error: You need a C++ compiler for C++ support.
解决方法:sudo
apt-get
install build-essential
二,安装apache
下载地址:http://httpd.apache.org/
[root@ubuntu:/work/soft/apache]# tar
jxvf httpd-2.4.9.tar.bz2
[root@@ubuntu:/work/soft/apache/httpd-2.4.9]# ./configure --prefix=/usr/local/apache2
--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre
[root@@ubuntu:/work/soft/apache/httpd-2.4.9]# make
[root@@ubuntu:/work/soft/apache/httpd-2.4.9]# make install
三,配置
1,修改配置文件
否则会出现问题:
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
解决方法:
[root@ubuntu:/work/installed/apache]# sudo
gedit conf/httpd.conf
把:
# ServerName
www.example.com:80
改为:
ServerName
localhost:80
2,启动
[root@ubuntu:/work/installed/apache]# ./bin/apachectl
start
3,开机启动
打开文件:/etc/rc.local
添加:/work/installed/apache/bin/apachectl
start
四,参考文件
1,http://blog.csdn.net/chenxiaohua/article/details/2047757
2,http://blog.163.com/hlz_2599/blog/static/142378474201182811611382/
相关文章推荐
- 解决ubuntu中apache2的url大小写敏感问题。
- 基于Linux安装Apache环境搭建过程及报错解决方案
- 《PHPMySQL和Apache编程导学》
- Apache-Maven学习(转)
- Apache Rewrite的主要功能
- linux下安装apache+php详解
- Apache 2.4. 源码编译安装详解
- java.lang.ClassNotFoundException: org.apache.xmlbeans.XmlOptions
- linux上apache并发数与服务器内存关系计算!
- CentOS下Apache虚拟主机VirtualHost配置
- 使用Apache JMeter压测Thrift
- Apache的DBUtils框架学习
- apache root权限的获取
- Apache遇到的问题:APR not found
- CentOS安装apache,MysqL,PHP
- apache日志
- org.apache.jasper.jasperException
- apache 配置 中英
- apache.commons.logging.Log
- Apache 编译 --with-apr parameter is incorrect 错误