Apache服务常用命令

  1. 环境

(1)         RedHat5System

(2)         Apachehttpd-2.2.15.tar.gz

2.执行步骤

  (1)解压:       tar –zxvfhttpd-2.2.15.tar.gz

   (2) cd httpd-2.2.15

   (3) 输入编译文件命令

./configure --prefix=/usr/local/apache \
--enable-rewrite=shared
--enable-speling=shared  --enable-module=so
    --enable-module=rewrite

-- enablue-proxy=shared

–enable-module=so
so模块用来提供DSO支持的apachehe核心模块,APACHE是配置文件默认是只要你安装了一个动态加载模块。系统会默认将SO放进去。不需要你特意说明的。系统会自动检查的。

 

--enable-module=most
用most可以将一些不常用的,不在缺省常用模块中的模块编译进来

--enablue-proxy=shared

--enable-shared=max允许大多数模块

--enable-module=rewrite 安装rewrite模块

   (4)make

   (5) make install

   (6)进入usr/local/apache/bin/apachectl start

以下是Apache常用命令

make clean 清除编译

rpm –qa|grep httpd查看是否已安装了Apache

service httpd start立即启动apache

pstree|grep httpd

   |-httpd—8*[httpd]表示已启动

//可以使用下面的命令检测配置文件语法的正确性

# apachectl configtest

//可以使用如下命令查看运行状态

# service httpd status

//查看编译配置参数(系统自带的)

apachect1 -V 

//查看已编译模块

 Apachect1 –l

在Red Hat Linux中http的配置文件是

/etc/httpd/conf/httpd.conf

//查看配置文件

Grep –v “#” /etc/httpd/conf/httpd.conf

注意:若linux机子的系统默认有时候会安装Apache,若再装一个,用上面的常用命令会默认启动的是系统的,这个时候要通过以下步骤来指向系统默认改为自己刚安装的。

1.cd usr/sbin

2.ls httpd

3. mv /usr/sbin/httpd /usr/sbin/httpd-bak

4. ln -s /usr/local/apache/bin/httpd   /usr/sbin/httpd

 

注意:/usr/local/apache/bin/httpd是新安装的apache地址。

  1. 进入apache
  2. cd  htdocs/
  3. ls
  4. catindex.html

 

 

查看glassfish

1 .cd domain1

2.cd config

3.cd ../docroot/

4.clear

5.ls

6.cat index.html

posted @ 2010-08-28 19:12  IT一族  阅读(2242)  评论(0)    收藏  举报