--- configurations: prism.plugins: 'command-line' --- # Web Server [Apache]: https://httpd.apache.org/ [.htaccess]: https://httpd.apache.org/docs/2.4/howto/htaccess.html [mod_rewrite]: https://httpd.apache.org/docs/current/mod/mod_rewrite.html ph-Bookshelf 原始版本是在 [Apache Web Server][Apache] 环境下开发的,并有用到 [Apache] 的 [.htaccess]。 你也可以在其它的环境下使用 **ph-Bookshelf**,只需要一些简单的路径重写设置。 ## 对于你自己管理的的 Apache 服务器 要想在 [Apache] 中使用 **ph-Bookshelf**,你只需要确认一些简单的设置: 确认 [mod_rewrite] 已经打开。这一般可以通过以下简单的命令确认:
a2enmod rewrite
Enabling module rewrite.
To activate the new configuration, you need to run:
service apache2 restart
a2enmod rewrite
Module rewrite already enabled
> 如果你使用的是旧版 Apache一般存在于会被叫做 httpd 的 apache,module 配置或许会在服务器里,这时候,大概你的 Apache 的配置文件(通常为 `/etc/apache2/httpd.conf`{.lang-url} 或者 `/etc/httpd/httpd.conf`{.lang-url}),找到以下行并取消注释它:
>
> ```apacheconf
> # uncomment this line
> LoadModule rewrite_module libexec/apache2/mod_rewrite.so
> ```
然后,为你的 ph-Bookshelf 目录配置允许路径重写:
```apacheconf