配置完成截图:(一)APACHE的安装与使用1.首先将/etc/yum.conf文件中pgpcheck的参数值改为0[root@localhost~]#vi/etc/yum.conf2.切换目录[jsl@localhost~]$su-Password:[root@localhost~]#cd..[root@localhost/]#vi/etc/yum.conf[root@localhost/]#cd/media/CDROM/Server3.安装软件包[root@localhostServer]#rpm-ivhpostgresql-libs-8.1.4-1.1.i386.rpmwarning:postgresql-libs-8.1.4-1.1.i386.rpm:HeaderV3DSAsignature:NOKEY,keyID37017186Preparing...###########################################[100%]1:postgresql-libs###########################################[100%][root@localhostServer]#rpm-ivhapr-1.2.7-11.i386.rpmwarning:apr-1.2.7-11.i386.rpm:HeaderV3DSAsignature:NOKEY,keyID37017186Preparing...###########################################[100%]1:apr###########################################[100%][root@localhostServer]#rpm-ivhapr-util-1.2.7-6.i386.rpmwarning:apr-util-1.2.7-6.i386.rpm:HeaderV3DSAsignature:NOKEY,keyID37017186Preparing...###########################################[100%]1:apr-util###########################################[100%][root@localhostServer]#rpm-ivhhttpd-2.2.3-6.el5.i386.rpmwarning:httpd-2.2.3-6.el5.i386.rpm:HeaderV3DSAsignature:NOKEY,keyID37017186Preparing...###########################################[100%]1:httpd###########################################[100%][root@localhostServer]#rpm-ivhhttpd-manual-2.2.3-6.el5.i386.rpmwarning:httpd-manual-2.2.3-6.el5.i386.rpm:HeaderV3DSAsignature:NOKEY,keyID37017186Preparing...###########################################[100%]1:httpd-manual###########################################[100%]4.启动Apache[root@localhostServer]#servicehttpdstartStartinghttpd:[OK]5.查看Apache服务的状态[root@localhostServer]#servicehttpdstatushttpd(pid466146604659465746564655465446534652)isrunning...6.下次计算机启动时自动启动[root@localhostServer]#chkconfighttpdon7.切换目录并修改默认网站默认页里的内容[root@localhosthome]#su-jsl[jsl@localhost~]$mkdirpublic_html[jsl@localhost~]$lspublic_html[jsl@localhost~]$cdpublic_html[jsl@localhostpublic-html]$echohello/var/打开浏览器访问(二)APACHE的配置命令1.获得APACHE的帮助2.输出APACHE的指令列表[root@localhost/]#httpd-LDirectory(core.c)ContainerfordirectivesaffectingresourceslocatedinthespecifieddirectoriesAllowedin*.confonlyoutsideDirectory,FilesorLocationLocation(core.c)ContainerfordirectivesaffectingresourcesaccessedthroughthespecifiedURLpathsAllowedin*.confonlyoutsideDirectory,FilesorLocationVirtualHost(core.c)Containertomapdirectivestoaparticularvirtualhost,takesoneormorehostaddressesAllowedin*.confonlyoutsideDirectory,FilesorLocationFiles(core.c)ContainerfordirectivesaffectingfilesmatchingspecifiedpatternsAllowedin*.confanywhereandin.htaccesswhenAllowOverrideisn'tNoneLimit(core.c)ContainerforauthenticationdirectiveswhenaccessedusingspecifiedHTTPmethodsAllowedin*.confanywhereandin.htaccesswhenAllowOverrideisn'tNoneLimitExcept(core.c)ContainerforauthenticationdirectivestobeappliedwhenanyHTTPmethodotherthanthosespecifiedisusedtoaccesstheresourceAllowedin*.confanywhereandin.htaccesswhenAllowOverrideisn'tNoneIfModule(core.c)ContainerfordirectivesbasedonexistanceofspecifiedmodulesAllowedin*.confanywhereandin.htaccesswhenAllowOverrideisn'tNoneIfDefine(core.c)ContainerfordirectivesbasedonexistanceofcommandlinedefinesAllowedin*.confanywhereandin.htaccesswhenAllowOverrideisn'tNoneDirectoryMatch(core.c)ContainerfordirectivesaffectingresourceslocatedinthespecifieddirectoriesAllowedin*.confonlyoutsideDirectory,FilesorLocationLocationMatch(core.c)ContainerfordirectivesaffectingresourcesaccessedthroughthespecifiedURLpathsAllowedin*.confonlyoutsideDirectory,FilesorLocationFilesMatch(core.c)ContainerfordirectivesaffectingfilesmatchingspecifiedpatternsAllowedin*.confanywhereandin.htaccesswhenAllowOverrideisn'tNoneAuthType(core.c)AnHTTPauthorizationtype(e.g.,Basic)Allowedin*.confonlyinsideDirectory,FilesorLocationandin.htaccesswhenAllowOverrideincludesAuthConfigAuthName(core.c)Theauthenticationrealm(e.g.MembersOnly)Allowedin*.confonlyinsideDirectory,FilesorLocationandin.htaccesswhenAllowOverrideincludesAuthConfigRequire(core.c)SelectswhichauthenticatedusersorgroupsmayaccessaprotectedspaceAllowedin*.confonlyinsideDirectory,FilesorLocationandin.htaccesswhenAllowOverrideincludesAuthConfigSatisfy(core.c)accesspolicyifbothallowandrequireused('all'or'any')Allowedin*.confonlyinsideDirectory,FilesorLocationandin.htaccesswhenAllowOverrideincludesAuthConfigAddDefaultCharset(core.c)ThenameofthedefaultcharsettoaddtoanyContent-Typewithoutoneor'Off'todisableAllowedin*.confanywhereandin.htaccesswhenAllowOverrideincludesFileInfoAcceptPathInfo(core.c)SettoonoroffforPATH_INFOtobeacceptedbyhandlers,ordefaultfortheper-handlerpreferenceAllowedin*.confanywhereandin.htaccesswhenAllowOverrideincludesFileInfoAccessFileName(core.c)Name(s)ofper-directoryconfigfiles(default:.htaccess)Allowedin*.confonlyoutsideDirectory,FilesorLocationDocumentRoot(core.c)RootdirectoryofthedocumenttreeAllowedin*.confonlyoutsideDirectory,FilesorLocationErrorDocument(core.c)ChangeresponsesforHTTPerrorsAllowedin*.confanywhereandin.h