apache安装配置shtml urlrewrite

apache 安装 配置 shtml urlrewrite 笔记

<IfModule alias_module>
    #
    # Redirect: Allows you to tell clients about documents that used to
    # exist in your server's namespace, but do not anymore. The client
    # will make a new request for the document at its new location.
    # Example:
    # Redirect permanent /foo http://www.example.com/bar

    #
    # Alias: Maps web paths into filesystem paths and is used to
    # access content that does not live under the DocumentRoot.
    # Example:
    # Alias /webpath /full/filesystem/path
    #
    # If you include a trailing / on /webpath then the server will
    # require it to be present in the URL.  You will also likely
    # need to provide a <Directory> section to allow access to
    # the filesystem path.

    #
    # ScriptAlias: This controls which directories contain server scripts.
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the target directory are treated as applications and
    # run by the server when requested rather than as documents sent to the
    # client.  The same rules about trailing "/" apply to ScriptAlias
    # directives as to Alias.
    #
    ScriptAlias /cgi-bin/ "/xampp/cgi-bin/"
    Alias /bc "E:/art"
</IfModule>

<Directory "/bc">
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

<Directory "E:/art">
  Options Indexes FollowSymLinks Includes ExecCGI
    AddType text/html .shtml   # 注明我因为弄错这里花费了近半个小时 我写成了text/shtml
    AddOutputFilter INCLUDES .shtml

    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>


让你apache支持shtml

打开你的httpd.conf
首先要确认LoadModule include_module libexec/apache2/mod_include.so
这上行没有注释掉!
然后搜索“AddType text/html .shtml”,

# AddType text/html .shtml
# AddOutputFilter INCLUDES .shtml

把这两行前面的#去掉。

然后搜索“Options Indexes FollowSymLinks”
在搜索到的那一行后面添加“ Includes”
即将该行改变为 Options Indexes FollowSymLinks Includes


保存httpd.conf,重起apache即可。


服务器采用shtml速度会比html慢,比php快。0 k( Q% T4 R* ~; _

shtml的特点就是能够进行页面包含,能够局部更新页面包含部分。广泛采用可以很容易解决网页中的广告问题,不需要更新全面静态页面。而只需更新一个包含页面即可。( r/ M3 W: q/ R: q; i- V) /5 |

apache下配置服务器支持shtml

打开文件:httpd.conf8 V7 ^' A' z9 i  r& U* H
' z, K) C5 z, V
去掉前面的 #LoadModule include_module modules/mod_include.so

<Directory "D:/PC_webserver/phproot">
Options Indexes FollowSymLinks Includes" h5 }* s; B3 D: [) z: z0 m* E
AllowOverride Options FileInfo
Order allow,deny6 S) y5 C  F# Z5 ?1 n
Allow from all

</Directory>

找到下面两句,去掉前面的#6 T* ~- U, Q/ H) l9 f9 k( D3 P
7 B  U* G- U. i4 |
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

重启apache即可。

建立页面:

测试 <!--#include file="data/save/1.html"-->
- C- b1 L5 v- ~4 f8 L
file为相对于当前文档的路径。

<!--#include virtual="/phpcms5/data/save/1.html"-->: B. ^; ~/ ]# k+ z7 r6 z
* @% a4 y  d' d
virtual为相对于虚拟目录的路径。

2 y5 p4 }" s- k
如果需要让所有的html文件支持shtml.只需要修改上面一句。
$ [7 e. a) y" {. `2 a) `+ s+ ?" w/ X
AddOutputFilter INCLUDES .html

 


Apache+php+mysql在windows下的 ...
先准备好软件: Apache官方下载地址:apache_2.0.55-win32-x86-no_ssl.msi,更多版本在这里; php官方下载地址:php-5.0.5-Win32.zip,更多镜像下载地址,更多版本下载; mysql官方下载地址:mysql-4.1.14-win32.zip,更多镜像下载地址,更多版本下载。一、安装Apache,配置成功一个普通网站服务器运行下载好的“apache_2.0.55-win32-x86-no_ssl.msi”,出现如下界面:       出现Apache HTTP Server 2.0.55的安装向导界面,点“Next”继续       确认同意软件安装使用许可条例,选择“I accept the terms in the license agreement”,点“Next”继续       将Apache安装到Windows上的使用须知,请阅读完毕后,按“Next”继续       设置系统信息,在Network Domain下填入您的域名(比如:goodwaiter.com), ...
by m2maomao 2009-08-07 回复 (0)

 

Apache可以在Linux系统中使用,也可以应用在Windows系统中。首先去它的主页http://www.apache.org/dist/httpd/binaries/win32/下载到该软件。下载的时候要选择for win32的非源码版本(例如Apache_1.3.26-win32-no_src.msi)。最新版的Apache for win32开始使用MSI的形式发布,从而使Windows环境下安装Apache变得非常简单。它是全英文界面,但使用起来却很方便。它的安装步骤如下:
  第一步,双击Apache的安装文件,和普通Windows程序安装一样,一直点击“Next”按钮就可以。
  第二步,在程序的安装过程中要求填写服务器信息,即输入Network Domain(网络域名:形如xxx.com)、Server Domain(服务器域名:形如www.xxx.com)和网站管理员的E-mail。有的话就按实填写,个人用户若没有E-mail可以按格式随便填一下。
  第三步,选择安装路径,按照个人习惯选择。
  一直点击“Next”按钮直至“Finish”按钮出现,安装即告完成。这时,Apache就已经启动了。可以在IE地址栏里输入:http://localhost/或http://127.0.0.1看到默认的Apache首页。此外,在“管理工具”的“服务”项中,也可以找到Apache服务了,以后Apache就可以作为一项服务,随着计算机的启动而自动运行了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值