关于提供个人主页服务器的问题!~~

由 ruochen 在 05-30-2003 11:32 发表:

关于提供个人主页服务器的问题!~~

我想在我们这里搞个提供个人主页的服务器!~现在目前的情况是apach+php+mysql和vsftp基本搞定!

我现在有问题需要大家的帮助!~

我想把用户限制在/home目录下!怎么建立用户,怎么个虚拟用户?(我想应该不是建立系统用户的)

我原来申请免费空间的时候就看见网站有个html和cgi_bin目录的,应该怎么做呢?

我在/var/www/html下建立夹子,上传页面,在浏览器是不能访问的(我想应该是缺少某些系统文件的支持吧)

我建立系统用户,在系统用户的/home下上传文件,在浏览器里也是不能打开的!我晕,我应该怎么做??


由 hgkrt 在 05-30-2003 11:37 发表:


用户是你系统的用户。。

让他看到~home/pub/users等。。。里有/html/cgi_bin


欢迎访问我的个人主页!!!

主机:

http://hgkrt.minidns.net/

网上空间:

http://www.paw.hi-ho.ne.jp/hgkrt


由 ruochen 在 05-30-2003 11:41 发表:


> quote: > > * * * > > 最初由 hgkrt 发表
>
> **用户是你系统的用户。。
>
>
>
> 让他看到~home/pub/users等。。。里有/html/cgi_bin ** > > * * *

就是为每个用户都开个系统用户?(我听说过什么虚拟用户的??听多了也晕呀)

/html/cgi_bin要拷贝什么系统文件吗??


由 quanliking 在 05-30-2003 12:15 发表:

回复: 关于提供个人主页服务器的问题!~~

> quote: > > * * * > > 最初由 ruochen 发表
>
> **我想在我们这里搞个提供个人主页的服务器!~现在目前的情况是apach+php+mysql和vsftp基本搞定!
>
>
>
> 我现在有问题需要大家的帮助!~
>
> 我想把用户限制在/home目录下!怎么建立用户,怎么个虚拟用户?(我想应该不是建立系统用户的)
>
>
>
> 我原来申请免费空间的时候就看见网站有个html和cgi_bin目录的,应该怎么做呢?
>
>
>
>
>
> 我在/var/www/html下建立夹子,上传页面,在浏览器是不能访问的(我想应该是缺少某些系统文件的支持吧)
>
> 我建立系统用户,在系统用户的/home下上传文件,在浏览器里也是不能打开的!我晕,我应该怎么做?? ** > > * * *

正好这段时间也弄过,我就讲一种简单一点的方法吧!

通过建立系统用户的方法:

1.建立组和用户

addgroup friend #建立组,组名自己定

useradd tom #建立一个用户, 用户名自己定

passwd tom

adduser tom friend #把用户 tom 加入到 friend 组

2.建立用户目录

由于 apache 默认的目录是 /var/www,所以这里我就不改了。

cd /var/www

mkdir home

cd home

mkdir tom #这个是用户 tom 的 home 目录

chown -R tom:fire ./tom #让 tom 成为目录的主人

3.修改 /etc/passwd

找到用户 tom,改成下面这个样子

tom❌102:65534::/var/www/home/tom:/bin/bash

这里最后部分 /bin/bash ,表示允许 tom 使用 bash,这样的话 tom 能使用 ssh 登陆服务器,能进行编译,允许程序等,权限比较大。

最好是改成 /bin/false , 禁用 bash

4.现在讲讲如何使用。

由于 tom 是系统用户,所以可以直接使用 ftp 登陆到 tom 的 home 目录

ftp ftp://tom:[email protected]

这样就能上传或下载或删除或修改文件了。

http://xxx.xxx.xxx.xxx/home/tom

可以看到传好的东西。

5.关于执行 cgi ,我这里有个很土的方法,供你参考。

vi /etc/apache/httpd.conf

首先确定 apache 已经加载了必要的 cgi 模块,这里不细说。

LoadModule cgi_module /usr/lib/apache/1.3/mod_cgi.so

。。。

加入这样一段:

 1<directory home="" var="" www="">   
 2  
 3Options Indexes Includes FollowSymLinks MultiViews ExecCGI   
 4  
 5AllowOverride None   
 6  
 7Order allow,deny   
 8  
 9Allow from all   
10  
11</directory>

然后重启 apache

现在你可以把 cgi 文件放到 /var/www/home 的任意一个位置,测试时注意 cgi 文件的权限。


由 ruochen 在 05-30-2003 12:49 发表:

回复: 回复: 关于提供个人主页服务器的问题!~~

> quote: > > * * * > > 最初由 quanliking 发表
>
> **正好这段时间也弄过,我就讲一种简单一点的方法吧!
>
>
>
> 通过建立系统用户的方法:
>
>
>
> 1.建立组和用户
>
> addgroup friend #建立组,组名自己定
>
> useradd tom #建立一个用户, 用户名自己定
>
> passwd tom
>
> adduser tom friend #把用户 tom 加入到 friend 组
>
>
>
> 2.建立用户目录
>
> 由于 apache 默认的目录是 /var/www,所以这里我就不改了。
>
> cd /var/www
>
> mkdir home
>
> cd home
>
> mkdir tom #这个是用户 tom 的 home 目录
>
> chown -R tom:fire ./tom #让 tom 成为目录的主人
>
>
>
> 3.修改 /etc/passwd
>
> 找到用户 tom,改成下面这个样子
>
> tom❌102:65534::/var/www/home/tom:/bin/bash
>
>
>
> 这里最后部分 /bin/bash ,表示允许 tom 使用 bash,这样的话 tom 能使用 ssh 登陆服务器,能进行编译,允许程序等,权限比较大。
>
> 最好是改成 /bin/false , 禁用 bash
>
>
>
> 4.现在讲讲如何使用。
>
> 由于 tom 是系统用户,所以可以直接使用 ftp 登陆到 tom 的 home 目录
>
>
>
> ftp ftp://tom:[email protected]
>
> 这样就能上传或下载或删除或修改文件了。
>
>
>
> http://xxx.xxx.xxx.xxx/home/tom
>
> 可以看到传好的东西。
>
>
>
> 5.关于执行 cgi ,我这里有个很土的方法,供你参考。
>
> vi /etc/apache/httpd.conf
>
> 首先确定 apache 已经加载了必要的 cgi 模块,这里不细说。
>
> LoadModule cgi_module /usr/lib/apache/1.3/mod_cgi.so
>
> 。。。
>
> 加入这样一段:
>
>

 1<directory home="" var="" www="">   
 2&gt;    
 3&gt;  Options Indexes Includes FollowSymLinks MultiViews ExecCGI   
 4&gt;    
 5&gt;  AllowOverride None   
 6&gt;    
 7&gt;  Order allow,deny   
 8&gt;    
 9&gt;  Allow from all   
10&gt;    
11&gt;  </directory>

>
>
>
> 然后重启 apache
>
> 现在你可以把 cgi 文件放到 /var/www/home 的任意一个位置,测试时注意 cgi 文件的权限。 ** > > * * *

谢谢你的帮助!~

我也不知道到底是个怎么虚拟用户,我看见建立系统用户挺占空间的 !~

就想着个别的办法了 !~~


由 ruochen 在 05-30-2003 16:23 发表:


quanliking兄弟!~请教你一下!

1.建立组和用户

addgroup friend #建立组,组名自己定-------应该是groupadd吧(在rh9.0的addgroup通过不了)

useradd tom #建立一个用户, 用户名自己定

passwd tom

adduser tom friend #把用户 tom 加入到 friend 组---出现[root@david root]# adduser wy grzy

usage: adduser [-u uid [-o]] [-g group] [-G group,...]

[-d home] [-s shell] [-c comment] [-m [-k template]]

[-f inactive] [-e expire ] [-p passwd] [-M] [-n] [-r] name

adduser -D [-g group] [-b base] [-s shell]

[-f inactive] [-e expire ]

You have new mail in /var/spool/mail/root

[root@david root]#

[root@david home]# chown -R wy:fire ./wy

chown: ‘wy:fire’: 无效的组

3.修改 /etc/passwd

找到用户 tom,改成下面这个样子

tom❌102:65534::/var/www/home/tom:/bin/bash

这里最后部分 /bin/bash ,表示允许 tom 使用 bash,这样的话 tom 能使用 ssh 登陆服务器,能进行编译,允许程序等,权限比较大。

最好是改成 /bin/false , 禁用 bash------------将bash该为nologin或者是false,用户wy就进不了ftp!

还有用什么样的url能访问/var/www/home/*下的各个用户的页面!~

谢谢!~

我的qq好是967409

你的呢??

能加一下吗???

我想请教!~


samaung753dfx+msikt333+duron1.2+128ram+GF2 400+st60G+ecom+samsung52cdrom

+rt8139

winxp+2000server+freebsd5.1+fedora1.0+debian3.0


由 quanliking 在 05-30-2003 17:13 发表:


哦,我打错了。

是 groupadd friend

我一般在 irc 上:

server : 211.92.88.40

channel: #linuxsir

可以用 xchat 上来和我聊天。


There are two distinct opinions:

One would say, "The love of money is the root of all evil."

The other, "The lack of money is the root of all evil."

Which one i should take, that is the question.


由 ruochen 在 05-30-2003 20:21 发表:


> quote: > > * * * > > 最初由 quanliking 发表
>
> **哦,我打错了。
>
> 是 groupadd friend
>
>
>
> 我一般在 irc 上:
>
> server : 211.92.88.40
>
> channel: #linuxsir
>
> 可以用 xchat 上来和我聊天。 ** > > * * *

好的,谢谢你呀!~~


由 ruochen 在 05-31-2003 20:25 发表:


> quote: > > * * * > > 最初由 hgkrt 发表
>
> **用户是你系统的用户。。
>
>
>
> 让他看到~home/pub/users等。。。里有/html/cgi_bin ** > > * * *

兄弟,能仔细说说吗???

我搞到现在也没有搞定呀!~~~

我晕!~~~


由 ruochen 在 06-01-2003 20:37 发表:


我的个人主页服务器发问题还没有解决呀!~

passwd文件

wy❌10010:10011::/home/wy:/bin/bash

httpd.conf文件

httpd.conf - configuration for the Apache web server

Generated automatically... if you edit manually, the changes will be lost

the next time you run "apacheconfig".

Section 1: Global Environment

The directives in this section affect the overall operation of Apache,

such as the number of concurrent requests it can handle or where it

can find its configuration files.

Don't give away too much information about all the subcomponents

we are running. Comment out this line if you don't mind remote sites

finding out what major optional modules you are running

ServerTokens OS

ServerRoot: The top of the directory tree under which the server's

configuration, error, and log files are kept.

NOTE! If you intend to place this on an NFS (or otherwise network)

mounted filesystem then please read the LockFile documentation

(available at

   1<url: core.html#lockfile="" docs-2.0="" http:="" httpd.apache.org="" mod=""> );   
   2  
   3# you will save yourself a lot of trouble.   
   4  
   5#   
   6  
   7# Do NOT add a slash at the end of the directory path.   
   8  
   9#   
  10  
  11ServerRoot "/etc/httpd"   
  12  
  13  
  14  
  15#   
  16  
  17# ScoreBoardFile: File used to store internal server process information.   
  18  
  19# If unspecified (the default), the scoreboard will be stored in an   
  20  
  21# anonymous shared memory segment, and will be unavailable to third-party   
  22  
  23# applications.   
  24  
  25# If specified, ensure that no two invocations of Apache share the same   
  26  
  27# scoreboard file. The scoreboard file MUST BE STORED ON A LOCAL DISK.   
  28  
  29#   
  30  
  31#ScoreBoardFile run/httpd.scoreboard   
  32  
  33  
  34  
  35#   
  36  
  37# PidFile: The file in which the server should record its process   
  38  
  39# identification number when it starts.   
  40  
  41#   
  42  
  43PidFile "/var/run/httpd.pid"   
  44  
  45  
  46  
  47#   
  48  
  49# Timeout: The number of seconds before receives and sends time out.   
  50  
  51#   
  52  
  53TimeOut 300   
  54  
  55  
  56  
  57#   
  58  
  59# KeepAlive: Whether or not to allow persistent connections (more than   
  60  
  61# one request per connection). Set to "Off" to deactivate.   
  62  
  63#   
  64  
  65KeepAlive false   
  66  
  67  
  68  
  69#   
  70  
  71# MaxKeepAliveRequests: The maximum number of requests to allow   
  72  
  73# during a persistent connection. Set to 0 to allow an unlimited amount.   
  74  
  75# We recommend you leave this number high, for maximum performance.   
  76  
  77#   
  78  
  79MaxKeepAliveRequests 100   
  80  
  81  
  82  
  83#   
  84  
  85# KeepAliveTimeout: Number of seconds to wait for the next request from the   
  86  
  87# same client on the same connection.   
  88  
  89#   
  90  
  91KeepAliveTimeout 15   
  92  
  93  
  94  
  95##   
  96  
  97## Server-Pool Size Regulation (MPM specific)   
  98  
  99##   
 100  
 101  
 102  
 103# prefork MPM   
 104  
 105# StartServers: number of server processes to start   
 106  
 107# MinSpareServers: minimum number of server processes which are kept spare   
 108  
 109# MaxSpareServers: maximum number of server processes which are kept spare   
 110  
 111# MaxClients: maximum number of server processes allowed to start   
 112  
 113# MaxRequestsPerChild: maximum number of requests a server process serves   
 114  
 115<ifmodule prefork.c="">   
 116  
 117StartServers 8   
 118  
 119MinSpareServers 5   
 120  
 121MaxSpareServers 20   
 122  
 123MaxClients 150   
 124  
 125MaxRequestsPerChild 100   
 126  
 127</ifmodule>   
 128  
 129  
 130  
 131# worker MPM   
 132  
 133# StartServers: initial number of server processes to start   
 134  
 135# MaxClients: maximum number of simultaneous client connections   
 136  
 137# MinSpareThreads: minimum number of worker threads which are kept spare   
 138  
 139# MaxSpareThreads: maximum number of worker threads which are kept spare   
 140  
 141# ThreadsPerChild: constant number of worker threads in each server process   
 142  
 143# MaxRequestsPerChild: maximum number of requests a server process serves   
 144  
 145<ifmodule worker.c="">   
 146  
 147StartServers 2   
 148  
 149MaxClients 150   
 150  
 151MinSpareThreads 25   
 152  
 153MaxSpareThreads 75   
 154  
 155ThreadsPerChild 25   
 156  
 157MaxRequestsPerChild 0   
 158  
 159</ifmodule>   
 160  
 161  
 162  
 163# perchild MPM   
 164  
 165# NumServers: constant number of server processes   
 166  
 167# StartThreads: initial number of worker threads in each server process   
 168  
 169# MinSpareThreads: minimum number of worker threads which are kept spare   
 170  
 171# MaxSpareThreads: maximum number of worker threads which are kept spare   
 172  
 173# MaxThreadsPerChild: maximum number of worker threads in each server process   
 174  
 175# MaxRequestsPerChild: maximum number of connections per server process   
 176  
 177<ifmodule perchild.c="">   
 178  
 179NumServers 5   
 180  
 181StartThreads 5   
 182  
 183MinSpareThreads 5   
 184  
 185MaxSpareThreads 10   
 186  
 187MaxThreadsPerChild 20   
 188  
 189MaxRequestsPerChild 0   
 190  
 191</ifmodule>   
 192  
 193  
 194  
 195#   
 196  
 197# Listen: Allows you to bind Apache to specific IP addresses and/or   
 198  
 199# ports, in addition to the default. See also the <virtualhost>   
 200  
 201# directive.   
 202  
 203#   
 204  
 205# Change this to Listen on specific IP addresses as shown below to   
 206  
 207# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)   
 208  
 209#   
 210  
 211#Listen 12.34.56.78:80   
 212  
 213Listen *:80   
 214  
 215  
 216  
 217  
 218  
 219#   
 220  
 221# Load config files from the config directory "/etc/httpd/conf.d".   
 222  
 223#   
 224  
 225Include conf.d/*.conf   
 226  
 227  
 228  
 229#   
 230  
 231# Dynamic Shared Object (DSO) Support   
 232  
 233#   
 234  
 235# To be able to use the functionality of a module which was built as a DSO you   
 236  
 237# have to place corresponding `LoadModule' lines at this location so the   
 238  
 239# directives contained in it are actually available _before_ they are used.   
 240  
 241# Statically compiled modules (those listed by `httpd -l') do not need   
 242  
 243# to be loaded here.   
 244  
 245#   
 246  
 247# Example:   
 248  
 249# LoadModule foo_module modules/mod_foo.so   
 250  
 251#   
 252  
 253LoadModule access_module modules/mod_access.so   
 254  
 255LoadModule auth_module modules/mod_auth.so   
 256  
 257LoadModule auth_anon_module modules/mod_auth_anon.so   
 258  
 259LoadModule auth_dbm_module modules/mod_auth_dbm.so   
 260  
 261LoadModule auth_digest_module modules/mod_auth_digest.so   
 262  
 263LoadModule include_module modules/mod_include.so   
 264  
 265LoadModule log_config_module modules/mod_log_config.so   
 266  
 267LoadModule env_module modules/mod_env.so   
 268  
 269LoadModule mime_magic_module modules/mod_mime_magic.so   
 270  
 271LoadModule cern_meta_module modules/mod_cern_meta.so   
 272  
 273LoadModule expires_module modules/mod_expires.so   
 274  
 275LoadModule headers_module modules/mod_headers.so   
 276  
 277LoadModule usertrack_module modules/mod_usertrack.so   
 278  
 279LoadModule unique_id_module modules/mod_unique_id.so   
 280  
 281LoadModule setenvif_module modules/mod_setenvif.so   
 282  
 283LoadModule mime_module modules/mod_mime.so   
 284  
 285LoadModule dav_module modules/mod_dav.so   
 286  
 287LoadModule status_module modules/mod_status.so   
 288  
 289LoadModule autoindex_module modules/mod_autoindex.so   
 290  
 291LoadModule asis_module modules/mod_asis.so   
 292  
 293LoadModule info_module modules/mod_info.so   
 294  
 295LoadModule cgi_module modules/mod_cgi.so   
 296  
 297LoadModule dav_fs_module modules/mod_dav_fs.so   
 298  
 299LoadModule vhost_alias_module modules/mod_vhost_alias.so   
 300  
 301LoadModule negotiation_module modules/mod_negotiation.so   
 302  
 303LoadModule dir_module modules/mod_dir.so   
 304  
 305LoadModule imap_module modules/mod_imap.so   
 306  
 307LoadModule actions_module modules/mod_actions.so   
 308  
 309LoadModule speling_module modules/mod_speling.so   
 310  
 311LoadModule userdir_module modules/mod_userdir.so   
 312  
 313LoadModule alias_module modules/mod_alias.so   
 314  
 315LoadModule rewrite_module modules/mod_rewrite.so   
 316  
 317  
 318  
 319#   
 320  
 321# ExtendedStatus controls whether Apache will generate "full" status   
 322  
 323# information (ExtendedStatus On) or just basic information (ExtendedStatus   
 324  
 325# Off) when the "server-status" handler is called. The default is Off.   
 326  
 327#   
 328  
 329#ExtendedStatus On   
 330  
 331  
 332  
 333### Section 2: 'Main' server configuration   
 334  
 335#   
 336  
 337# The directives in this section set up the values used by the 'main'   
 338  
 339# server, which responds to any requests that aren't handled by a   
 340  
 341# <virtualhost> definition. These values also provide defaults for   
 342  
 343# any <virtualhost> containers you may define later in the file.   
 344  
 345#   
 346  
 347# All of these directives may appear inside <virtualhost> containers,   
 348  
 349# in which case these default settings will be overridden for the   
 350  
 351# virtual host being defined.   
 352  
 353#   
 354  
 355  
 356  
 357#   
 358  
 359# If you wish httpd to run as a different user or group, you must run   
 360  
 361# httpd as root initially and it will switch.   
 362  
 363#   
 364  
 365# User/Group: The name (or #number) of the user/group to run httpd as.   
 366  
 367# . On SCO (ODT 3) use "User nouser" and "Group nogroup".   
 368  
 369# . On HPUX you may not be able to use shared memory as nobody, and the   
 370  
 371# suggested workaround is to create a user www and use that user.   
 372  
 373# NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET)   
 374  
 375# when the value of (unsigned)Group is above 60000;   
 376  
 377# don't use Group #-1 on these systems!   
 378  
 379#   
 380  
 381User apache   
 382  
 383Group apache   
 384  
 385  
 386  
 387#   
 388  
 389# ServerAdmin: Your address, where problems with the server should be   
 390  
 391# e-mailed. This address appears on some server-generated pages, such   
 392  
 393# as error documents. e.g. [email protected]   
 394  
 395#   
 396  
 397ServerAdmin root@localhost   
 398  
 399  
 400  
 401#   
 402  
 403# ServerName gives the name and port that the server uses to identify itself.   
 404  
 405# This can often be determined automatically, but we recommend you specify   
 406  
 407# it explicitly to prevent problems during startup.   
 408  
 409#   
 410  
 411# If this is not set to valid DNS name for your host, server-generated   
 412  
 413# redirections will not work. See also the UseCanonicalName directive.   
 414  
 415#   
 416  
 417# If your host doesn't have a registered DNS name, enter its IP address here.   
 418  
 419# You will have to access it by its address anyway, and this will make   
 420  
 421# redirections work in a sensible way.   
 422  
 423#   
 424  
 425ServerName xy   
 426  
 427  
 428  
 429#   
 430  
 431# UseCanonicalName: Determines how Apache constructs self-referencing   
 432  
 433# URLs and the SERVER_NAME and SERVER_PORT variables.   
 434  
 435# When set "Off", Apache will use the Hostname and Port supplied   
 436  
 437# by the client. When set "On", Apache will use the value of the   
 438  
 439# ServerName directive.   
 440  
 441#   
 442  
 443UseCanonicalName on   
 444  
 445  
 446  
 447#   
 448  
 449# DocumentRoot: The directory out of which you will serve your   
 450  
 451# documents. By default, all requests are taken from this directory, but   
 452  
 453# symbolic links and aliases may be used to point to other locations.   
 454  
 455#   
 456  
 457DocumentRoot "/var/www/html"   
 458  
 459  
 460  
 461#   
 462  
 463# Disable autoindex for the root directory, and present a   
 464  
 465# default Welcome page if no other index page is present.   
 466  
 467#   
 468  
 469<locationmatch "^="" $"="">   
 470  
 471Options -Indexes   
 472  
 473ErrorDocument 403 /error/noindex.html   
 474  
 475</locationmatch>   
 476  
 477  
 478  
 479#   
 480  
 481# UserDir: The name of the directory that is appended onto a user's home   
 482  
 483# directory if a ~user request is received.   
 484  
 485#   
 486  
 487# The path to the end user account 'public_html' directory must be   
 488  
 489# accessible to the webserver userid. This usually means that ~userid   
 490  
 491# must have permissions of 711, ~userid/public_html must have permissions   
 492  
 493# of 755, and documents contained therein must be world-readable.   
 494  
 495# Otherwise, the client will only receive a "403 Forbidden" message.   
 496  
 497#   
 498  
 499# See also: http://httpd.apache.org/docs/misc/FAQ.html#forbidden   
 500  
 501#   
 502  
 503<ifmodule mod_userdir.c="">   
 504  
 505#   
 506  
 507# UserDir is disabled by default since it can confirm the presence   
 508  
 509# of a username on the system (depending on home directory   
 510  
 511# permissions).   
 512  
 513#   
 514  
 515#UserDir "disable"   
 516  
 517  
 518  
 519#   
 520  
 521# To enable requests to /~user/ to serve the user's public_html   
 522  
 523# directory, use this directive instead of "UserDir disable":   
 524  
 525#   
 526  
 527UserDir public_html   
 528  
 529  
 530  
 531</ifmodule>   
 532  
 533  
 534  
 535#   
 536  
 537# DirectoryIndex: sets the file that Apache will serve if a directory   
 538  
 539# is requested.   
 540  
 541#   
 542  
 543# The index.html.var file (a type-map) is used to deliver content-   
 544  
 545# negotiated documents. The MultiViews Option can be used for the   
 546  
 547# same purpose, but it is much slower.   
 548  
 549#   
 550  
 551DirectoryIndex   
 552  
 553  
 554  
 555#   
 556  
 557# AccessFileName: The name of the file to look for in each directory   
 558  
 559# for access control information. See also the AllowOverride directive.   
 560  
 561#   
 562  
 563AccessFileName .htaccess   
 564  
 565  
 566  
 567#   
 568  
 569# The following lines prevent .htaccess and .htpasswd files from being   
 570  
 571# viewed by Web clients.   
 572  
 573#   
 574  
 575<files "^\\.ht"="" ~="">   
 576  
 577Order allow,deny   
 578  
 579Deny from all   
 580  
 581</files>   
 582  
 583  
 584  
 585#   
 586  
 587# TypesConfig describes where the mime.types file (or equivalent) is   
 588  
 589# to be found.   
 590  
 591#   
 592  
 593TypesConfig "/etc/mime.types"   
 594  
 595  
 596  
 597#   
 598  
 599# DefaultType is the default MIME type the server will use for a document   
 600  
 601# if it cannot otherwise determine one, such as from filename extensions.   
 602  
 603# If your server contains mostly text or HTML documents, "text/plain" is   
 604  
 605# a good value. If most of your content is binary, such as applications   
 606  
 607# or images, you may want to use "application/octet-stream" instead to   
 608  
 609# keep browsers from trying to display binary files as though they are   
 610  
 611# text.   
 612  
 613#   
 614  
 615DefaultType text/plain   
 616  
 617  
 618  
 619#   
 620  
 621# The mod_mime_magic module allows the server to use various hints from the   
 622  
 623# contents of the file itself to determine its type. The MIMEMagicFile   
 624  
 625# directive tells the module where the hint definitions are located.   
 626  
 627#   
 628  
 629<ifmodule mod_mime_magic.c="">   
 630  
 631# MIMEMagicFile /usr/share/magic.mime   
 632  
 633MIMEMagicFile conf/magic   
 634  
 635</ifmodule>   
 636  
 637  
 638  
 639#   
 640  
 641# HostnameLookups: Log the names of clients or just their IP addresses   
 642  
 643# e.g., www.apache.org (on) or 204.62.129.132 (off).   
 644  
 645# The default is off because it'd be overall better for the net if people   
 646  
 647# had to knowingly turn this feature on, since enabling it means that   
 648  
 649# each client request will result in AT LEAST one lookup request to the   
 650  
 651# nameserver.   
 652  
 653#   
 654  
 655HostNameLookups Off   
 656  
 657  
 658  
 659#   
 660  
 661# ErrorLog: The location of the error log file.   
 662  
 663# If you do not specify an ErrorLog directive within a <virtualhost>   
 664  
 665# container, error messages relating to that virtual host will be   
 666  
 667# logged here. If you *do* define an error logfile for a <virtualhost>   
 668  
 669# container, that host's errors will be logged there and not here.   
 670  
 671#   
 672  
 673ErrorLog "/var/log/httpd/error_log"   
 674  
 675  
 676  
 677#   
 678  
 679# LogLevel: Control the number of messages logged to the error_log.   
 680  
 681# Possible values include: debug, info, notice, warn, error, crit,   
 682  
 683# alert, emerg.   
 684  
 685#   
 686  
 687LogLevel warn   
 688  
 689  
 690  
 691#   
 692  
 693# The following directives define some format nicknames for use with   
 694  
 695# a CustomLog directive (see below).   
 696  
 697#   
 698  
 699LogFormat "%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined   
 700  
 701LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common   
 702  
 703LogFormat "%{Referer}i -&gt; %U" referer   
 704  
 705LogFormat "%{User-agent}i" agent   
 706  
 707  
 708  
 709  
 710  
 711#   
 712  
 713# The location and format of the access logfile (Common Logfile Format).   
 714  
 715# If you do not define any access logfiles within a <virtualhost>   
 716  
 717# container, they will be logged here. Contrariwise, if you *do*   
 718  
 719# define per-<virtualhost> access logfiles, transactions will be   
 720  
 721# logged therein and *not* in this file.   
 722  
 723#   
 724  
 725# CustomLog logs/access_log common   
 726  
 727CustomLog logs/access_log combined   
 728  
 729  
 730  
 731#   
 732  
 733# If you would like to have agent and referer logfiles, uncomment the   
 734  
 735# following directives.   
 736  
 737#   
 738  
 739#CustomLog logs/referer_log referer   
 740  
 741#CustomLog logs/agent_log agent   
 742  
 743  
 744  
 745#   
 746  
 747# If you prefer a single logfile with access, agent, and referer information   
 748  
 749# (Combined Logfile Format) you can use the following directive.   
 750  
 751#   
 752  
 753#CustomLog logs/access_log combined   
 754  
 755  
 756  
 757#   
 758  
 759# Optionally add a line containing the server version and virtual host   
 760  
 761# name to server-generated pages (error documents, FTP directory listings,   
 762  
 763# mod_status and mod_info output etc., but not CGI generated documents).   
 764  
 765# Set to "EMail" to also include a mailto: link to the ServerAdmin.   
 766  
 767# Set to one of: On | Off | EMail   
 768  
 769#   
 770  
 771ServerSignature on   
 772  
 773  
 774  
 775#   
 776  
 777# Aliases: Add here as many aliases as you need (with no limit). The format is   
 778  
 779# Alias fakename realname   
 780  
 781#   
 782  
 783# Note that if you include a trailing / on fakename then the server will   
 784  
 785# require it to be present in the URL. So "/icons" isn't aliased in this   
 786  
 787# example, only "/icons/". If the fakename is slash-terminated, then the   
 788  
 789# realname must also be slash terminated, and if the fakename omits the   
 790  
 791# trailing slash, the realname must also omit it.   
 792  
 793#   
 794  
 795# We include the /icons/ alias for FancyIndexed directory listings. If you   
 796  
 797# do not use FancyIndexing, you may comment this out.   
 798  
 799#   
 800  
 801Alias /icons/ "/var/www/icons/"   
 802  
 803  
 804  
 805#   
 806  
 807# This should be changed to the ServerRoot/manual/. The alias provides   
 808  
 809# the manual, even if you choose to move your DocumentRoot. You may comment   
 810  
 811# this out if you do not care for the documentation.   
 812  
 813#   
 814  
 815Alias /manual "/var/www/manual"   
 816  
 817  
 818  
 819<ifmodule mod_dav_fs.c="">   
 820  
 821# Location of the WebDAV lock database.   
 822  
 823DAVLockDB /var/lib/dav/lockdb   
 824  
 825</ifmodule>   
 826  
 827  
 828  
 829#   
 830  
 831# ScriptAlias: This controls which directories contain server scripts.   
 832  
 833# ScriptAliases are essentially the same as Aliases, except that   
 834  
 835# documents in the realname directory are treated as applications and   
 836  
 837# run by the server when requested rather than as documents sent to the client.   
 838  
 839# The same rules about trailing "/" apply to ScriptAlias directives as to   
 840  
 841# Alias.   
 842  
 843#   
 844  
 845ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"   
 846  
 847  
 848  
 849<ifmodule mod_cgid.c="">   
 850  
 851#   
 852  
 853# Additional to mod_cgid.c settings, mod_cgid has Scriptsock <path>   
 854  
 855# for setting UNIX socket for communicating with cgid.   
 856  
 857#   
 858  
 859#Scriptsock logs/cgisock   
 860  
 861</path></ifmodule>   
 862  
 863  
 864  
 865  
 866  
 867#   
 868  
 869# Redirect allows you to tell clients about documents which used to exist in   
 870  
 871# your server's namespace, but do not anymore. This allows you to tell the   
 872  
 873# clients where to look for the relocated document.   
 874  
 875# Example:   
 876  
 877# Redirect permanent /foo http://www.andsky.com/bar   
 878  
 879  
 880  
 881#   
 882  
 883# Directives controlling the display of server-generated directory listings.   
 884  
 885#   
 886  
 887  
 888  
 889#   
 890  
 891# FancyIndexing is whether you want fancy directory indexing or standard.   
 892  
 893# VersionSort is whether files containing version numbers should be   
 894  
 895# compared in the natural way, so that `apache-1.3.9.tar' is placed before   
 896  
 897# `apache-1.3.12.tar'.   
 898  
 899#   
 900  
 901IndexOptions FancyIndexing VersionSort NameWidth=*   
 902  
 903  
 904  
 905#   
 906  
 907# AddIcon* directives tell the server which icon to show for different   
 908  
 909# files or filename extensions. These are only displayed for   
 910  
 911# FancyIndexed directories.   
 912  
 913#   
 914  
 915AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip   
 916  
 917  
 918  
 919AddIconByType (TXT,/icons/text.gif) text/*   
 920  
 921AddIconByType (IMG,/icons/image2.gif) image/*   
 922  
 923AddIconByType (SND,/icons/sound2.gif) audio/*   
 924  
 925AddIconByType (VID,/icons/movie.gif) video/*   
 926  
 927  
 928  
 929AddIcon /icons/binary.gif .bin .exe   
 930  
 931AddIcon /icons/binhex.gif .hqx   
 932  
 933AddIcon /icons/tar.gif .tar   
 934  
 935AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv   
 936  
 937AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip   
 938  
 939AddIcon /icons/a.gif .ps .ai .eps   
 940  
 941AddIcon /icons/layout.gif .html .shtml .htm .pdf   
 942  
 943AddIcon /icons/text.gif .txt   
 944  
 945AddIcon /icons/c.gif .c   
 946  
 947AddIcon /icons/p.gif .pl .py   
 948  
 949AddIcon /icons/f.gif .for   
 950  
 951AddIcon /icons/dvi.gif .dvi   
 952  
 953AddIcon /icons/uuencoded.gif .uu   
 954  
 955AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl   
 956  
 957AddIcon /icons/tex.gif .tex   
 958  
 959AddIcon /icons/bomb.gif core   
 960  
 961  
 962  
 963AddIcon /icons/back.gif ..   
 964  
 965AddIcon /icons/hand.right.gif README   
 966  
 967AddIcon /icons/folder.gif ^^DIRECTORY^^   
 968  
 969AddIcon /icons/blank.gif ^^BLANKICON^^   
 970  
 971  
 972  
 973#   
 974  
 975# DefaultIcon is which icon to show for files which do not have an icon   
 976  
 977# explicitly set.   
 978  
 979#   
 980  
 981DefaultIcon /icons/unknown.gif   
 982  
 983  
 984  
 985#   
 986  
 987# AddDescription allows you to place a short description after a file in   
 988  
 989# server-generated indexes. These are only displayed for FancyIndexed   
 990  
 991# directories.   
 992  
 993# Format: AddDescription "description" filename   
 994  
 995#   
 996  
 997#AddDescription "GZIP compressed document" .gz   
 998  
 999#AddDescription "tar archive" .tar   
1000  
1001#AddDescription "GZIP compressed tar archive" .tgz   
1002  
1003  
1004  
1005#   
1006  
1007# ReadmeName is the name of the README file the server will look for by   
1008  
1009# default, and append to directory listings.   
1010  
1011#   
1012  
1013# HeaderName is the name of a file which should be prepended to   
1014  
1015# directory indexes.   
1016  
1017ReadmeName README.html   
1018  
1019HeaderName HEADER.html   
1020  
1021  
1022  
1023#   
1024  
1025# IndexIgnore is a set of filenames which directory indexing should ignore   
1026  
1027# and not include in the listing. Shell-style wildcarding is permitted.   
1028  
1029#   
1030  
1031IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t   
1032  
1033  
1034  
1035#   
1036  
1037# AddEncoding allows you to have certain browsers (Mosaic/X 2.1+) uncompress   
1038  
1039# information on the fly. Note: Not all browsers support this.   
1040  
1041# Despite the name similarity, the following Add* directives have nothing   
1042  
1043# to do with the FancyIndexing customization directives above.   
1044  
1045#   
1046  
1047AddEncoding x-compress Z   
1048  
1049AddEncoding x-gzip gz tgz   
1050  
1051  
1052  
1053#   
1054  
1055# DefaultLanguage and AddLanguage allows you to specify the language of   
1056  
1057# a document. You can then use content negotiation to give a browser a   
1058  
1059# file in a language the user can understand.   
1060  
1061#   
1062  
1063# Specify a default language. This means that all data   
1064  
1065# going out without a specific language tag (see below) will   
1066  
1067# be marked with this one. You probably do NOT want to set   
1068  
1069# this unless you are sure it is correct for all cases.   
1070  
1071#   
1072  
1073# * It is generally better to not mark a page as   
1074  
1075# * being a certain language than marking it with the wrong   
1076  
1077# * language!   
1078  
1079#   
1080  
1081# DefaultLanguage nl   
1082  
1083#   
1084  
1085# Note 1: The suffix does not have to be the same as the language   
1086  
1087# keyword --- those with documents in Polish (whose net-standard   
1088  
1089# language code is pl) may wish to use "AddLanguage pl .po" to   
1090  
1091# avoid the ambiguity with the common suffix for perl scripts.   
1092  
1093#   
1094  
1095# Note 2: The example entries below illustrate that in some cases   
1096  
1097# the two character 'Language' abbreviation is not identical to   
1098  
1099# the two character 'Country' code for its country,   
1100  
1101# E.g. 'Danmark/dk' versus 'Danish/da'.   
1102  
1103#   
1104  
1105# Note 3: In the case of 'ltz' we violate the RFC by using a three char   
1106  
1107# specifier. There is 'work in progress' to fix this and get   
1108  
1109# the reference data for rfc1766 cleaned up.   
1110  
1111#   
1112  
1113# Danish (da) - Dutch (nl) - English (en) - Estonian (et)   
1114  
1115# French (fr) - German (de) - Greek-Modern (el)   
1116  
1117# Italian (it) - Norwegian (no) - Norwegian Nynorsk (nn) - Korean (kr)   
1118  
1119# Portugese (pt) - Luxembourgeois* (ltz)   
1120  
1121# Spanish (es) - Swedish (sv) - Catalan (ca) - Czech(cz)   
1122  
1123# Polish (pl) - Brazilian Portuguese (pt-br) - Japanese (ja)   
1124  
1125# Russian (ru) - Croatian (hr)   
1126  
1127#   
1128  
1129AddLanguage da .dk   
1130  
1131AddLanguage nl .nl   
1132  
1133AddLanguage en .en   
1134  
1135AddLanguage et .et   
1136  
1137AddLanguage fr .fr   
1138  
1139AddLanguage de .de   
1140  
1141AddLanguage he .he   
1142  
1143AddLanguage el .el   
1144  
1145AddLanguage it .it   
1146  
1147AddLanguage ja .ja   
1148  
1149AddLanguage pl .po   
1150  
1151AddLanguage kr .kr   
1152  
1153AddLanguage pt .pt   
1154  
1155AddLanguage nn .nn   
1156  
1157AddLanguage no .no   
1158  
1159AddLanguage pt-br .pt-br   
1160  
1161AddLanguage ltz .ltz   
1162  
1163AddLanguage ca .ca   
1164  
1165AddLanguage es .es   
1166  
1167AddLanguage sv .se   
1168  
1169AddLanguage cz .cz   
1170  
1171AddLanguage ru .ru   
1172  
1173AddLanguage tw .tw   
1174  
1175AddLanguage zh-tw .tw   
1176  
1177AddLanguage hr .hr   
1178  
1179  
1180  
1181#   
1182  
1183# LanguagePriority allows you to give precedence to some languages   
1184  
1185# in case of a tie during content negotiation.   
1186  
1187#   
1188  
1189# Just list the languages in decreasing order of preference. We have   
1190  
1191# more or less alphabetized them here. You probably want to change this.   
1192  
1193#   
1194  
1195LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ltz ca es sv tw   
1196  
1197  
1198  
1199#   
1200  
1201# ForceLanguagePriority allows you to serve a result page rather than   
1202  
1203# MULTIPLE CHOICES (Prefer) [in case of a tie] or NOT ACCEPTABLE (Fallback)   
1204  
1205# [in case no accepted languages matched the available variants]   
1206  
1207#   
1208  
1209ForceLanguagePriority Prefer Fallback   
1210  
1211  
1212  
1213#   
1214  
1215# Specify a default charset for all pages sent out. This is   
1216  
1217# always a good idea and opens the door for future internationalisation   
1218  
1219# of your web site, should you ever want it. Specifying it as   
1220  
1221# a default does little harm; as the standard dictates that a page   
1222  
1223# is in iso-8859-1 (latin1) unless specified otherwise i.e. you   
1224  
1225# are merely stating the obvious. There are also some security   
1226  
1227# reasons in browsers, related to javascript and URL parsing   
1228  
1229# which encourage</virtualhost></virtualhost></virtualhost></virtualhost></virtualhost></virtualhost></virtualhost></virtualhost></url:>
Published At
Categories with 服务器类
Tagged with
comments powered by Disqus