如标题,我用的是Fedora9,.想做个网站.
可是..在路由上映射外网后,我在自己内网打我域名网址访问投资
能访问到首页,.可.是再点开其它链接,再看IE地址栏里的地址 美容
就又变成内网如192..168.*.*的我的那台.Linux服务器的地址了.
是怎么回事儿?
apache php mysql我都用的是.光盘.自带的 外汇
apache版本:
Server version: Apach..e/2.2.9 (Unix).
Server bui.lt: Jul 14. 2008 15:36:56.
php版本:
PHP 5.2.6 (cli) (built: May .8 2008 10:23:54.).
Copyright (c) 1997.-2008 The. PHP Group投资
Zend Engine v2.2.0, Copyright (c) 1998-2008 .Zend T.echnologies 美容
MySQL版本:
+-----------+
| version() |
+-----------+
| 5.0.51a |
+-----------+
1 row in. set (0.00 sec) 电子
三个同时都启动了,另外
httpd.conf的配置如.下:.
原件在附件里
因贴子字数限制,我把httpd.conf中一些.不必的.略掉了 健康
我几乎啥都没改,.就改了红色字的部分: 建材
................. #贴子字数限制.,略掉了虚拟主机
#
# Do NOT .add a slash at the end of t.he directory path.电脑
#
Serve.rRoot "/etc/httpd"域名
#
# PidFile: The fi.le in which the server should record its. process外贸
# id.entification. number when it starts. 健康
#
PidFile. run/httpd.pid--- 印刷
#
# Timeout: The num.ber of seconds before receives and sends t.ime out.电影
#
Timeout 120
#
# KeepAlive: Whether or not to allow persistent connections (mo.re tha.n 建材
# one request .per connecti.on). Set to "Off" to deactivate..
#
KeepAlive Off
#
# MaxKeepAliveR.equests: The maximum number of requests to al.low 外汇
# during a persiste.nt connection. Set to 0 to allow .an unlimited amount.<性病>
# We recom.mend you leave this numb.er high, for maximum performance.<性病>
#
Max.KeepAliveRequests 100 电子
#
# KeepAliveTimeout: Number of seconds to wai.t for the next request from th.e教育
# s..ame client on the same connection. 健康
#
KeepAliveTimeout. 15<性病>
................. #贴子字数限制,略掉了..
# MaxReques.tsPerChild: maximum number of requests a server process serv.es电脑
<IfModu.le prefork.c> 电子
StartServers. 8投资
MinSpareSe.rvers 5.
MaxSpar.eServers 20 女人
S.erverLimit 256 婚庆
MaxClie.nts 256.
MaxReq.uestsPerChild 4000 杀毒
</IfModule>
# worker MPM
# StartServer.s: initial n.umber of server processes to start电影
# MaxClients: maximum number of simult.aneous client conn.ections健康
# MinSpareThreads: minimum number o.f worker threads which a.re kept spare 汽车
# MaxSpareThreads: maximum number of worker threads wh.ich are kept spa.re服务器
# ThreadsPerChild: constant number of worker thread.s in each server proc.ess( 游戏 )
# MaxRequestsPerChild: maximum number of requests a server pro.cess se.rves.
<IfModule worker..c>域名
Sta.rtServers 2虚拟主机
MaxClients . 150.
MinSp.areThreads 25域名
MaxSpare.Threads 75 --------------彩票
ThreadsPerChild .25.
MaxRequestsP.erChild 0健康
</IfModule>
#
# Listen: Allows you to bind Apache to specifi.c IP a.ddresses and/or 电子
# port.s, in addition to the default. See also. the <VirtualHost>--- 印刷
# directive.
#
# Change this t.o Listen on spec.ific IP addresses as shown below to .
#. prevent Apache from glomming onto all bou.nd IP addresses (0.0.0.0)电影
#
.Listen abcd.com:80 #然后,开启了这个.域名访问,假设我的域名为abcd.com.
#List.en 80 #我注释掉了原来的 女人
#
# Dynamic Shared O.bject (DSO) Su.pport 汽车
#
# To be able to use the functionality .of a module which was b.uilt as a DSO y.ou[成人用品]
# have to place corresponding `LoadModule' lines at this location so .th.e.
# .directives con.tained in it are actually available _before_ they are used..
# Statically c.ompiled modules (th.ose listed by `httpd -l') do not need电脑
# to be loaded her.e.
#
# Example:
#. LoadModule foo_module m.odules/mod_foo.so--- 印刷
#
LoadModule .auth_basic_module modules/mod_auth_basic.s.o.
LoadModule auth_.d.igest_module modules/mod_auth_digest.so(广告)
LoadModule authn_file_module modules/mo.d_aut.hn_file.so电脑
LoadModule authn_alias_module modul.es/m.od_authn_alias.so学习
LoadMo.dule authn_anon_module modules./mod_authn_anon.so服务器
LoadModule a.uthn_dbm_modul.e modules/mod_authn_dbm.so
LoadModule au.thn_default_module modules/mod_a.uthn_default.so[成人用品]
LoadModule authz_ho.st_module modules/.mod_authz_host.so.
LoadM.odule authz_user_module module.s/mod_authz_user.so 外汇
LoadModule authz_owner_module m.odules/mod_authz_own.er.so--- 印刷
LoadModule authz_groupfile_module modules/mod_.authz_groupfil.e.so电脑
Loa.dModule authz_dbm_module modules/mod_auth.z_dbm.so.
LoadModul.e authz_default_module m.odules/mod_authz_default.so( 游戏 )
Loa.dModule .ldap_module modules/mod_ldap.so域名
LoadModule authnz_ldap_.module modules/mod._authnz_ldap.so健康
LoadModule includ.e_module modules/mo.d_include.so健康
LoadModu.le log_config_module modules/mod_log_conf.ig.so.
LoadModule lo.gio_module modules./mod_logio.so<性病>
LoadModule en.v_module modules./mod_env.so.
LoadMo.dule ext_filter_module modul.es/mod_ext_filter.so.
Lo.adModule mi.me_magic_module modules/mod_mime_magic.so虚拟主机
LoadModule expires_m.odule modules/mo.d_expires.so.
LoadModule de.flate_module modu.les/mod_deflate.so教育
LoadM.odule headers_module .modules/mod_headers.so.
LoadModu.le usertrack_module modules/mod_.usertrack.so 鲜花
LoadM.odule setenvif_module module.s/mod_setenvif.so--------------彩票
LoadModu.le mime_module modules/mod_.mime.so 电子
LoadModule dav_module .modul.es/mod_dav.so外贸
Load.Module status_module modules/mod_statu.s.so 外汇
LoadModule autoind.ex_module mo.dules/mod_autoindex.so 美容
LoadModule info_module .modules/mod_.info.so 杀毒
LoadModule dav_fs_module modules/mod_dav_fs..s.o外贸
LoadModule vhost_ali.as_modul.e modules/mod_vhost_alias.so.
LoadModule negotiati.on_module mo.dules/mod_negotiation.so<性病>
LoadModule dir_module module.s/mod_dir.so. 美容
LoadModule actions_mo.dule modules/mod_actions.s.o.
LoadModule speling_module modul.es/mod_speling..so 婚庆
Loa.dModule user.dir_module modules/mod_userdir.so 婚庆
LoadModule alias_m.odule modul.es/mod_alias.so教育
LoadModule rewrite_.module modules/mod._rewrite.so电脑
Load.Module proxy_module modules/mod_proxy..so 乙肝
LoadModule pro.xy_balancer_module modules/mod_proxy_ba.lancer.so虚拟主机
LoadModule proxy_ftp_module. modules./mod_proxy_ftp.so 健康
LoadModule proxy_http_mod.ule modules/mod_proxy._http.so(广告)
L.oadModule proxy_connect_module modules/mod_proxy_conn.ect.so.
LoadModule c.ache_module modules/mod_cache.so..
L.oadModule suexec_module modules/mod_suex.ec.so电影
LoadModule disk_cache_modu.le modules/mod_.disk_cache.so.
LoadModule file_cache_module m.odu.les/mod_file_cache.so域名
LoadModul.e .mem_cache_module modules/mod_mem_cache.so电脑
LoadModule cgi_module module.s/mod._cgi.so服务器
#
# T.he following modules are .not loaded by default:学习
#
#LoadModule c.ern_meta_module modules./mod_cern_meta.so.
#LoadModule asis_module modul.es/mo.d_asis.so教育
#
# Load config files from the confi.g directory. "/etc/httpd/conf.d"..
#
Inclu.de conf.d/*.conf学习
#
.................. #贴子字数限制,略掉了(广告)
#
User apache
Group apache
### Section 2: 'Main' server c..onfiguration服务器
................. #贴子字数限.制,略掉了 美容
#
ServerAdmin
root@localho.st.域名
#
#.. ServerName gives the name and port that the server uses to i.dentify itself. 汽车
# This can often b.e determined auto.matically, but we recommend you specify域名
# it explicitly to. .prevent problems during startup.域名
#
# If this is not set to .valid DNS. name for your host, server-generated.
# redirect.ions will not work. See also the UseCanonical.Name directive.[成人用品]
#
# If .y.our host doesn't have a registered DNS name, enter its IP a.ddress here.
# You will have .to access it by its address anyway, and this wi.ll make .
# red.irections work in a sen.sible way..
#
#ServerName
www..example.com.:80( 游戏 )
ServerName abcd..com:80 #这里我增加了这么一行,假设我的域名为.:abcd.com(广告)
#
# UseCanonicalName: Deter.mines how Apache constructs self-referen.cing .
# URLs and the SERVER_NA.ME and SERVER._PORT variables..
# When s.et "Off", Apache will use the Hostname .and Port supplied.
# by the client. .When set "On", Apache will use th.e value of the 健康
# ServerName direc.tive..
#
UseCanonical.Name Off.
#
# DocumentRoot: The director.y out of which you will serve you.r.
#. documents. By default, all requests are. taken from this directory, but 婚庆
# symbolic links. and aliases may be used to poi.nt to other locations..
#
Doc.umen.tRoot "/var/www/html" 女人
#
# .Each directory to which Apache has access can be co.nfigured with respect.
# to .which services and features are allowed and/o.r disabled in that 健康
# direct.ory (and i.ts subdirectories). --- 印刷
#
# F.irst, we configure the "d.efault" to be a very restrictive set of 鲜花
# features.
#
<Directory />
O.ptions Fol.lowSymLinks( 游戏 )
AllowOve.rride None.
</Directory>
#
# Note that from th.is 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 specific.ally enabled .it外贸
# below.
#
#
# This s.hould be changed to whatever you set D.ocumentRoot to. 电子
#
<Directory "/va.r/www/html".>教育
#
................. #贴子字数限制,.略掉了 建材
#
Options .Indexe.s FollowSymLinks 建材
#
# AllowOverride controls what directives .may be placed in .ht.access files.健康
# It can be "All", "None", or any combination .of the .keywords:.
# Options FileInfo .AuthConfig. Limit 美容
#
All.owOverride None 汽车
#
# Contr.ols w.ho can get stuff from this server.外贸
#
Order al.low,deny投资
Allo.w from all--- 印刷
</Directory>
#
................. #贴子字数限制,略.掉了 外汇
#
<IfModule mod_userdi.r.c> 鲜花
#
# UserDir is disabled by default. s.ince it can confirm the presence--------------彩票
# of a username on the .syst.em (depending on home directory.
# permissi.ons).(广告)
#
. UserDir disable.
#
# To enable requests to /~user/ to serve the user's pu.blic_.html 建材
# directory, remove the "UserDir di.sable" line above,. and uncomment 婚庆
# the .following. line instead:--- 印刷
#
#UserDir public_.html.
</IfModule>
#
# Control acce.ss to .UserDir directories. The following is an example外贸
# for a si.te where these directories are restricted. to read-only..
#
#<Directo.ry /home/*/public_htm.l>( 游戏 )
# AllowOverri.de Fi.leInfo AuthConfig Limit 鲜花
# Options MultiViews In.dexes SymLinksIfOwnerMatch Include.sNoExec服务器
#. . <Limit GET POST OPTIONS>
# Order allow,den.y.
# Allow fro.m all 婚庆
# </Limit>
# <LimitExcept GET POST OP.TIONS.>.
# .Order deny,allow电脑
# . Deny from all.
# </Li.mitExcept> 外汇
#</Directory>
#
# DirectoryIndex: sets the file that Apache wi.ll serve if a dire.ctory域名
# i.s requested. 外汇
#
# The index.html.var file (a type-m.ap) is used to deliver content-. 杀毒
# negotiated documents. .The MultiViews Option can be .used for the 杀毒
#. same purpose, but it is mu.ch slower. 女人
#
DirectoryI.ndex index..html index.html.var[成人用品]
#
# AccessFileName: The name. of the file to look .for in each directory 建材
# for ad.ditional configuration directives. See. also the AllowOverride.
# directive.
#
AccessFile.Name .htaccess电影
#
# The following lines prevent .htaccess and .htpassw.d. files from being .
# vi.ewed by Web clients. .
#
<Files ~ "^.\.ht"> 建材
Order allow,d.eny 女人
. Deny from all 乙肝
</Files>
#
# TypesConfig describes where t.he mime.types file (or equivalent) i.s.
# to be found.
#
TypesConfi.g /etc/mime.t.ypes.
#
................. #.贴子字数限制,略掉了.
#
DefaultType text/.plain[成人用品]
#
# The mod_mime_magic module allows .the server to use various hint.s from the 电子
# contents of the file itself to determine its typ.e. The MI.MEMagicFile投资
# directive tells the mod.ule where the hint .definitions are located. 外汇
#
<IfMod.ule mo.d_mime_magic.c> 建材
# MIMEMagicFile /usr/sha.re/m.agic.mime 鲜花
. MIMEMagicFil.e conf/magic 外汇
</IfModule>
#
................. #贴.子字数限制,略掉了 乙肝
#
Ho.stnameLookups Off投资
#
................ #贴子字数限制.,略掉.了.
#
#
ErrorLog .logs/error_log学习
#
# LogLevel: Control the n.umber of messages l.ogged to the error_log.虚拟主机
# Possibl.e values. include: debug, info, notice, warn, error, crit, 电子
# a.lert, emerg.服务器
#
LogLevel warn
#
# The. following directiv.es define some format nicknames for use with<性病>
# a CustomLog direct.i.ve (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.
LogFormat "%.{Referer}i -> %U." referer.
LogForm.at "%{User.-agent}i" agent.
# "combinedio" includes actual counts of actual bytes received (%I) and. sent. (%.O); this 电子
................ #贴.子字数限制,略.掉了.
#
CustomLo.g logs/acces.s_log combined( 游戏 )
#
#
S.erverSignature On 鲜花
#
# do not use FancyIndexing, you may .comment thi.s out.健康
#
Alias /icons/ "/.var/www/ic.ons/" 鲜花
<Directory "/va.r/w.ww/icons"> 乙肝
Options Index.es MultiViews FollowS.ymLinks.
AllowOv.erride None 鲜花
. Order allow,deny学习
Allow .from all服务器
</Directory>
#
# We.bDAV module configurat.ion section.<性病>
#
<.IfModule mod_dav_fs.c>域名
# .L.ocation of the WebDAV lock database.健康
DAV.LockDB /var/lib/dav/l.ockdb教育
</IfModule>
#
ScriptAli.as /cgi-bin/ "/var/www/cgi.-bin/"学习
#
# "/var/www/cgi-bin" should be c.hanged to whateve.r your ScriptAliased.
# CGI directory exists, i.f you have. that configured.服务器
#
<Directory "/..var/www/cgi-bin">.
AllowOverrid.e None外贸
. Options None.
. Order allow,deny 汽车
. Allow from all( 游戏 )
</Directory>
#
IndexOpt.ions FancyIndexing VersionSort NameWidth=* HTMLTabl.e.
#
.................. #贴子字数限制,略掉了 美容
#
AddIconByEncodi.ng (CMP,/icons/compressed.gif) x-compress x-gzi.p.
AddIconByType. (.TXT,/icons/text.gif) text/*[成人用品]
AddIco.nByType (IMG,/icons/image2.gif) im.age/*教育
AddIconByType (S.ND,/.icons/sound2.gif) audio/*投资
A.ddIconByType (VID,/icons/movie.g.if) video/*.
AddIcon /icon.s/bin.ary.gif .bin .exe 鲜花
AddIcon /.icons/binhe.x.gif .hqx教育
AddIcon /.ic.ons/tar.gif .tar.
AddIcon /icons/wor.ld2.gif .wrl .wrl.gz .vrml ..vrm .iv 女人
A.ddIcon /icon.s/compressed.gif .Z .z .tgz .gz .zip.
AddIcon /icons/a.gif .p.s. .ai .eps外贸
AddIcon ./icons/layo.ut.gif .html .shtml .htm .pdf教育
A.ddIcon /icons/text.gi.f .txt 汽车
AddIc.on /icons/c.gif .c.
A.ddIcon /icons/p.gif ..pl .py.
A.ddIcon /icons/f.gif .for--- 印刷
AddIcon /icons/d.vi.gif .dv.i(广告)
AddIcon /icons/uuencoded.gif ..uu.电脑
AddIcon. /icons/script.gif .conf .sh .shar .csh ..ksh .tcl域名
AddIcon /icons./.tex.gif .tex 女人
AddIcon /ico.ns/bomb.gif .core 婚庆
AddIcon /icons./b.ack.gif ...
AddIcon /icons/hand..right..gif README( 游戏 )
Ad.dIcon /icons/folder..gif ^^DIRECTORY^^--------------彩票
AddIcon /icons/blank.gi.f ^^BLANKICON^.^外贸
#
# DefaultIcon is which icon to show for files whic.h do not have an i.con虚拟主机
# expl.icitly set..
#
D.efault.Icon /icons/unknown.gif--------------彩票
#
................. #贴子.字数限制,略掉了域名
#
#
# HeaderName is the na.me of a f.ile which should be prepended to域名
# directory indexe.s. ( 游戏 )
ReadmeName README.htm.l.
HeaderName HEAD.ER.html.
#
................ .#贴.子字数限制,略掉了电影
#
# Simplified Chine.se (zh-CN.) - Spanish (es) - Traditional Chinese (zh-TW)--- 印刷
#
AddLanguage .ca .ca( 游戏 )
AddLangu.age cs .cz .cs电脑
AddLanguage da. .dk.
AddLanguage de. .de.
A.ddLanguage el .el[成人用品]
AddLangu.age en .en 杀毒
AddLanguage. eo .eo(广告)
AddLanguage es .e.s 健康
AddLanguage et .et.<性病>
AddL.anguage fr .fr( 游戏 )
AddLanguage he ..he(广告)
AddLanguage h.r .hr--- 印刷
AddLangu.age it .it.
AddLang.uage ja .ja电影
AddLanguage .ko .ko电脑
Add.Language ltz .ltz.
AddLanguage nl .n.l虚拟主机
AddLanguag.e nn .nn 外汇
AddLanguage .no .no 电子
AddLanguage pl ..po教育
AddLanguage pt ..pt(广告)
AddLanguage pt-BR .pt.-br.
AddLan.guage ru .ru 乙肝
Ad.dLanguage sv .sv教育
AddLanguage zh-CN .z.h-cn外贸
A.ddLanguage zh-TW .zh-tw 外汇
#
.................. #贴子字数限制,略掉了教育
#
ForceLanguagePriority Pr.efer Fallbac.k 健康
#
.................. #贴子字数限制,略掉了 女人
AddDef.aultCharset UTF-8.
#
#
# Alias /error/include/ "/yo.u.r/include/path/".
#
# which allows you to create your own set of files .by star.ting with the(广告)
# /v.ar/ww.w/error/include/ files and 健康
# copying th.em to /your./include/path/, even on a per-VirtualHost basis. 电子
#
Alias. ./error/ "/var/www/error/".
<IfModule mod_neg.otiation..c> 乙肝
<IfModule mod_include..c>--- 印刷
<Dire.ctory "/var/www/er.ror">健康
. . AllowOverride None教育
Options Includ.esNoE.xec电影
AddOutputFi.lter Includ.es html健康
. .AddHandler type-map var 婚庆
Order allo.w,deny 婚庆
A.llow from all教育
. Languag.ePriority en es de fr
Fo.rceLanguagePriority Prefer F.allback.
</.Directory><性病>
# .ErrorDocu.ment 400 /error/HTTP_BAD_REQUEST.html.var 外汇
................. #贴子字.数限制,略掉了 婚庆
</IfModule>
</IfModule>
#
# .The following directives modify normal. HTTP response behavior to 建材
#. h.andle known problems with browser implementations. 鲜花
#
BrowserM.atch "Mozill.a/2" nokeepalive电影
BrowserMatch "MSIE 4\.0b2;" noke.epalive downgrade-1.0 for.ce-response-1.0 婚庆
BrowserMatch "RealPlaye..r 4\.0" force-response-1.0电脑
BrowserM.atch "Java/1\.0" force-.response-1.0.
BrowserMat.ch "JDK/1\.0." force-response-1.0.
#
................. #贴子.字数限制,略掉了投资
# Same deal with Apple.'s DAV file.system and Gnome VFS support for DAV.域名
#
Bro.wserMatch "Microsoft Data Access Internet Pub.lishing Provide.r" redirect-carefully--- 印刷
BrowserMatch "MS FrontPa.ge" redir.ect-carefully.
BrowserMatch "^WebDrive" .r.edirect-carefully.
BrowserMatch "^WebDAVFS/1.[0123]". redirect-carefully..
BrowserMatch ."^gnome-vfs/1.0" redirec.t-carefully.
BrowserMatch ."^XML Spy" redirect-c.arefully 汽车
Bro.wserMatch "^Dre.amweaver-WebDAV-SCM1" redirect-carefully 健康
#
# Allow server status re.po.rts generated by mod_status,.
# with the URL of
http://servername/server-status.# Change the "..example..com" to match your domain to enable. 女人
#
.................. #贴子字数限制,略掉了( 游戏 )
以上为我所改的,那.么,请问各位高手,要做.到网站安全,还应该加强些什么?--- 印刷
那如果说,我不想把.网站根目录放置在/va.r/www/html下面,而想放置到/home/site/目录下面( 游戏 )
那么,该改动些什么?那么这个httpd..conf该改为什么样呐.? 电子
也是新手,烦请达达们给解.释的详细点儿哈,谢谢你们!--- 印刷
[ 本帖最后由 凌.逸 于 2008-8.-17 23:31 编辑 ]<性病>
http://upload.bbs.csuboy.com/Mon_1004/126_6720_47cae89ebf8721f.gif[/img]2.rar (11.37 KB) 下载次数:1.
2008-.08-17 23:29 美容
httpd.conf原件