linux下安装apache的及反向代理配置完整过程

上传人:wt****50 文档编号:32727931 上传时间:2018-02-12 格式:DOCX 页数:16 大小:30.55KB
返回 下载 相关 举报
linux下安装apache的及反向代理配置完整过程_第1页
第1页 / 共16页
linux下安装apache的及反向代理配置完整过程_第2页
第2页 / 共16页
linux下安装apache的及反向代理配置完整过程_第3页
第3页 / 共16页
linux下安装apache的及反向代理配置完整过程_第4页
第4页 / 共16页
linux下安装apache的及反向代理配置完整过程_第5页
第5页 / 共16页
点击查看更多>>
资源描述

《linux下安装apache的及反向代理配置完整过程》由会员分享,可在线阅读,更多相关《linux下安装apache的及反向代理配置完整过程(16页珍藏版)》请在金锄头文库上搜索。

1、下面是linux下安装apache的完整代码,系统是redhat5.51、检查系统防火墙有没开,需要把防火墙关掉,可以执行SETUP查看,关闭。在开启了防火墙时,做如下设置,开启相关端口, 修改/etc/sysconfig/iptables 文件,添加以下内容: -A RH-Firewall-1-INPUT -m state -state NEW -m tcp -p tcp -dport 80 -j ACCEPT -A RH-Firewall-1-INPUT -m state -state NEW -m tcp -p tcp -dport 8088 -j ACCEPT2、安装Apache下载地

2、址:1. 安装Apache# tar zxvf httpd-2.2.22.tar.gz /解压文件# cd httpd-2.2.22 /进入安装文件夹#./configure -prefix=/usr/local/apache -enable-so -enable-mods-shared=most -enable-proxy -enable-proxy-connect -enable-proxy-ftp -enable-proxy-http -enable-proxy-scgi -enable-proxy-ajp -enable-proxy-balancer / 配置apache路径加载动态模

3、块# make /编译apache# make install /安装apache其它相关命令:下载httpd-2.2.22.tar.bz2 把httpd-2.2.22.tar.bz2放到/soft 下rootlocalhost #cd /softrootlocalhost soft#tar jxvf httpd-2.2.6.tar.bz2 /解压apache的压缩包rootlocalhost soft#cd httpd-2.2.6 /定位到httpd-2.2.6 文件夹下rootlocalhost httpd-2.2.6#ls /查看显示httpd-2.2.6 文件夹下内容rootlocal

4、host httpd-2.2.6# ./configure -help | more /查看安装apache配置参数rootlocalhost httpd-2.2.6#./configure -prefix=/usr/local/apache -enable-so / 配置apache路径rootlocalhost httpd-2.2.6#./configure -prefix=/usr/local/apache -enable-so -enable-mods-shared=most -enable-proxy -enable-proxy-connect -enable-proxy-ftp -

5、enable-proxy-http -enable-proxy-scgi -enable-proxy-ajp -enable-proxy-balancer / 配置apache路径加载动态模块rootlocalhost httpd-2.2.6#make /编译apacherootlocalhost httpd-2.2.6#make install /安装apacherootlocalhost httpd-2.2.6#cd /usr/local/apache /进入apache的目录 rootlocalhost apache# cd conf/rootlocalhost conf#cp http

6、d.conf httpd.conf_bak /备份apache配置文件rootlocalhost conf#chkconfig -list httpd /查看httpd服务是否已存在rootlocalhost conf#chkconfig httpd off /关闭系统自带了httpd的服务,如果存在httpd服务 rootlocalhost conf#service httpd status /查看自带httpd服务状态rootlocalhost conf# /usr/local/apache/bin/apachectl -k start /linux启动apache命令 rootlocal

7、host conf# /usr/local/apache/bin/apachectl -k stop /linux停止apache命令 rootlocalhost conf#netstat -an | grep :80 /查看linux80端口是否开启rootlocalhost conf#ps -aux | grep httpd /linux下查看apache进程rootlocalhost conf#cd ./.rootlocalhost local#cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/apache /拷贝apache启动脚本

8、rootlocalhost local#vi /etc/rc.d/init.d/apache / 这里是编辑apache启动脚本在开头的#!/bin/sh 下面加上#chkconfig: 2345 85 15rootlocalhost local#chkconfig -add apache /添加apache服务rootlocalhost local#chkconfig -list apache /列出apache服务rootlocalhost local#service apache stop /停止apache服务rootlocalhost local#netstat -an | grep

9、 :80 /查看linux的80端口是否开启rootlocalhost local#ps -aux | grep httpd /查看是否存在httpd服务,若果之前自带httpd服务启动的话会导致新添加的apache服务启动失败rootlocalhost local#service apache start /启动apache服务打开你的服务器ip地址,看看是否出现了tomcat的默认首页,如果出现的话,那么恭喜你linux下安装apache已经成功了3、修改httpd.conf文件vi /usr/local/apache/conf/httpd.conf以下为httpd.conf 内容:# T

10、his is the main Apache HTTP server configuration file. It contains the# configuration directives that give the server its instructions.# See for detailed information.# In particular, see# # for a discussion of each configuration directive.# Do NOT simply read the instructions in here without underst

11、anding# what they do. Theyre here only as hints or reminders. If you are unsure# consult the online docs. You have been warned.# Configuration and logfile names: If the filenames you specify for many# of the servers control files begin with / (or drive:/ for Win32), the# server will use that explici

12、t path. If the filenames do *not* begin# with /, the value of ServerRoot is prepended - so logs/foo_log# with ServerRoot set to /usr/local/apache will be interpreted by the# server as /usr/local/apache/logs/foo_log.# ServerRoot: The top of the directory tree under which the servers# configuration, e

13、rror, and log files are kept.# Do not add a slash at the end of the directory path. If you point# ServerRoot at a non-local disk, be sure to point the LockFile directive# at a local disk. If you wish to share the same ServerRoot for multiple# httpd daemons, you will need to change at least LockFile

14、and PidFile.#ServerRoot /usr/local/apache# Listen: Allows you to bind Apache to specific IP addresses and/or# ports, instead of the default. See also the # directive.# Change this to Listen on specific IP addresses as shown below to# prevent Apache from glomming onto all bound IP addresses.#Listen 1

15、2.34.56.78:80Listen 80Listen 8088 增加监听端口# Dynamic Shared Object (DSO) Support# To be able to use the functionality of a module which was built as a DSO you# have to place corresponding LoadModule lines at this location so the# directives contained in it are actually available _before_ they are used.# Statically compiled modules (those listed by httpd -l) do not need# to be loaded here.# Example:# LoadModule foo_module modules/mod_foo.so#LoadModule authn_file_module mo

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 建筑/环境 > 建筑机械

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号