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

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

下面是linux下安装apache的完整代码,系统是redhat5.5

1、检查系统防火墙有没开,需要把防火墙关掉,可以执行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 ACCEPT 2、安装Apache

下载地址:

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路径加载动态模块

# make //编译apache

# make install//安装apache

其它相关命令:

下载httpd-2.2.22.tar.bz2 把httpd-2.2.22.tar.bz2放到/soft 下

[root@localhost ~]#cd /soft

[root@localhost soft]#tar jxvf httpd-2.2.6.tar.bz2 //解压apache的压缩包

[root@localhost soft]#cd httpd-2.2.6 //定位到httpd-2.2.6 文件夹下[root@localhost httpd-2.2.6]#ls //查看显示httpd-2.2.6 文件夹下内容 [root@localhost httpd-2.2.6]# ./configure --help | more //查看安装apache配置参数

[root@localhost httpd-2.2.6]#./configure --prefix=/usr/local/apache --enable-so // 配置apache路径

[root@localhost httpd-2.2.6]#./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路径加载动态模块

[root@localhost httpd-2.2.6]#make //编译apache

[root@localhost httpd-2.2.6]#make install //安装apache

[root@localhost httpd-2.2.6]#cd /usr/local/apache //进入apache的目录[root@localhost apache]# cd conf/

[root@localhost conf]#cp httpd.conf httpd.conf_bak //备份apache配置文件

[root@localhost conf]#chkconfig --list httpd //查看httpd服务是否已存在

[root@localhost conf]#chkconfig httpd off //关闭系统自带了httpd的服务,如果存在httpd服务

[root@localhost conf]#service httpd status //查看自带httpd服务状态

[root@localhost conf]# /usr/local/apache/bin/apachectl -k start

//linux启动apache命令

[root@localhost conf]# /usr/local/apache/bin/apachectl -k stop //linux 停止apache命令

[root@localhost conf]#netstat -an | grep :80 //查看linux80端口是否开启

[root@localhost conf]#ps -aux | grep httpd //linux下查看apache进程

[root@localhost conf]#cd ../..

[root@localhost local]#cp /usr/local/apache/bin/apachectl

/etc/rc.d/init.d/apache //拷贝apache启动脚本

[root@localhost local]#vi /etc/rc.d/init.d/apache // 这里是编辑apache 启动脚本

在开头的#!/bin/sh 下面加上

#chkconfig: 2345 85 15

[root@localhost local]#chkconfig --add apache //添加apache服务

[root@localhost local]#chkconfig --list apache //列出apache服务

[root@localhost local]#service apache stop //停止apache服务

[root@localhost local]#netstat -an | grep :80 //查看linux的80端口是否开启

[root@localhost local]#ps -aux | grep httpd //查看是否存在httpd服务,若果之前自带httpd服务启动的话会导致新添加的apache服务启动失败

[root@localhost local]#service apache start //启动apache服务

打开你的服务器ip地址,看看是否出现了tomcat的默认首页,如果出现的话,那么恭喜你

linux下安装apache已经成功了

3、修改httpd.conf文件

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

以下为httpd.conf内容:

# This 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 understanding

# what they do. They're 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 server's control files begin with "/" (or "drive:/" for Win32), the # server will use that explicit 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 server's

# configuration, error, 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 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 12.34.56.78:80

Listen 80

Listen 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 modules/mod_authn_file.so --加载的模块,正确安装完会自动加载以下模块

LoadModule authn_dbm_module modules/mod_authn_dbm.so

LoadModule authn_anon_module modules/mod_authn_anon.so

LoadModule authn_dbd_module modules/mod_authn_dbd.so

LoadModule authn_default_module modules/mod_authn_default.so

LoadModule authz_host_module modules/mod_authz_host.so

LoadModule authz_groupfile_module modules/mod_authz_groupfile.so LoadModule authz_user_module modules/mod_authz_user.so

LoadModule authz_dbm_module modules/mod_authz_dbm.so

LoadModule authz_owner_module modules/mod_authz_owner.so

LoadModule authz_default_module modules/mod_authz_default.so

LoadModule auth_basic_module modules/mod_auth_basic.so

LoadModule auth_digest_module modules/mod_auth_digest.so

LoadModule dbd_module modules/mod_dbd.so

LoadModule dumpio_module modules/mod_dumpio.so

LoadModule reqtimeout_module modules/mod_reqtimeout.so

LoadModule ext_filter_module modules/mod_ext_filter.so

LoadModule include_module modules/mod_include.so

LoadModule filter_module modules/mod_filter.so

LoadModule substitute_module modules/mod_substitute.so

LoadModule deflate_module modules/mod_deflate.so

LoadModule log_config_module modules/mod_log_config.so

LoadModule logio_module modules/mod_logio.so

LoadModule env_module modules/mod_env.so

LoadModule expires_module modules/mod_expires.so

LoadModule headers_module modules/mod_headers.so

LoadModule ident_module modules/mod_ident.so

LoadModule setenvif_module modules/mod_setenvif.so

LoadModule version_module modules/mod_version.so

LoadModule proxy_module modules/mod_proxy.so

LoadModule proxy_connect_module modules/mod_proxy_connect.so

LoadModule proxy_ftp_module modules/mod_proxy_ftp.so

LoadModule proxy_http_module modules/mod_proxy_http.so

LoadModule proxy_scgi_module modules/mod_proxy_scgi.so

LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

LoadModule proxy_balancer_module modules/mod_proxy_balancer.so LoadModule mime_module modules/mod_mime.so

LoadModule dav_module modules/mod_dav.so

LoadModule status_module modules/mod_status.so

LoadModule autoindex_module modules/mod_autoindex.so

LoadModule asis_module modules/mod_asis.so

LoadModule info_module modules/mod_info.so

LoadModule cgi_module modules/mod_cgi.so

LoadModule dav_fs_module modules/mod_dav_fs.so

LoadModule vhost_alias_module modules/mod_vhost_alias.so

LoadModule negotiation_module modules/mod_negotiation.so

LoadModule dir_module modules/mod_dir.so

LoadModule imagemap_module modules/mod_imagemap.so

LoadModule actions_module modules/mod_actions.so

LoadModule speling_module modules/mod_speling.so

LoadModule userdir_module modules/mod_userdir.so

LoadModule alias_module modules/mod_alias.so

LoadModule rewrite_module modules/mod_rewrite.so

Timeout 300 --新增的配置参数

KeepAlive On

MaxKeepAliveRequests 1000

KeepAliveTimeout 15

UseCanonicalName Off

AccessFileName .htaccess

ServerTokens Full

ServerSignature On

HostnameLookups Off

#

# If you wish httpd to run as a different user or group, you must run # httpd as root initially and it will switch.

#

# User/Group: The name (or #number) of the user/group to run httpd as. # It is usually good practice to create a dedicated user and group for # running httpd, as with most system services.

#

User daemon

Group daemon

----------------------------------以下内容是新增的关键参数

StartServers 40

MinSpareServers 40

MaxSpareServers 80

MaxClients 256

MaxRequestsPerChild 10000

StartServers 40

MaxClients 2000

MinSpareThreads 100

MaxSpareThreads 300

ThreadsPerChild 200

MaxRequestsPerChild 0

ProxyRequests Off

RewriteEngine on

RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)

RewriteRule .* - [F]

RewriteEngine on

RewriteCond %{HTTP:range} !(^bytes=[^,]+(,[^,]+){0,4}$|^$)

RewriteRule .* - [F]

TraceEnable off

#NameVirtualHost 10.46.85.137:9080

#

#ServerName 10.46.85.137:9080

#ProxyPass /ponApp/ http://10.209.122.40:7001/xponApp/

#ProxyPassReverse /ponApp/ http://10.209.122.40:7001/xponApp/

#

NameVirtualHost 10.46.85.137:8088

ServerName kuangdai --kuangdai LINUX系统的主机名

ProxyPass /xponApp/ http://10.209.122.40:7001/xponApp/ ProxyPassReverse /xponApp/ http://10.209.122.40:7001/xponApp/

启动服务报错

--/etc/hosts 增加127.0.0.1 localhost.localdomain

localhost ”kuangdai“主机名

--配置反向代理的访问权限

Order deny,allow

Allow from all

-----------------------------以上内容是新增的关键参数

# 'Main' server configuration

#

# The directives in this section set up the values used by the 'main'

# server, which responds to any requests that aren't handled by a

# definition. These values also provide defaults for

# any containers you may define later in the file.

#

# All of these directives may appear inside containers,

# in which case these default settings will be overridden for the

# virtual host being defined.

#

#

# ServerAdmin: Your address, where problems with the server should be

# e-mailed. This address appears on some server-generated pages, such # as error documents. e.g. admin@https://www.360docs.net/doc/e69108296.html,

#

ServerAdmin you@https://www.360docs.net/doc/e69108296.html,

#

# ServerName gives the name and port that the server uses to identify itself.

# This can often be determined automatically, but we recommend you specify # it explicitly to prevent problems during startup.

#

# If your host doesn't have a registered DNS name, enter its IP address here. #

ServerName 127.0.0.1:80 --这个ServerName可随意配置一定去掉前面#

#

# DocumentRoot: The directory out of which you will serve your

# documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations.

#

DocumentRoot "/usr/local/apache/htdocs"

#

# Each directory to which Apache has access can be configured with respect # to which services and features are allowed and/or disabled in that

# directory (and its subdirectories).

#

# First, we configure the "default" to be a very restrictive set of

# features.

#

Options FollowSymLinks

AllowOverride None

Order deny,allow

Deny from all

#

# Note that from this point forward you must specifically allow

# particular features to be enabled - so if something's not working as # you might expect, make sure that you have specifically enabled it

# below.

#

#

# This should be changed to whatever you set DocumentRoot to.

#

#

# Possible values for the Options directive are "None", "All",

# or any combination of:

# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews

#

# Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you.

#

# The Options directive is both complicated and important. Please see # https://www.360docs.net/doc/e69108296.html,/docs/2.2/mod/core.html#options

# for more information.

#

Options Indexes FollowSymLinks

#

# AllowOverride controls what directives may be placed in .htaccess files.

# It can be "All", "None", or any combination of the keywords:

# Options FileInfo AuthConfig Limit

#

AllowOverride None

#

# Controls who can get stuff from this server.

#

Order allow,deny

Allow from all

#

# DirectoryIndex: sets the file that Apache will serve if a directory

# is requested.

#

DirectoryIndex index.html

#

# The following lines prevent .htaccess and .htpasswd files from being # viewed by Web clients.

#

Order allow,deny

Deny from all

Satisfy All

#

# ErrorLog: The location of the error log file.

# If you do not specify an ErrorLog directive within a

# container, error messages relating to that virtual host will be

# logged here. If you *do* define an error logfile for a # container, that host's errors will be logged there and not here.

#

ErrorLog "logs/error_log"

#

# LogLevel: Control the number of messages logged to the error_log.

# Possible values include: debug, info, notice, warn, error, crit,

# alert, emerg.

#

LogLevel warn

#

# The following directives define some format nicknames for use with # a CustomLog directive (see below).

#

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

LogFormat "%h %l %u %t \"%r\" %>s %b" common

# You need to enable mod_logio.c to use %I and %O

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"

\"%{User-Agent}i\" %I %O" combinedio

#

# The location and format of the access logfile (Common Logfile Format). # If you do not define any access logfiles within a

# container, they will be logged here. Contrariwise, if you *do*

# define per- access logfiles, transactions will be

# logged therein and *not* in this file.

#

CustomLog "logs/access_log" common

#

# If you prefer a logfile with access, agent, and referer information # (Combined Logfile Format) you can use the following directive.

#

#CustomLog "logs/access_log" combined

#

# Redirect: Allows you to tell clients about documents that used to # exist in your server's namespace, but do not anymore. The client # will make a new request for the document at its new location.

# Example:

# Redirect permanent /foo https://www.360docs.net/doc/e69108296.html,/bar

#

# Alias: Maps web paths into filesystem paths and is used to

# access content that does not live under the DocumentRoot.

# Example:

# Alias /webpath /full/filesystem/path

#

# If you include a trailing / on /webpath then the server will

# require it to be present in the URL. You will also likely

# need to provide a section to allow access to

# the filesystem path.

#

# ScriptAlias: This controls which directories contain server scripts. # ScriptAliases are essentially the same as Aliases, except that

# documents in the target directory are treated as applications and # run by the server when requested rather than as documents sent to the # client. The same rules about trailing "/" apply to ScriptAlias

# directives as to Alias.

#

ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"

#

# ScriptSock: On threaded servers, designate the path to the UNIX

# socket used to communicate with the CGI daemon of mod_cgid.

#

#Scriptsock logs/cgisock

#

# "/usr/local/apache/cgi-bin" should be changed to whatever your ScriptAliased

# CGI directory exists, if you have that configured.

#

AllowOverride None

Options None

Order allow,deny

Allow from all

#

# DefaultType: the default MIME type the server will use for a document # if it cannot otherwise determine one, such as from filename extensions. # If your server contains mostly text or HTML documents, "text/plain" is # a good value. If most of your content is binary, such as applications # or images, you may want to use "application/octet-stream" instead to # keep browsers from trying to display binary files as though they are # text.

#

DefaultType text/plain

#

# TypesConfig points to the file containing the list of mappings from # filename extension to MIME-type.

#

TypesConfig conf/mime.types

#

# AddType allows you to add to or override the MIME configuration

# file specified in TypesConfig for specific file types.

#

#AddType application/x-gzip .tgz

#

# AddEncoding allows you to have certain browsers uncompress

# information on the fly. Note: Not all browsers support this.

#

#AddEncoding x-compress .Z

#AddEncoding x-gzip .gz .tgz

#

# If the AddEncoding directives above are commented-out, then you

# probably should define those extensions to indicate media types: #

AddType application/x-compress .Z

AddType application/x-gzip .gz .tgz

#

# AddHandler allows you to map certain file extensions to "handlers": # actions unrelated to filetype. These can be either built into the server # or added with the Action directive (see below)

#

# To use CGI scripts outside of ScriptAliased directories:

# (You will also need to add "ExecCGI" to the "Options" directive.) #

#AddHandler cgi-script .cgi

# For type maps (negotiated resources):

#AddHandler type-map var

#

# Filters allow you to process content before it is sent to the client. #

# To parse .shtml files for server-side includes (SSI):

# (You will also need to add "Includes" to the "Options" directive.) #

#AddType text/html .shtml

#AddOutputFilter INCLUDES .shtml

#

# The mod_mime_magic module allows the server to use various hints from the # contents of the file itself to determine its type. The MIMEMagicFile # directive tells the module where the hint definitions are located.

#

#MIMEMagicFile conf/magic

#

# Customizable error responses come in three flavors:

# 1) plain text 2) local redirects 3) external redirects

#

# Some examples:

#ErrorDocument 500 "The server made a boo boo."

#ErrorDocument 404 /missing.html

#ErrorDocument 404 "/cgi-bin/missing_handler.pl"

#ErrorDocument 402 https://www.360docs.net/doc/e69108296.html,/subscription_info.html

#

#

# MaxRanges: Maximum number of Ranges in a request before

# returning the entire resource, or one of the special

# values 'default', 'none' or 'unlimited'.

# Default setting is to accept 200 Ranges.

#MaxRanges unlimited

#

# EnableMMAP and EnableSendfile: On systems that support it,

# memory-mapping or the sendfile syscall is used to deliver

# files. This usually improves server performance, but must

# be turned off when serving from networked-mounted

# filesystems or if support for these functions is otherwise

# broken on your system.

#

#EnableMMAP off

#EnableSendfile off

# Supplemental configuration

#

# The configuration files in the conf/extra/ directory can be

# included to add extra features or to modify the default configuration of # the server, or you may simply copy their contents here and change as

# necessary.

# Server-pool management (MPM specific)

#Include conf/extra/httpd-mpm.conf

# Multi-language error messages

#Include conf/extra/httpd-multilang-errordoc.conf

# Fancy directory listings

#Include conf/extra/httpd-autoindex.conf

# Language settings

#Include conf/extra/httpd-languages.conf

# User home directories

#Include conf/extra/httpd-userdir.conf

# Real-time info on requests and configuration

#Include conf/extra/httpd-info.conf

# Virtual hosts

#Include conf/extra/httpd-vhosts.conf

# Local access to the Apache HTTP Server Manual

#Include conf/extra/httpd-manual.conf

# Distributed authoring and versioning (WebDAV)

#Include conf/extra/httpd-dav.conf

# Various default settings

#Include conf/extra/httpd-default.conf

# Secure (SSL/TLS) connections

#Include conf/extra/httpd-ssl.conf

#

# Note: The following must must be present to support

# starting without SSL on platforms with no /dev/random equivalent # but a statically compiled-in mod_ssl.

#

SSLRandomSeed startup builtin

SSLRandomSeed connect builtin

Apache反向代理

Apache反向代理 反向代理(Reverse Proxy)方式是指以代理服务器来接受internet上的连接请求然后将请求转发给内部网络上的服务器,并将从服务器上得到的结果返回给internet上请求连接的客户端,此时代理服务器对外就表现为一个web服务器。 通常的代理服务器,只用于代理内部网络对Internet的连接请求,客户机必须指定代理服务器,并将本来要直接发送到Web服务器上的http请求发送到代理服务器中,因此普通的代理服务器不支持外部对内部网络的访问请求。 一、下载安装Apache服务器(以apache_2.2.4为例) 1. 双击“apache_ 2.2.4-win32-x86-no_ssl.msi”开始安装。 图1 欢迎界面 出现 Windows 标准的软件安装欢迎界面,见图1。 2. 直接点“Next”继续,出现授权协议,见图2。

图2 授权协议 3. 选择“I accept the terms in the license agreement”同意授权协议,然后点“Next”继续,出现安装说明,见图3。 图3 安装说明

4. 直接点“Next”下一步,出现填写信息界面,见图4。 图4 填写信息 “Network Domain”填写你的网络域名,比如 https://www.360docs.net/doc/e69108296.html, ,如果没有网络域名,可以随便填写。但如果你架设的 Apache 服务器如果要放入 Internet ,则一定要填写正确的网络域名。 在“Server Name”下填入你的服务器名,比如 https://www.360docs.net/doc/e69108296.html, ,也就是主机名。 “Administrator's Email Address”填写系统管理员的联系电子邮件地址,比如indian@https://www.360docs.net/doc/e69108296.html, 。 上述三条信息仅供参考,其中联系电子邮件地址会在当系统故障时提供给访问者,三条信息均可任意填写,无效的也行。 下面有两个选择,第一个是为系统所有用户安装,使用默认的80端口,并作为系统服务自动启动;另外一个是仅为当前用户安装,使用端口8080,手动启动。一般选择第一个“for All Users, on Port 80, as a Service – Recommended”。我选的是第一个“for All Users,on Port 80,as a Service -- Recommended”,用80端口并且自动启动服务,如图4所示。按“Next”继续。

SVN服务端安装和配置

所有资料来源于 https://www.360docs.net/doc/e69108296.html, 我用Subversion - SVN|TortoiseSVN下载安装配置使用技术交流社区 SVN 服务端安装和配置 1.Windows环境下基于 Apache 的SVN 服务器安装及配置 1.1安装 1.1.1安装Apache (1)下载Apache 地址https://www.360docs.net/doc/e69108296.html,/download.cgi 注意:Apache低于2.0.54的Windows版本的存在编译问题,低于2.0.54的版本不能与Subversion 1.2一起工作。2.2.X目前不能很好支持SVN 1.4.3。当前建议下载Apache 2.0.59 (2) 安装 下载完成后运行apache_2.0.59-win32-x86-no_ssl.msi,根据提示进行操作。遇到系统要求输入SERVER的URL时,如果你的服务器没有DNS名称,请直接输入IP地址。 注意:如果你已经有了IIS或其他监听80段口的程序,安装会失败,如果发生这种情况,直接到程序的安装目录\Apache Group\Apache2\conf,打开httpd.conf。编辑文件的Listen 80为其他可用的端口,例如Listen 81,然后重新启动-这样就不会那个问题了。 (3)检查 安装完成后浏览http://localhost/若成功,可看到apache页面。 1.1.2安装Subversion (1)下载 Subversion 地址:https://www.360docs.net/doc/e69108296.html,/servlets/ProjectDocumentList?folderID=91(2)安装 运行svn-1.4.3-setup.exe 安装程序,并根据指导安装,如果Subversion认识到你安装了Apache,你就几乎完成了工作,如果它没有找到Apache服务器,你还有额外的步骤。 (3)后续 步骤1 从C:\Program Files\Subversion\bin 中将 mod_authz_svn.so mod_dav_svn.so复制到 C:\Program Files\Apache Group\Apache2\modules下 intl3_svn.dll libdb*.dll C:\Program Files\Apache Group\Apache2\bin下 步骤2 找到C:\Program Files\Apache Group\Apache2\conf\httpd.conf文件去掉如下几行的注释(删除 '#'标记):

累积:技海拾贝――基于反向代理的单点登录方案

累积:技海拾贝|Cumulation 基于反向代理的单点登录方案 文:电力事业部 王雁飞 1. 概述 实现单点登录要解决问题是:用户体验到只需一次登录就能以适当的用户身份访问多个相关应用系统。单点登录方案的核心是统一身份认证和统一用户身份管理。 在企业范围内建立统一的身份管理系统,一般采用标准的目录服务实现认证和身份数据存储。通过建立统一的帐户存储和管理中心,作为所有账号管理行为的数据存储,以自动化的,基于策略的方式实现帐户的创建,变更,销户。 如果各个应用系统和统一身份管理系统帐户没有统一,统一身份管理系统还负责各个系统帐户在其他多个应用系统中映射帐户管理。当在统一身份管理系统创建用户,用户信息保存到目录服务器,同时在此用户将要访问的其他应用系统中建立他的相应帐户,或者直接映射一个已经存在用户。当用户信息修改,也要同步到其他应用系统中。当从统一身份管理系统删除用户,用户信息从目录服务器删除,同时在此用户将要访问的其他应用系统中删除他的相应帐户。 如果各个业务应用系统可以识别相同的登录用户身份标识,就不必做用户身份在各个应用系统的同步维护管理工作。 电力营销业务应用基于J2EE技术路线开发,由多个业务模块组成,每个业务模块部署为一个Web Module。用户通过同一登录入口进入系统,在同一浏览器窗口可以访问到多个业务模块的资源。本文介绍了多个应用模块之间单点登录方案和实现情况。 2. 背景知识 2.1. Http Cookie特性 2.1.1. 概述 Cookie是通过Http 会话头部分传递的文本信息。Cookie有名字Name、值Value、域Domain、路径Path等属性组成。 Cookie用于在Http这个无状态的协议下实现服务器和客户端的会话,使得服务器可以“识别”特定的客户端会话。Cookie在Http服务器响应客户端浏览器请求时生成发送给浏

(2020)(环境管理)WindowsApacheMysqlPHP环境的安装与配置图文教程经典整合版

(环境管理)WindowsApacheMysql PHP环境的安装与配置图文教程经典整合版

Windows+Apache2.2+Mysql5+ PHP5环境的配置整合版 所需文件: mysql-essential-5.1.48-win32.msi httpd-2.2.15-win32-x86-openssl-0.9.8m-r2.MSI php-5.2.6-Win32.zip PECL5.2.6 Win32 binaries.ZIP 配置要求: 1、将Apache+PHP+Mysql安装在E:\。 2、将网页文档文件改为:E:\Web。 Apache的安装: 1、运行httpd-2.2.15-win32-x86-openssl-0.9.8m-r2.MSI,界面如下:

单击“I accept the terms in the license agreement”之后再单击“Next”。

服务器信息可以按照默认配置,如果服务器的80端口没被其他服务器程序占据。可选“for All Users,on Port 80, as a Service—Recommended.”如果仅为当前用户使用,使用8080端口,手动启动,选择“only for the Current User, on Port 8080, when started Manually.”。单击“Next”。

“Typical”为默认安装,“Custom”为用户自定义安装。选择“Custom”,单击“Next”。 单击“Build Headers and libraries”,选择“This feature will be installed on local dirive.”

三大WEB服务器对比(apache_,lighttpd,nginx)

三大WEB服务器对比分析(apache ,lighttpd,nginx)一.软件介绍(apache lighttpd nginx) 1. lighttpd Lighttpd是一个具有非常低的内存开销,cpu占用率低,效能好,以及丰富的模块等特点。lighttpd 是众多OpenSource轻量级的web server中较为优秀的一个。支持FastCGI, CGI, Auth, 输出压缩(output compress), URL重写, Alias等重要功能。 Lighttpd使用fastcgi方式运行php,它会使用很少的PHP进程响应很大的并发量。 Fastcgi的优点在于: ·从稳定性上看, fastcgi是以独立的进程池运行来cgi,单独一个进程死掉,系统可以很轻易的丢弃,然后重新分配新的进程来运行逻辑. ·从安全性上看, fastcgi和宿主的server完全独立, fastcgi怎么down也不会把server搞垮, ·从性能上看, fastcgi把动态逻辑的处理从server中分离出来, 大负荷的IO处理还是留给宿主server, 这样宿主server可以一心一意作IO,对于一个普通的动态网页来说, 逻辑处理可能只有一小部分, 大量的图片等静态IO处理完全不需要逻辑程序的参与(注1) ·从扩展性上讲, fastcgi是一个中立的技术标准, 完全可以支持任何语言写的处理程序(php,java,python...) 2.apache apache是世界排名第一的web服务器, 根据netcraft(https://www.360docs.net/doc/e69108296.html,)所作的调查,世界上百分之五十以上的web服务器在使用apache. 1995年4月, 最早的apache(0.6.2版)由apache group公布发行. apache group 是一个完全通过internet进行运作的非盈利机构, 由它来决定apache web服务器的标准发行版中应该包含哪些内容. 准许任何人修改隐错, 提供新的特征和将它移植到新的平台上, 以及其它的工作. 当新的代码被提交给apache group时, 该团体审核它的具体内容, 进行测试, 如果认为满意, 该代码就会被集成到apache的主要发行版中. apache 的特性: 1) 几乎可以运行在所有的计算机平台上. 2) 支持最新的http/1.1协议 3) 简单而且强有力的基于文件的配置(httpd.conf). 4) 支持通用网关接口(cgi) 5) 支持虚拟主机.

Linux下Apache服务器的安装和配置

【实验8】Apache服务器的安装和配置 一、实验目的: 1.掌握Apache Web服务器的安装和配置。 2.使用虚拟主机在同一台服务器上架设多个网站。 二、【实验环境】 1.虚拟机软件VM Ware 6.0,Redhat Enterprise Linux虚拟机或光盘镜像文 件。 2.2台以上机器组成的局域网。 三、【实验原理】 (一)Apache服务简介 Apache是世界使用排名第一的Web服务器软件。它可以运行在几乎所有广泛使用的计算机平台上。 Apache源于NCSAhttpd服务器,经过多次修改,成为世界上最流行的Web 服务器软件之一。Apache取自“a patchy server”的读音,意思是充满补丁的服务器,因为它是自由软件,所以不断有人来为它开发新的功能、新的特性、修改原来的缺陷。Apache的特点是简单、速度快、性能稳定,并可做代理服务器来使用。 (二)虚拟主机 所谓虚拟主机,也叫“网站空间”就是把一台运行在互联网上的服务器划分成 多个“虚拟”的服务器,每一个虚拟主机都具有独立的域名和完整的Internet服务 器(支持WWW、FTP、E-mail等)功能。一台服务器上的不同虚拟主机是各自 独立的,并由用户自行管理。 虚拟主机技术是互联网服务器采用的节省服务器硬体成本的技术,虚拟主机 技术主要应用于HTTP服务,将一台服务器的某项或者全部服务内容逻辑划分 为多个服务单位,对外表现为多个服务器,从而充分利用服务器硬体资源。如果 划分是系统级别的,则称为虚拟服务器。

(三)Linux中虚拟主机的分类 1、基于IP地址的虚拟主机 如果某公司有多个独立的IP地址可用,那么可以用不同的IP地址来配置虚拟主机。 2、基于端口的虚拟主机 如果只有一个IP地址,但是要架设多个站点,可以使用端口来区分,每个端口对应一个站点。这样配置的话,用户在访问的时候必须在 URL中指明端口号才能访问相应的网站。 3、基于名称的虚拟主机 使用基于IP地址或者端口的虚拟主机,能够配置的站点数目有限,而使用基于名称的虚拟主机,可以配置任意数目的虚拟主机,而不需要 额外的IP地址,也不需要修改端口号。 四、实验步骤 本实验请勿使用【系统】→【管理】→【服务器设置】中的【HTTPD】工具来配置,否则后果自负! (一)Apache服务器的启动 1、测试是否已安装Apache服务器: [root@localhost ~]#rpm –qa httpd 2、启动Apache服务器: [root@localhost ~]#service httpd start (二)基于端口的虚拟主机的配置 1、在/etc/httpd目录中,建立一个名为vhostconf.d的子目录,用来存放虚拟 主机的配置文件。 2、在/var/www目录中,建立一个名为websites的子目录,用于存放网站源 文件;在website目录下再建立ipvhost1和ipvhost2文件夹,用于区分各 个站点。

2-apache Apache_Web 服务器安装部署手册档

重要提示 Web服务器包括apache的安装部署和W AS7 Plugin安装部署两部分,如果的websphere应用服务器使用非集群模式,plugin则不需要安装,只需配置本文2.1章节内容,如果websphere 应用服务器使用群集模式,则需要按照本文2.2章节进行plugin安装配置。 1 Apache安装 Apache的安装和配置现在可以采用脚本自动化安装,脚本就是139ftp上的 apache_install_script.sh 请下载到web服务器中,并执行即可。 注意:在执行脚本安装前请确认web服务器的/opt/apache下没有安装过apache,并且web 服务器能上外网(能ping通https://www.360docs.net/doc/e69108296.html,) 成功安装apache并测试通过后即可直接继续本文第二章节Was7 Plugin安装 在root下进行root进入方法#su 然后输入密码 1.1 准备安装 关闭系统自带的web服务: #chkconfig httpd off 在线安装gcc #yum install gcc cc 下载并解压安装程序: #cd ~/ #wget https://www.360docs.net/doc/e69108296.html,/httpd/httpd-2.2.15.tar.gz #tar –zxvf httpd-2.2.15.tar.gz -C /usr/src Web 服务器安装部署手册 Page 4 of 21 1.2 安装Apache Web Server 进入源码目录: #cd /usr/src/httpd-2.2.15 编译源文件: #./configure //(安装到默认目录) 形成安装文件: #make 安装程序: #make install 1.3 验证安装 进入安装后目录: # cd /opt/apache/apache-2.2.15/bin 检查进程模式: #./apachectl –l Compiled in modules: core.c worker.c http_core.c mod_so.c 启动Apache Web Server:

Apache服务器的安装与配置

Apache服务器的安装与配置 一、安装Apache 双击可执行文件apache_1.3.33-win32-x86-no_src.exe,将Apache服务器软件安装至C:\Apache目录下。 二、设置C:\apache\conf\httpd.donf文件 修改Apache的核心配置文件c:\apache\conf\httpd.conf(说明一点:“#”为Apache的注释符号)。修改方法如下: 1、寻找到ServerName。这里定义你的域名。这样,当Apache Server运行时,你可以在浏览器中访问自己的站点。如果前面有#,记得删除它。 2、寻找到ServerAdmin。这里输入你的E-Mail地址。 (以上两条在安装时应该已经配置好了,所以不必改动,这里介绍一下,主要是为了日后的修改) 3、寻找到。向下有一句Options,去掉后面所有的参数,加一个All(注意区分大小写!A 大写,两个l小写。下同。);接着还有一句Allow Override,也同样去掉后面所有的参数,加一个All。 AllowOverride All Options All Order allow,deny Allow from all 4、寻找到DocumentRoot。这个语句指定你的网站路径,也就是你主页放置的目录。你可以使用默认的,也可以自己指定一个,但记住,这句末尾不要加“/”。此外注意,路径的分隔符在Apache Server里写成“/”。(将DocumentRoot "C:/apache/htdocs"改为DocumentRoot "C:/try") 5、寻找到DirectoryIndex。这就是你站点第一个显示的主页,在index.html的后面加入index.htm index.php index.php3 index.cgi index.pl。注意,每种类型之间都要留一空格!这里添加好了,以后就不用再麻烦了。 6、port(端口号),如果没安装IIS的话,就保持80不要变,否则,就要改一下(因为IIS的WEB服务占据了80),可以改成81等等。 三、Apache的手动启动和停止 Net start apache启动apache服务,Net stop apache停止apache服务。

致远微协同反向代理方案文档

致远微协同反向代理方案文档 一、前言: 本文旨在解决企业希望使用致远微协同时,由于V5协同系统部署在内网,而无法连接的情况。此方案使用“反向代理”技术,在保证相对安全的同时,为企业V5系统提供微协同需要的外网连接。 反向代理介绍(百度百科): 反向代理(Reverse Proxy)方式是指以代理服务器来接受internet上的连接请求,然后将请求转发给内部网络上的服务器,并将从服务器上得到的结果返回给internet上请求连接的客户端,此时代理服务器对外就表现为一个反向代理服务器。 通常的代理服务器,只用于代理内部网络对Internet的连接请求,客户机必须指定代理服务器,并将本来要直接发送到Web服务器上的http请求发送到代理服务器中。由于外部网络上的主机并不会配置并使用这个代理服务器,普通代理服务器也被设计为在Internet上搜寻多个不确定的服务器,而不是针对Internet上多个客户机的请求访问某一个固定的服务器,因此普通的Web代理服务器不支持外部对内部网络的访问请求。当一个代理服务器能够代理外部网络上的主机,访问内部网络时,这种代理服务的方式称为反向代理服务。此时代理服务器对外就表现为一个Web服务器,外部网络就可以简单把它当作一个标准的Web 服务器而不需要特定的配置。不同之处在于,这个服务器没有保存任何网页的真实数据,所有的静态网页或者CGI程序,都保存在内部的Web服务器上。因此对反向代理服务器的攻击并不会使得网页信息遭到破坏,这样就增强了Web服务器的安全性。 反向代理方式和包过滤方式或普通代理方式并无冲突,因此可以在防火墙设备中同时使用这

两种方式,其中反向代理用于外部网络访问内部网络时使用,正向代理或包过滤方式用于拒绝其他外部访问方式并提供内部网络对外部网络的访问能力。因此可以结合这些方式提供最佳的安全访问方式。 二、准备工作 1、独立的,用于部署反向代理服务器一个: a)无需较高配置,一般应用服务器即可 b)Window、linux环境均可 c)此服务器有公网独立IP地址,并可连接内网协同系统。 2、至Nginx官方网站()下载对应版本,安装到此服务器,windows版本安装较简单,linux 版本安装较复杂,相关安装教程可百度搜索“Nginx 安装” 三、配置工作 1、Nginx安装好后,找到其目录下的conf/文件,修改其配置,文件样例如下,注意真正需 要修改配置的地方为红色放大标注的: #user nobody; worker_processes 1; #error_log logs/; #error_log logs/ notice;

Apache 安装图解

Apache安装图解

一、安装Apache,配置成功一个普通网站服务器 运行下载好的“apache_2.0.55-win32-x86”,出现如下界面: 出现Apache HTTP Server 2.0.55的安装向导界面,点“Next”继续

确认同意软件安装使用许可条例,选择“I accept the terms in the license agreement”,点“Next”继续

将Apache安装到Windows上的使用须知,请阅读完毕后,按“Next”继续 设置系统信息,在Network Domain下填入您的域名(比如:https://www.360docs.net/doc/e69108296.html,),在Server Name下填入您的服务器名称(比如:https://www.360docs.net/doc/e69108296.html,,也就是主机名加上域名),在Administrator's Email Address下填入系统管理员的联系电子邮件地址(比如:yinpeng@https://www.360docs.net/doc/e69108296.html,),上述三条信息仅供参考,其中联系电子邮件地址会在当系统故障时提供给访问者,三条信息均可任意填写,无效的也行。下面有两个选择,图片上选择的是为系统所有用户安装,使用默认的80端口,并作为系统服务自动启动;另外一个是仅为当前用户安装,使用端口8080,手动启动。一般选择如图所示。按“Next”继续。]

选择安装类型,Typical为默认安装,Custom为用户自定义安装,我们这里选择Custom,有更多可选项。按“Next”继续 出现选择安装选项界面,如图所示,左键点选“Apache HTTP Server

2.0.55”,选择“This feature, and all subfeatures, will be installed on local hard drive.”,即“此部分,及下属子部分内容,全部安装在本地硬盘上”。点选“Change...”,手动指定安装目录。 我这里选择安装在“D:\”,各位自行选取了,一般建议不要安装在操作系统所在盘,免得操作系统坏了之后,还原操作把Apache配置文件也清除了。选“OK”继续。

Nginx反向代理Tomcat服务器

一、Tomcat 基本配置 1.为Tomcat提供SysV脚本 2.catalina 脚本讲解 3.telnet 登录管理Tomcat 4.配置Tomcat虚拟主机 5.Tomcat图形管理接口 6.部署JSP网站案例 二、Nginx反向代理Tomcat服务器 1.Nginx将请求反向代理到后端Tomcat 2.Nginx将图片缓存到本地 3.Nginx将请求实现动静分离 注,实验环境说明,操作系统:CentOS 6.4 x86_64,软件版本:jdk-7u40、 apache-tomcat-7.0.42、Nginx-1.4.2,博客中所用到的软件请到这里下载: https://www.360docs.net/doc/e69108296.html,/QGBCLwrZnpLMS。 一、Tomcat 基本配置 1.为Tomcat提供SysV脚本 注,在上一篇博文中我们已经演示安装了Tomcat,这里我们就不在演示,不清楚的博友可以参考这篇博文,https://www.360docs.net/doc/e69108296.html,/2033581/1299644,在上一篇博文中我们没有增加,SysV脚本,在这篇博文中我们来增加一下,下面我们就来具体演示一下。 [root@tomcat ~]# vim /etc/init.d/tomcat #!/bin/sh # Tomcat init script for Linux. #

# chkconfig: 2345 96 14 # description: The Apache Tomcat servlet/JSP container. CATALINA_HOME=/usr/local/tomcat #注意你的脚本路径 export CATALINA_HOME # export CATALINA_OPTS="-Xms128m -Xmx256m" exec $CATALINA_HOME/bin/catalina.sh $* 下面我们来增加执行权限,并加入服务列表设置开机自启动, [root@tomcat ~]# chmod +x /etc/init.d/tomcat [root@tomcat ~]# chkconfig --add tomcat [root@tomcat ~]# chkconfig tomcat --list tomcat 0:关闭1:关闭2:启用3:启用4:启用5:启用6:关闭 下面我们来启动一下Tomcat并测试一下, [root@tomcat ~]# service tomcat start Using CATALINA_BASE: /usr/local/tomcat Using CATALINA_HOME: /usr/local/tomcat Using CATALINA_TMPDIR: /usr/local/tomcat/temp Using JRE_HOME: /usr Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/to mcat-juli.jar 查看一下启动的端口号, [root@tomcat ~]# netstat -ntulp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Progra m name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1044/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1121/master tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 12988/sshd tcp 0 0 127.0.0.1:6011 0.0.0.0:* LISTEN 13053/sshd tcp 0 0 :::8080 :::* LISTEN 13088/java tcp 0 0 :::22 :::* LISTEN 1044/sshd tcp 0 0 ::1:25 :::* LISTEN 1121/master tcp 0 0 ::1:6010 :::* LISTEN 12988/sshd tcp 0 0 ::1:6011 :::* LISTEN 13053/sshd

Apache的ProxyPass指令详解

描述:将远程服务器映射到本地服务器的URL空间 语法:ProxyPass [路径] !|url [键=值键=值...]] [nocanon] 上下文:server config, virtual host, directory 状态:扩展 模块:mod_proxy 该指令可以将远程服务器映射到本地服务器的URL空间;本地的服务器并不是扮演传统意义上的代理服务器的角色,而是表现为远程服务器的一个镜像。此本地服务器常被成为反向代理(reversed proxy)或者是网关(gateway)。路径是指本地虚拟路径的名字;url指远程服务器的一个部分URL,不能包含查询字符串。 注意:在使用ProxyPass指令的时候,ProxyRequests指令通常都应该是关闭的。 假设本地服务器的地址是https://www.360docs.net/doc/e69108296.html,/ ,那么 ProxyPass /mirror/foo/ https://www.360docs.net/doc/e69108296.html,/ 将会把对https://www.360docs.net/doc/e69108296.html,/mirror/foo/bar的本地请求内部转换成到https://www.360docs.net/doc/e69108296.html,/bar的代理请求。 其中,!指令当你不想对某个子目录进行反向代理的时候就有用了,例如: ProxyPass /mirror/foo/i ! ProxyPass /mirror/foo https://www.360docs.net/doc/e69108296.html, 将会把所有的/mirror/foo请求重定向到https://www.360docs.net/doc/e69108296.html,除了对/mirror/foo/i的请求。 注意: 顺序很重要:排除的指令必须在一般的ProxyPass指令之前。 和Apache 2.1一样,具备了使用到后端服务器的线程池的能力。使用“键=值”的参数便可调节线程池的分配。硬性最大值(Hard Maximum)的默认值为当前MPM中每个进程的线程数量。在Prefork MPM中,该值总是为1,在Worker MPM中,该值受ThreadsPerChild控制。 设置min可以决定有多少到后端服务器的链接始终打开。根据需要最多创建数量为柔性最大值(Soft Maximum),也就是smax的链接。任何超出smax数量的链接都会指定一个生存时间也就是ttl。Apache不会同时创建超过硬性最大值(或max)数量的到后端服务器的链接。 ProxyPass /example https://www.360docs.net/doc/e69108296.html, smax=5 max=20 ttl=120 retry=300 参数默认值描述 min 0 到后端服务器的总是打开的链接最小数。 max 1…n 允许连接到后端服务器的硬性最大链接数。硬性最大值的默认值为当前MPM 中每个进程的线程数量。在Prefork MPM中,该值总是为1,在Worker MPM中,该值受ThreadsPerChild控制。

Apache安装配置SSL证书方法教程

Apache SSL证书安装配置方法教程 1.1 SSl证书安装环境简介 Centos 6.4 操作系统; Apache2.2.*或以上版本; Openssl 1.0.1+; SSL 证书一张(备注:本指南使用https://www.360docs.net/doc/e69108296.html, 域名OV SSL 证书进行操作,通用其它版本证书) 1.2 网络环境要求 请确保站点是一个合法的外网可以访问的域名地址,可以正常通过或http://XXX 进行正常访问。 2.1 生成请求文件csr 首先下载openssl软件,可以去openssl官网下载: https://www.360docs.net/doc/e69108296.html,/source/ 下载后安装到本地计算机。 2.1.1 查看openssl 在终端输入openssl version 查看openssl当前版本。 图 1 2.1.2 生成key私钥文件 使用以下命令来生成私钥:opensslgenrsa -des3 -out https://www.360docs.net/doc/e69108296.html,.key 2048,生成的私钥保存在当期目录。

图 2 2.1.3 生成csr文件 使用以下命令来生成私钥:opensslreq -new -key https://www.360docs.net/doc/e69108296.html,.key -out https://www.360docs.net/doc/e69108296.html,.csr 图 3 Country Name (2 letter code) [GB]: 输入国家地区代码,如中国的CN State or Province Name (full name) [Berkshire]: 地区省份 Locality Name (eg, city) [Newbury]: 城市名称 Organization Name (eg, company) [My Company Ltd]: 公司名称 Organizational Unit Name (eg, section) []: 部门名称

Apache服务器配置安全规范以及其缺陷

Apache服务器配置安全规范以及其缺陷!正如我们前言所说尽管Apache服务器应用最为广泛,设计上非常安全的程序。但是同其它应用程序一样,Apache也存在安全缺陷。毕竟它是完全源代码,Apache服务器的安全缺陷主要是使用HTTP 协议进行的拒绝服务攻击(denial of service)、缓冲区溢出攻击以及被攻击者获得root权限三缺陷和最新的恶意的攻击者进行拒绝服务(DoS)攻击。合理的网络配置能够保护Apache服务器免遭多种攻击。我们来介绍一下主要的安全缺陷。主要安全缺陷(1)使用HTTP协议进行的拒绝服务攻击(denial of service)的安全缺陷这种方法攻击者会通过某些手段使服务器拒绝对HTTP应答。这样会使Apache对系统资源(CPU时间和内存)需求的剧增,最终造成Apache系统变慢甚至完全瘫痪。(2)缓冲区溢出的安全缺陷该方法攻击者利用程序编写的一些缺陷,使程序偏离正常的流程。程序使用静态分配的内存保存请求数据,攻击者就可以发送一个超长请求使缓冲区溢出。(3)被攻击者获得root权限的安全缺陷该安全缺陷主要是因为Apache服务器一般以root权限运行(父进程),攻击者会通过它获得root权限,进而控制整个Apache系统。(4)恶意的攻击者进行拒绝服务(DoS)攻击的安全缺陷这个最新在6月17日发现的漏洞,它主要是存在于Apache的chunk encoding中,这是一个HTTP协议定义的用于接受web用户所提交数据的功能。所有说使用最高和最新安全版本对于加强Apache Web服务器的安全是至关重要的。正确维护和配置Apache服务器虽然Apache服务器的开发者非常注重安全性,由于Apache服务器其庞大的项目,难免会存在安全隐患。正确维护和配置Apache WEB服务器就很重要了。我们应注意的一些问题:(1)Apache服务器配置文件Apache Web服务器主要有三个配置文件,位于 /usr/local/apache/conf目录下。这三个文件是:httpd.conf-----主配置文件srm.conf------填加资源文件access.conf---设置文件的访问权限(2)Apache服务器的目录安全认证在Apache Server中是允许使用 .htaccess做目录安全保护的,欲读取这保护的目录需要先键入正确用户帐号与密码。这样可做为专门管理网页存放的目录或做为会员区等。在保护的目录放置一个档案,档名为.htaccss。AuthName 会员专区 AuthType BasicAuthUserFile /var/tmp/xxx.pw -----把password放在网站外 require valid-user 到apache/bin目录,建password档 % ./htpasswd -c /var/tmp/xxx.pw username1 -----第一次建档要用参数-c % /htpasswd /var/tmp/xxx.pw username2 这样就可以保护目录内的内容,进入要用合法的用户。注:采用了Apache内附的模组。也可以采用在httpd.conf中加入:options indexes followsymlinks allowoverride authconfig order allow,deny allow from all (3)Apache服务器访问控制我们就要看三个配置文件中的第三个文件了,即access.conf文件,它包含一些指令控制允许什么用户访问Apache目录。应该把deny from all设为初始化指令,再使用allow from指令打开访问权限。order deny,allowdeny from allallow from https://www.360docs.net/doc/e69108296.html, 设置允许来自某个域、IP地址或者IP段的访问。(4)Apache服务器的密码保护问题我们再使 用.htaccess文件把某个目录的访问权限赋予某个用户。系统管理员需要在httpd.conf或者rm.conf文件中使用 AccessFileName指令打开目录的访问控制。如:AuthName PrivateFilesAuthType BasicAuthUserFile /path/to/httpd/usersrequire Phoenix# htpasswd -c /path/to/httpd/users Phoenix设置Apache服务器的WEB和文件服务器我们在Apache服务器上存放WEB 服务器的文件,供用户访问,并设置/home/ftp/pub目录为文件存放区域,用

Apache+Php5.3.8的安装与配置方法

Apache的安装与配置 打开apache官方网站https://www.360docs.net/doc/e69108296.html,/dist/httpd/binaries/win32/或者镜像网站https://www.360docs.net/doc/e69108296.html,/httpd/binaries/win32/,下载里面的apache_2.2.20-win32-x86-no_ssl.msi安装文件。其中,同一版本有两种类型:no_ssl和openssl,openssl多了个ssl安全认证模式,它的协议是HTTPS 而不是HTTP,这就是带有SSL的服务器与一般网页服务器的区别了。一般情况下,我们下载no_ssl版本的就ok了。 下载好apache安装文件后,点击安装,在连续3次next后,将进入server information配置界面,要求输入network domain、server domain和网站管理员的邮箱地址,普通用户可以随便按照格式填一下就行了。再次按Next后,出现选择安装路径的界面,默认的路径比较长,pharmar把安装路径修改为:“D:\Program Files\Apache\”,继续安装,直到完成。 安装完毕,apache就自动启动,可以测试apache是否成功启动。在浏览器地址栏里输入:http://localhost/或http://127.0.0.1/,如果出现“It works.”,那么恭喜你,apache已经成功安装了;同时在电脑右下角的任务栏里有一个绿色的apache服务器运行图标。 apache还有一个配置文件:httpd:conf 需要配置,以便php运行。位置为:D:\Program Files\Apache\conf目录里。打开httpd:conf: 1)、查找“DocumentRoot”,这里是指定主页放置的目录。默认是:“D:\Program Files\Apache\htdocs”,你可以使用默认的目录,也可以自己定义一个,如:“D:/PHP”。注意:目录末尾不要加“/”。 2)、查找“DirectoryIndex”,这里是默认首页文件名,可以在index.html 的后面加入index.php等。每种类型之间都要留一个空格。 3)、查找 Options FollowSymLinks AllowOverride None Order deny,allow Deny from all 修改为: Options FollowSymLinks AllowOverride None Order deny,allow allow from all 如果不改这里的话,可能会出现You don't have permission to access / on this server. 这样的错误提示,尤其在改变了默认主页的路径后。

Apache+WebSphere服务器部署方案

Apache+WebSphere 服务器部署方案 版本号:V1.1 2011年9月

目录 重要提示 (2) 1Linux 安装 (2) 1.1安装全部程序 (2) 1.2安装源设置 (2) 2Apache安装 (3) 2.1准备安装 (3) 2.2安装Apache Web Server (3) 2.3验证安装 (4) 2.4编译代理/反向代理模块 (5) 2.5配置代理/反向代理模块 (6) 2.6创建配置文件crossdomain.xml (8) 2.7Apache中文乱码问题解决 (8) 2.8配置RewriteRule (11) 3Was7 Plugin安装 (11) 3.1Websphere常用命令 (12) 3.2JDNI配置 (12) 3.3应用服务器单机版配置 (16) 3.4应用服务器集群版配置 (16) 4常见问题 (23) 4.1环境问题 (23) 4.2应用问题 (24)

重要提示 Web服务器包括apache的安装部署和WAS7 Plugin安装部署两部分,如果的websphere应用服务器使用非集群模式,plugin则不需要安装,只需配置本文2.1章节内容,如果websphere应用服务器使用群集模式,则需要按照本文2.2章节进行plugin安装配置。 1Linux 安装 1.1 系统安装 1.根分区磁盘容量应大于20G 2.推荐安装所有应用程序 1.2 安装源设置 图中黑色边框指示设置系统安装源,尤其在服务器无法连接外网时需要使用光盘作为安装源

2Apache安装 2.1 准备安装 关闭系统自带的web服务: #chkconfig httpd off 安装gcc(适用于系统没有安装gcc时) #yum install gcc* (yum install gcc-c++ libstdc++-devel) 出现y/n提示时,输入y 下载并解压安装程序: #cd ~/ #wget https://www.360docs.net/doc/e69108296.html,/httpd/httpd-2.2.15.tar.gz #tar –zxvf httpd-2.2.15.tar.gz -C /usr/src 把包解压到/usr/src 2.2 安装Apache Web Server 进入源码目录: #cd /usr/src/httpd-2.2.15 配置编译文件: #./configure --prefix=/opt/apache --enable-so --enable-mods-shared=most --with-mpm=worker 编译文件: #make

相关文档
最新文档