Linux(centos)下安装Apache
2015-08-07 14:49
519 查看
1,安装 apr
下载地址:http://apr.apache.org/download.cgi
[root@ubuntu:/work/soft/apache]#
tar -xzvf apr-1.5.2.tar.gz
[root@@ubuntu:/work/soft/apache/apr-1.5.2]#
./configure --prefix=/work/installed/apr
[root@@ubuntu:/work/soft/apache/apr-1.5.2]#
make
[root@@ubuntu:/work/soft/apache/apr-1.5.2]#
make install
[b]2,安装 apr-util
下载地址:http://apr.apache.org/download.cgi
[root@ubuntu:/work/soft/apache]# tar
-xzvf apr-util-1.5.4.tar.gz
[/b]
[root@@ubuntu:/work/soft/apache/apr-util-1.5.4]#
./configure --prefix=/work/installed/apr-util --with-apr=/work/installed/apr
[root@@ubuntu:/work/soft/apache/apr-util-1.5.4]#
make
[root@@ubuntu:/work/soft/apache/apr-util-1.5.4]#
make install
3,安装 pcre
下载地址:http://pcre.org/
[root@ubuntu:/work/soft/apache]# tar
jxvf pcre-8.36.tar.bz2
[root@@ubuntu:/work/soft/apache/pcre-8.36]#
./configure --prefix=/work/installed/pcre
[root@@ubuntu:/work/soft/apache/pcre-8.36]#
make
[root@@ubuntu:/work/soft/apache/pcre-8.36]#
make install
注意:如果在安装 pcre 时,遇到问题:configure: error: You need a C++ compiler for C++ support.
解决方法:yum
install build-essential
二,安装apache
下载地址:http://httpd.apache.org/
[root@ubuntu:/work/soft/apache]#tar
-xzvf httpd-2.4.16.tar.gz
[root@@ubuntu:/work/soft/apache/httpd-2.4.9]# ./configure --prefix=/work/installed/apache --with-apr=/work/installed/apr --with-apr-util=/work/installed/apr-util --with-pcre=/work/installed/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
下载地址:http://apr.apache.org/download.cgi
[root@ubuntu:/work/soft/apache]#
tar -xzvf apr-1.5.2.tar.gz
[root@@ubuntu:/work/soft/apache/apr-1.5.2]#
./configure --prefix=/work/installed/apr
[root@@ubuntu:/work/soft/apache/apr-1.5.2]#
make
[root@@ubuntu:/work/soft/apache/apr-1.5.2]#
make install
[b]2,安装 apr-util
下载地址:http://apr.apache.org/download.cgi
[root@ubuntu:/work/soft/apache]# tar
-xzvf apr-util-1.5.4.tar.gz
[/b]
[root@@ubuntu:/work/soft/apache/apr-util-1.5.4]#
./configure --prefix=/work/installed/apr-util --with-apr=/work/installed/apr
[root@@ubuntu:/work/soft/apache/apr-util-1.5.4]#
make
[root@@ubuntu:/work/soft/apache/apr-util-1.5.4]#
make install
3,安装 pcre
下载地址:http://pcre.org/
[root@ubuntu:/work/soft/apache]# tar
jxvf pcre-8.36.tar.bz2
[root@@ubuntu:/work/soft/apache/pcre-8.36]#
./configure --prefix=/work/installed/pcre
[root@@ubuntu:/work/soft/apache/pcre-8.36]#
make
[root@@ubuntu:/work/soft/apache/pcre-8.36]#
make install
注意:如果在安装 pcre 时,遇到问题:configure: error: You need a C++ compiler for C++ support.
解决方法:yum
install build-essential
二,安装apache
下载地址:http://httpd.apache.org/
[root@ubuntu:/work/soft/apache]#tar
-xzvf httpd-2.4.16.tar.gz
[root@@ubuntu:/work/soft/apache/httpd-2.4.9]# ./configure --prefix=/work/installed/apache --with-apr=/work/installed/apr --with-apr-util=/work/installed/apr-util --with-pcre=/work/installed/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
相关文章推荐
- mac+apache+php+phpmyadmin集成php开发环境配置
- 升级win10后Apache2.2无法启动错误
- Apache安装(Linux)
- apache .htaccess文件详解和配置技巧总结
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)新的异常解决方案
- 使用Apache 的 FTP Client获取FTP服务器上的文件列表FTP response 421 received.Server closed connection问题的解决
- Mac下配置Apache服务
- Mac下使用Apache服务
- Mac 中配置Apache
- apache工作模式:prefork和worker
- centos6.5 kickstart +pxe+apache+dhcp+tftp+xinetd
- apache wicket 7.X之HelloWorld
- Ubuntu Server 14.04 & Apache2.4 虚拟主机、模块重写、隐藏入口文件配置
- win7(64位)php5.5-Apache2.4-环境安装
- Apache commons-pool对象池原理分析
- Apache commons-pool对象池原理分析
- 虚拟主机三种实现方式Apache
- [转]WIN7系统安装Apache 提示msvcr110.DLL
- Ubuntu Server 重启 Apache Mysql
- CentOS 6.3下源码安装LAMP(Linux+Apache+Mysql+Php)环境