apache2 httpd.conf配置文件样例

使用vhost_alias的可运行的httpd.conf样例

 

ServerTokens Prod

ServerRoot “/etc/httpd”

PidFile run/httpd.pid

Timeout 120

KeepAlive Off

MaxKeepAliveRequests 100

KeepAliveTimeout 15

<IfModule prefork.c>
StartServers       8
MinSpareServers    5
MaxSpareServers   20
ServerLimit      256
MaxClients       256
MaxRequestsPerChild  4000
</IfModule>

<IfModule worker.c>
StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0
</IfModule>

Listen 80

LoadModule access_module modules/mod_access.so
LoadModule auth_module modules/mod_auth.so
LoadModule auth_anon_module modules/mod_auth_anon.so
LoadModule auth_dbm_module modules/mod_auth_dbm.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule ldap_module modules/mod_ldap.so
LoadModule auth_ldap_module modules/mod_auth_ldap.so
LoadModule include_module modules/mod_include.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule env_module modules/mod_env.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule expires_module modules/mod_expires.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule headers_module modules/mod_headers.so
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule setenvif_module modules/mod_setenvif.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 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 imap_module modules/mod_imap.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
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule cache_module modules/mod_cache.so
LoadModule suexec_module modules/mod_suexec.so
LoadModule disk_cache_module modules/mod_disk_cache.so
LoadModule file_cache_module modules/mod_file_cache.so
LoadModule mem_cache_module modules/mod_mem_cache.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule version_module modules/mod_version.so

Include conf.d/*.conf

User apache
Group apache

ServerAdmin root@localhost

UseCanonicalName Off
DocumentRoot “/var/www/html”
VirtualDocumentRoot “/www/%0″

#DocumentRoot “/var/www/html”

<Directory />
    Options Includes ExecCGI FollowSymLinks
    AllowOverride None
</Directory>

#<Directory “/var/www/html”>

#    Options FollowSymLinks

#    AllowOverride All

#    Order allow,deny
#    Allow from all

#</Directory>

<IfModule mod_userdir.c>
    UserDir disable

</IfModule>

DirectoryIndex index.html index.htm index.php index.cgi

AccessFileName .htaccess

<Files ~ “^\.ht”>
    Order allow,deny
    Deny from all
</Files>

TypesConfig /etc/mime.types

DefaultType text/plain

<IfModule mod_mime_magic.c>
    MIMEMagicFile conf/magic
</IfModule>

HostnameLookups Off

ErrorLog logs/error_log

LogLevel warn

LogFormat “%h %l %u %t \”%!414r\” %>s %b \”%{Referer}i\” \”%{User-Agent}i\”" combined
LogFormat “%h %l %u %t \”%r\” %>s %b” common
LogFormat “%{Referer}i -> %U” referer
LogFormat “%{User-agent}i” agent

CustomLog logs/access_log combined

ServerSignature Off

<IfModule mod_dav_fs.c>
    DAVLockDB /var/lib/dav/lockdb
</IfModule>

IndexOptions FancyIndexing VersionSort NameWidth=*

AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*

AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core

AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^

DefaultIcon /icons/unknown.gif

ReadmeName README.html
HeaderName HEADER.html

AddLanguage ca .ca
AddLanguage cs .cz .cs
AddLanguage da .dk
AddLanguage de .de
AddLanguage el .el
AddLanguage en .en
AddLanguage eo .eo
AddLanguage es .es
AddLanguage et .et
AddLanguage fr .fr
AddLanguage he .he
AddLanguage hr .hr
AddLanguage it .it
AddLanguage ja .ja
AddLanguage ko .ko
AddLanguage ltz .ltz
AddLanguage nl .nl
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pl .po
AddLanguage pt .pt
AddLanguage pt-BR .pt-br
AddLanguage ru .ru
AddLanguage sv .sv
AddLanguage zh-CN .zh-cn
AddLanguage zh-TW .zh-tw

LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW

ForceLanguagePriority Prefer Fallback

AddDefaultCharset GB2312

AddCharset ISO-8859-1  .iso8859-1  .latin1
AddCharset ISO-8859-2  .iso8859-2  .latin2 .cen
AddCharset ISO-8859-3  .iso8859-3  .latin3
AddCharset ISO-8859-4  .iso8859-4  .latin4
AddCharset ISO-8859-5  .iso8859-5  .latin5 .cyr .iso-ru
AddCharset ISO-8859-6  .iso8859-6  .latin6 .arb
AddCharset ISO-8859-7  .iso8859-7  .latin7 .grk
AddCharset ISO-8859-8  .iso8859-8  .latin8 .heb
AddCharset ISO-8859-9  .iso8859-9  .latin9 .trk
AddCharset ISO-2022-JP .iso2022-jp .jis
AddCharset ISO-2022-KR .iso2022-kr .kis
AddCharset ISO-2022-CN .iso2022-cn .cis
AddCharset Big5        .Big5       .big5
AddCharset WINDOWS-1251 .cp-1251   .win-1251
AddCharset CP866       .cp866
AddCharset KOI8-r      .koi8-r .koi8-ru
AddCharset KOI8-ru     .koi8-uk .ua
AddCharset ISO-10646-UCS-2 .ucs2
AddCharset ISO-10646-UCS-4 .ucs4
AddCharset UTF-8       .utf8

AddCharset GB2312      .gb2312 .gb
AddCharset utf-7       .utf7
AddCharset utf-8       .utf8
AddCharset big5        .big5 .b5
AddCharset EUC-TW      .euc-tw
AddCharset EUC-JP      .euc-jp
AddCharset EUC-KR      .euc-kr
AddCharset shift_jis   .sjis

AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz

AddHandler cgi-script .cgi .pl

AddHandler imap-file map

AddHandler type-map var

AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

Alias /error/ “/var/www/error/”

<IfModule mod_negotiation.c>
<IfModule mod_include.c>
    <Directory “/var/www/error”>
        AllowOverride All
        Options IncludesNoExec
        AddOutputFilter Includes html
        AddHandler type-map var
        Order allow,deny
        Allow from all
        LanguagePriority en es de fr
        ForceLanguagePriority Prefer Fallback
    </Directory>

</IfModule>
</IfModule>

BrowserMatch “Mozilla/2″ nokeepalive
BrowserMatch “MSIE 4\.0b2;” nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch “RealPlayer 4\.0″ force-response-1.0
BrowserMatch “Java/1\.0″ force-response-1.0
BrowserMatch “JDK/1\.0″ force-response-1.0

BrowserMatch “Microsoft Data Access Internet Publishing Provider” redirect-carefully
BrowserMatch “^WebDrive” redirect-carefully
BrowserMatch “^WebDAVFS/1.[012]” redirect-carefully
BrowserMatch “^gnome-vfs” redirect-carefully

Alias /awstatsclasses “/usr/local/awstats/wwwroot/classes/”
Alias /awstatscss “/usr/local/awstats/wwwroot/css/”
Alias /awstatsicons “/usr/local/awstats/wwwroot/icon/”
Alias /pma “/www/phpMyAdmin-2.11.11.3-all-languages”
ScriptAlias /awstats/ “/usr/local/awstats/wwwroot/cgi-bin/”

<Directory “/usr/local/awstats/wwwroot”>
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

H3C路由器内网用户通过域名访问内网服务器的配置方法

一、
组网需求:

内网中存在两台服务器分别对外提供www及ftp服务,网关路由器公网接口上已下发nat server 配置。DNS服务器位于公网,将两台服务器的对应的域名映射到公网出口地址202.38.1.1上,公网用户可以通过域名访问服务器。
要求:内网用户可以使用域名访问内网的两台服务器。
涉及产品:SR6600路由器
二、
方案一:DNS-mapping 方案:
在SR6600路由器上配置DNS map功能,可以建立域名-公网地址-公网端口号-服务协议的匹配表项。当内网用户发出的DNS解析请求得到的DNS Server响应到达配置了NAT server 的公网出接口时,接口上查找到DNS map表项后会将内网服务器的地址替换解析到的公网地址,主机就可以使用内网地址直接访问服务器。
方案二利用NATNAT Server下发在内网网关接口上,使内网主机通过公网地址去访问服务器。
在不使用DNS-mapping的情况下,主机用域名访问服务器意味着主机必须能使用公网地址(202.38.1.1)去访问内网服务器。通过将NAT和NATServer 配置下发在内网网关接口上可以满足该应用(原先下发在公网接口上的nat server 配置是为了满足公网用户访问的,该部分配置不变)。
三、
配置步骤:

方案一配置

<H3C>system-view
[H3C]sysname Gateway
[Gateway]interface g0/1
[Gateway-GigabitEthernet0/1]ip address 202.38.1.1 24
[Gateway-GigabitEthernet0/1]nat server protocol tcp global 202.38.1.1 www inside 10.110.1.1 www
[Gateway-GigabitEthernet0/1]nat server protocol tcp global 202.38.1.1 ftp inside 10.110.1.2 ftp
[Gateway-GigabitEthernet0/1]quit
[Gateway]interface g0/0
[Gateway-GigabitEthernet0/0]ip address 10.110.1.10 24
[Gateway-GigabitEthernet0/0]quit
//注意dns-map配置中对应的地址是公网地址而不是服务器的内网地址

[Gateway]nat dns-map domain www.server.com protocol tcp ip 202.38.1.2 port www

[Gateway]nat dns-map domain ftp.server.com protocol tcp ip 202.38.1.2 port ftp

方案二配置

<H3C>system-view
[H3C]sysname Gateway
[Gateway]acl number 3000
//编写acl匹配来自内网网段目的地址为两台server的数据流
[Gateway-acl-adv-3000]rule permit ip source 10.110.1.0 0.0.0.255 destination 10.110.1.1 0
[Gateway-acl-adv-3000] rule permit ip source 10.110.1.0 0.0.0.255 destination 10.110.1.2 0
[Gateway]interface g0/0
[Gateway-GigabitEthernet0/0]ip address 10.110.1.10 24
//将nat及nat server配置下发在内网网关口上
[Gateway-GigabitEthernet0/0]nat server protocol tcp global 202.38.1.1 www inside 10.110.1.1 www
[Gateway-GigabitEthernet0/0]nat server protocol tcp global 202.38.1.1 ftp inside 10.110.1.2 ftp
[Gateway-GigabitEthernet0/0]nat outbound 3000
[Gateway-GigabitEthernet0/0]quit
//其它基础配置略

四、
配置关键点:
1.注意dns-map的配置中的ip地址应该配置公网出接口地址。
Nat server 的相关配置应该下发在公网出接口上。
2.在方案二中,nat server 及 nat outbound的配置应当配置在内网网关接口上。并且注意acl 规则中的目的地址应匹配服务器主机地址。

悲催的程序员

未命名

不解释~

hp storageworks xp系列产品初始化

HP StorageWorks XP系列产品初始化,需要在SVP下使用CTRL+SHIFT+I键和4块磁盘(2D+2P),进入向导,然后一部一部进行就可以了。

HPUX中SYSLOG报CIMSERVER:PSG13606的解决方案

这个是因为WBEMP-Storage版本太低引起的。

在11.31中,升级WBEMP-Storage需要注意如下步骤:

1.确定下载的WBEMSvcs_A.02.09_HP-UX_B.11.31_IA_PA.depot,DiagProdCollections_C.02.01,DASProvider_B.11.31.0909.02_HP-UX_B.11.31_IA_PA.depot文件的md5值正确,把这些文件上传到/tmp目录下,我这里是/tmp/hp/13606

2.swinstall –s hostname:/tmp/hp/13606/WBEMSvcs_A.02.09_HP-UX_B.11.31_IA_PA.depot

mark后安装。

3.swverify WBEMServices

4.swinstall –s hostname:/tmp/hp/13606/DiagProdCollections_C.02.01,选择ProviderSvcsBase安装

5.swinstall –s hostname:/tmp/hp/13606/DASProvider_B.11.31.0909.02_HP-UX_B.11.31_IA_PA.depot

6.swverify WBEMP-Storage

7./sbin/init.d/cim_server stop;sleep 10
  /sbin/init.d/cim_server start

8.观察几天/var/adm/syslog/syslog.log,看看还有没有报错的现象。

电梯灵魂,感受穿越

今天中午吃饭,感受了把电梯掉下来的感觉,事情是这样的:
十一点二十五分,我们照例出了机房去三楼坐电梯,我和刘一走在最后面,当时电梯里面人就很多了,我在犹豫是否要做的时候,跟刘一说咱俩估计上不去了(他有二百多斤的身材),他说能上,我们就上去了,关门启动,就发现动静不对,有人就说电梯动静不对啊,突然就咣一下,停了,我顺着电梯缝往外看,一片阳光,电梯指示七楼,他们都说憋电梯里了,我觉得应该是一楼,我们让电梯控制盘旁边的保安按紧急呼救钮,他说不好使,打手机(当时他没带手机),大家都掏手机,就有人说没信号,我掏出来也没信号,我把手机往电梯缝凑合,有信号了,我问了保安号码,给罗师傅打了电话,并告知他可能在一楼,他在一楼扒开电梯,发现了我们,我们顺利的出来了,一查人,十七个人左右,绝对超载,我们出来后走楼梯吃饭去了。
坦白说,并没有感觉电梯在下降,除了咣宕一声,也没感觉多恐怖,也没有盗梦空间里那种穿越的感觉,我们笑称之“人生阅历”,下午我们估算了一下,大概在1500公斤左右,电梯额定13人,1000公斤。
就这么多,姑且留以记录。

使用Wordmobi发布

十一放假,节后上班

下雨,没处去。

很有意思的图片们

基于类CISCO路由器的L2TP VPN的研究

手里有一台MAIPU MP2600C路由器,以前就跟迈普工程师咨询过PPTP,L2TP,IPSEC的VPN的传输,目的是使用windows VPN拨号拨入路由器获得内网地址,从而访问内网资源,但是迈普的工程师们好像只做点对点的路由加密隧道,不做点对多点的用户隧道。经过搜索网上的资源和调试,我终于调试通了无IPSEC加密的L2TP VPN隧道,现将主要配置张贴如下,给大家以参考,欢迎大家指正

 

hostname Router
service password-encrypt
no service new-encrypt
service login-secure

enable password XXXXXXX encrypt

//添加PPP用户user密码xxx

user  user password 7 XXXXXXXX

//设置vpn自动获取地址池为192.168.85.10-192.168.85.20
ip local pool vpn-add-pool 192.168.85.10 192.168.85.20

ip mef

ip load-sharing per-destination

//访问控制列表

ip access-list standard 1
10 permit 192.168.1.0 0.0.0.255

//这句是允许vpn拨入的共享internet出口网关,否则只能访问内网,不能访问公网
20 permit 192.168.85.0 0.0.0.31
exit

//启动AAA认证,并将ppp认证指向local,这句不知道到底用没用于ppp验证,也有可能仅仅是用户ppp用户的telnet登录认证

aaa new-model
aaa authentication ppp default local

//定义虚拟模板1,设置加密方式ppp,对端ip地址为地址池分配,验证方式为chap和ms-chap,验证用户名为user,本地模版地址为192.168.85.1/24,地址转换为内网

interface virtual-template1
encapsulation ppp
peer default ip address pool vpn-add-pool
ppp authentication chap ms-chap
ppp chap hostname user
ip address 192.168.85.1 255.255.255.0
ip nat inside
exit

interface fastethernet0
ip address 192.168.1.1 255.255.255.0
ip nat inside
exit

interface fastethernet1
ip address 59.45.xx.xx 255.255.255.252
ip nat outside
exit

interface serial0
physical-layer sync
encapsulation hdlc
exit

interface null0

//内网地址转换/WEB服务器
ip nat inside source static tcp 192.168.1.250 443 59.45.xx.xx 443
ip nat inside source static tcp 192.168.1.250 21 59.45.xx.xx 21
ip nat inside source static tcp 192.168.1.250 80 59.45.xx.xx 80

//访问控制列表生效
ip nat inside source list 1 interface fastethernet1 overload

//vpdn使能

vpdn enable

//vpdn池 vpdn,协议方式为l2tp,应用虚拟模板1,隧道无验证。

vpdn-group vpdn
accept-dialin
  protocol l2tp
  virtual-template 1
  exit
no l2tp tunnel authentication
exit

//默认路由

ip route 0.0.0.0 0.0.0.0 59.45.xx.xx

line vty 0 4
password 7 xxxxxxx
exit

//原有内网dhcp地址池

ip dhcp excluded-address 192.168.1.2 192.168.1.99
ip dhcp pool 1
range 192.168.1.2 192.168.1.254 255.255.255.0
default-router 192.168.1.1
dns-server 219.150.32.132
lease 7 10 30
exit

clock timezone BEIJING

//本地统计与流控

local stat enable
set all receive-flow 1000
set all send-flow 1600
!end

红色的是新增加的,请指正。

还让不让人生活了?

今天下大暴雨了,整整下了一天,量非常大,碰巧(或者说不是碰巧)小区停电,家里没电没水,业主群都要闹疯了,大家在外面多呆一秒是一秒,我家楼上也传来隐隐约约的跟物业的争吵声,哎,这破物业,习惯了!幸好本本有电。

使用Wordmobi发布