linux下手动安装apache详解
2015-12-09 11:05
453 查看
引自:http://blog.chinaunix.net/uid-28458801-id-4211258.html
error1:出现以下错误时候,需要下载安装apr
apr下载地址:http://apr.apache.org/download.cgi
前言:
linux下,默认安装软件,在开发过程中会经常不知道到什么路径下找到所需的程序,因此手动安装程序对后续的使用会提供非常大的便利。在此,以安装apache为例。
一,准备
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=/work/installed/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=/work/installed/apr-util --with-apr=/work/installed/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=/work/installed/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=/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
3,开机启动
打开文件:/etc/rc.local
[root@ubuntu:/]# sudo gedit /etc/rc.local
添加:/work/installed/apache/bin/apachectl start
error1:出现以下错误时候,需要下载安装apr
configure: error: APR not found. Please read the documentation.
apr下载地址:http://apr.apache.org/download.cgi
前言:
linux下,默认安装软件,在开发过程中会经常不知道到什么路径下找到所需的程序,因此手动安装程序对后续的使用会提供非常大的便利。在此,以安装apache为例。
一,准备
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=/work/installed/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=/work/installed/apr-util --with-apr=/work/installed/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=/work/installed/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=/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
3,开机启动
打开文件:/etc/rc.local
[root@ubuntu:/]# sudo gedit /etc/rc.local
添加:/work/installed/apache/bin/apachectl start
相关文章推荐
- 解决“org.apache.hadoop.security.AccessControlException”
- Windows XP下 安装和配置Apache2.2.22服务器+PHP5+Mysql5
- Apache JMeter中正则表达式提取器的使用方法
- Windows下搭建php7+Apache2.4
- 看我学习Apache+php+wordpress+phpMyAdmin的搭配配置
- LAMP 2.4 Apache访问控制
- apache+weblogic虚拟主机配置
- LAMP 2.3 Apache配置防盗链
- LAMP 2.2 Apache配置静态缓存
- LAMP 2.1Apache不记录指定文件类型日志
- Ubuntu上apache多端口配置虚拟主机的方法
- apache配置,禁止指定后缀访问
- LAMP 2.0Apache日志切割
- Apache FTPClient操作“卡死”问题的分析和解决
- 安装Apache后,恢复系统后修复Apache服务问题
- 如何在 apache 中开启 gzip 压缩服务
- Linux下安装、配置、启动Apache
- 10个强大的Apache开源模块
- ubuntu-14.04服务器版下搭建apache2+svn+svnmanager服务
- laravel无法正确路由,开启Apache mod_rewrite模块