|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
为什么我使用一个命令的时候,系统告诉我找不到该目录,我要如何限制使用者的权限等问题,这些问题其实都不是很难的。
公司一台Linux服务器,Apache默许安装时分没有加载任何Modules,比来要用到Apache的rewrite模块,经由一夜一天的勉力,终究乐成了,镇静....
如今列下几个要点:
1.Apache安装rewrite模块的时分必要DBM撑持,不然没法编译,以是起首要安装一个GDBM下载地点:ftp://ftp.gnu.org/gnu/gdbm/
安装步骤:进进安装目次,./configure;make;makeinstall;makeinstall-compat;不然没法编译出ndbm.h头文件.
2.然后用Apachebin目次下的apxs命令安装
/var/apache/bin/apxs-cmod_rewrite.c{
gcc-DLINUX=22-DUSE_HSREGEX-DUSE_EXPAT-I../lib/expat-lite-fpic-DSHARED_MODULE-I/var/apache/include-cmod_rewrite.c
gcc-shared-omod_rewrite.somod_rewrite.o-lgdbm
}
/var/apache/bin/apxs-i-a-nmod_rewritemod_rewrite.so
然后在http.conf设置文件里加上:LoadModulerewrite_modulelibexec/mod_rewrite.so
接上去用/usr/local/apache/bin/apachectl
stop中断apache,然后用再start,万万注重,在这里不克不及用restart大概graceful参数来从头启动apache,必需先中断,然后再入手下手,大概是reboot呆板,不然rewrite将不起感化。
-------------------------------------------------------------------------------------------------------------
ItriedtoincludeinmyApacheWebserversconfigurationthemod_rewritemodule,butwhenIrestartedtheserver,Ireceivedanerror:
Cannotload/usr/local/apache/libexec/mod_rewrite.sointoserver:
/usr/local/apache/libexec/mod_rewrite.so:undefinedsymbol:dbm_fetch
Theproblem,asitturnsout,isthatmod_rewrite.soiscompiledincorrectly.Itshouldbelinkedwithadbmlibrarybutitisnt.
Ifyouhaveanup-to-datesetofApachesourcefiles,youcaneasilysolvethisproblembymanuallyrerunningthelastcompilationstepofthismodule,usingthecorrectoptions.Whenyouexecutemakemod_rewrite.sointheappropriatedirectory,itperformsthisfinalstep:
gcc-shared-omod_rewrite.somod_rewrite.lo
Rerungcc,thistimeaddingareferencetotheGNUgdbmlibrary:
gcc-shared-omod_rewrite.somod_rewrite.lo-lgdbm
Next,copythenewlycreatedmod_rewrite.sooverto/usr/local/apache/libexecorwhereveryourApachemodulefilesarelocated.
Inmycase,thiswasallthatwasneededtosolvetheproblem.Yourmileagemayvary.
</p>
初学阶段只要把上课时候学习过的命令练熟就可以了.单靠学习各种命令而成为高手是不可能的。 |
|