一、安装apache(http服务)
1. 从apache.org下载源码安装包 httpd.apache.org
2. 解压缩
# tar zxf httpd-2.2.4.tar.gz
# cd httpd-2.2.4
3. 安装apache依赖包apr和apr-util,他们都在srclib目录中
3.1 安装apr
# cd srclib/apr
# ./configure --prefix=/usr/local/apr //安装地址
# make
# make install
3.2 安装apr-util
# cd ../apr-util
# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr //安装地址与apr程序路径
# make
# make install
4.安装httpd
# cd ../../
# ./configure --prefix=/usr/local/httpd --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-so --enable-rewrite
# make
# make install
--enable-so 支持DSO模式(动态模块加载方式)
--enable-rewrite 支持rewrite(地址重定向)
等这些都装完后,打开浏览器,输入你安装apache所在的服务器地址,看起来像这个样子:
http://192.168.1.3/
如果页面显示如下:
It works!
启动停止命令:
/etc/init.d/httpd start|stop|restart