赞
踩
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"
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。