linux apache yum安装,linux下yum、编译安装配置apache服务

yum安装apache服务

yum -y install httpd*

service httpd start#启动apache服务

service httpd stop#关闭apache服务

service httpd restart#重启apache服务

service httpd reload#重新加载

service httpd status#查看状态

chkconfig httpd on#设置开机启动

chkconfig httpd on#设置开机不启动

chkconfig httpd --level 35 on#设置在3、5上开机启动

修改selinux的状态

vi /etc/selinux/config

SELINUX=disabled

编译安装apache

1、yum install ntp vim-enhanced gcc gcc-c++ gcc-g77 flex bison autoconf bzip2-devel ncurses-devel openssl-devel libtool* \

zlib-devel libxml2-devel libjpeg-devel libpng-devel libtiff-devel fontconfig-devel freetype-devel libXpm-devel \

gettext-devel curl-devel curl pam-devel e2fsprogs-devel krb5-devel libidn libidn-devel -y

2、apr-1.4.2.tar.gz的安装

# tar -zxvf apr-1.4.2.tar.gz

# cd apr-1.4.2.tar.gz

# ./configure  --prefix=/usr/local/apr

# make  && make install

3、apr-util-1.3.10.tar.gz的安装

# tar -zxvf apr-util-1.3.10.tar.gz

# cd apr-util-1.3.10.tar.gz

# ./configure \

--prefix=/usr/local/apr-util \

--with-apr=/usr/local/apr

# make && make install

4、# tar -zxvf pcre-8.10.tar.gz

# cd pcre-8.10

# ./configure --prefix=/usr/local/pcre

# make && make install

5、tar xvf tar xvf httpd-2.4.2.tar.gz

./configure \

--prefix=/usr/local/apache \

--with-apr-util=/usr/local/apr-util/ \

--with-pcre=/usr/local/pcre/

make && make install

6、/usr/local/apache/bin/apachectl start

/usr/local/apache/conf/httpd.conf

DocumentRoot "/usr/local/apache//htdocs"

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值