linux下 apache的安装过程
2015-06-04 19:57
651 查看
安装apache时,提示error: APR not found
需要三个包支持
apr-1.4.6.tar.gz
apr-util-1.4.1.tar.gz
pcre-8.34.tar.gz
分别安装三个包
1.
安装apr-1.4.5
进入安装目录
cd /opt/apr-1.4.5/
安装及编译
./configure --prefix=/usr/local/apr
make && make install
2.
进入安装目录
cd /opt/apr-util-1.3.12/
安装及编译
./configure --prefix=/usr/local/apr-util -with- apr=/usr/local/apr/bin/apr-1-config
make && make install
3.
进入安装目录
cd /opt/pcre-8.10/
安装及编译
./configure --prefix=/usr/local/pcre
make && make install
然后安装apache的时候配置上这三个包
./configure --prefix=/usr/local/apache --enable-so --enable-rewrite
--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre
make && make install
接着修改apache的配置文件,去掉serviceName前面的#,保存
vim /usr/local/apache/conf/httpd.conf
启动apachectl
/usr/local/apache/bin/apachectl start
拷贝apachectl到/etc/init.d/ 目录,并改名为httpd
cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
chmod +x /etc/init.d/httpd
chkconfig --add httpd
chkconfig --level 2345 httpd
service httpd restart
开机自动启动apache的另一种方法:
修改/etc/rc.local文件
vim /etc/rc.local
在文件中添加 /usr/local/apache/bin/apacehctl start
启动apaceh后其它电脑还是不能访问apache的原因是linux的iptable限制了80端口,
作以下修改
iptables -I INPUT -p TCP --dport 80 -j ACCEPT
这样就可以显示it works
上
需要三个包支持
apr-1.4.6.tar.gz
apr-util-1.4.1.tar.gz
pcre-8.34.tar.gz
分别安装三个包
1.
安装apr-1.4.5
进入安装目录
cd /opt/apr-1.4.5/
安装及编译
./configure --prefix=/usr/local/apr
make && make install
2.
进入安装目录
cd /opt/apr-util-1.3.12/
安装及编译
./configure --prefix=/usr/local/apr-util -with- apr=/usr/local/apr/bin/apr-1-config
make && make install
3.
进入安装目录
cd /opt/pcre-8.10/
安装及编译
./configure --prefix=/usr/local/pcre
make && make install
然后安装apache的时候配置上这三个包
./configure --prefix=/usr/local/apache --enable-so --enable-rewrite
--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre
make && make install
接着修改apache的配置文件,去掉serviceName前面的#,保存
vim /usr/local/apache/conf/httpd.conf
启动apachectl
/usr/local/apache/bin/apachectl start
拷贝apachectl到/etc/init.d/ 目录,并改名为httpd
cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
chmod +x /etc/init.d/httpd
chkconfig --add httpd
chkconfig --level 2345 httpd
service httpd restart
开机自动启动apache的另一种方法:
修改/etc/rc.local文件
vim /etc/rc.local
在文件中添加 /usr/local/apache/bin/apacehctl start
启动apaceh后其它电脑还是不能访问apache的原因是linux的iptable限制了80端口,
作以下修改
iptables -I INPUT -p TCP --dport 80 -j ACCEPT
这样就可以显示it works
上
相关文章推荐
- mybatis问题org.apache.ibatis.binding.BindingException: Parameter 'title' not found.
- 【甘道夫】Apache Hadoop 2.5.0-cdh5.2.0 HDFS Quotas 配额控制
- apache2.2 虚拟主机配置
- php 多虚拟主机配置(apache2.2+2.4)
- Apache 日志文件简述
- Visual Studio 2015 和 Apache Cordova
- apache poi各jar包介绍
- Apache运行模式之standalone和inetd模式介绍
- 移动apache访问日志后如何立即生效
- logresolve - 解析Apache日志中的IP地址为主机名
- 让Apache支持ASP.NET
- You don't have permission to access / on this server.
- apache 配置虚拟主机。
- 在 Web 项目中应用 Apache Shiro
- php + apache 环境搭建过程中出现的问题及解决方法
- java.lang.ClassNotFoundException: org.apache.jsp.login_jsp
- java.lang.ClassNotFoundException: org.apache.jsp.login_jsp
- Apache Shiro 快速入门教程,shiro 基础教程
- Apache ab模块
- Apache配置通过多个端口访问多虚拟机