Linux的web环境代码路径,linux 源代码安装web服务器

本地共享,上传到linux系统中

yum -y install cifs-utils

mount //192.168.10.10/Apache /opt/

cd /optcd

tar zxf httpd-2.4.4.tar.gz -C /media/

tar zxf apr-1.4.6.tar.gz -C /media/

tar zxf apr-util-1.4.1.tar.gz -C /media/

cd /media

cp -r apr-1.4.6 httpd-2.4.2/srclib/apr

cp -r apr-util-1.4.1 httpd-2.4.2/srclib/apr-util

yum -y install \

gcc \

gcc-c++ \

make \

pcre-devel

cp  httpd-2.4.4

./configure \

--prefix=/usr/local/apache \

--enable-so \

--enable-rewrite \

--enable-mods-shared=most \

--with-mpm=worker \

--disable-cgid \

--disable-cgi

参数解释:

--prefix=   //来指定安装路径

--enable-so  //该参数表示支持用mod_so模块提供的功能,用LoadModule在httpd.conf文件或包含的conf文件中动态加载某个模块。让 Apache 可以支持DSO模式

--enable-rewrite  //支持 URL 重写

--enable-mods-shared=most  //选项:告诉编译器将所有标准模块都动态编译为DSO模块。

--with-mpm=worker // 让apache以worker方式运行

--with-mpm=worker   //该参数是配置apache将以何种模式编译的。Apache网站文档指出不同操作系统下的不同的默认模式.

--disable-cgid //禁止用一个外部 CGI 守护进程执行CGI脚本

--disable-cgi //禁止编译 CGI 版本的 PHP

make

make install

----------使程序可以使用service 管理-----------

"service管理的命令都在/etc/init.d/这个目录下的"

grep -v "#" /usr/local/apache/bin/apachectl  > /etc/init.d/httpd

vi /etc/init.d/httpd

在文件最前面插入下面的行,使其支持chkconfig命令:

#!/bin/sh

# chkconfig: 2345 85 15

# description: Apache is a World Wide Web server.

第一行4个数字参数意义分别为:哪些Linux级别需要启动httpd(2,3,4,5);启动序号(85);关闭序号(15)。

chmod  +x  /etc/init.d/httpd

chkconfig --add httpd //注如果在/etc/init.d/apache不编辑这个# chkconfig: 2345 85 15内容的话,

就没法用chkconfig --add来添加apache这个服务的

chkconfig --list httpd

---------以上都是安装部分------------

vi conf/httpd.conf(# vi /usr/local/apache/conf/httpd.conf)

ServerName //设置成hostname显示的名称

Listen 192.168.5.2:80//添加或修改监听本地的IPv4的地址的80端口

ServerName www.benet.com

ln -s /usr/local/apache/conf/httpd.conf /etc/httpd.conf

service httpd restart

netstat -anpt | grep 80

tail /usr/local/apache/logs/access_log

tail /usr/local/apache/logs/error_log

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值