给apache编译加载模块
以安装mod_rewrite为例
进入源码中包含模块的文件夹
cd src/httpd-2.0.64/modules/mappers
执行
# /usr/local/apache/bin/apxs -iac mod_rewrite.c
完事儿!
以安装mod_rewrite为例
进入源码中包含模块的文件夹
cd src/httpd-2.0.64/modules/mappers
执行
# /usr/local/apache/bin/apxs -iac mod_rewrite.c
完事儿!
By admin|Web服务器|Be the first to comment!
有段日子没碰apache有点生疏了。以后每次遇到问题都到这篇日志里记录下。
为什么不识别php文件而日志也没有报错?
检查是否在apache的httpd.conf中添加
LoadModule php5_module modules/libphp5.so
DirectoryIndex index.php index.html
AddType application/x-httpd-php .php
By admin|Web服务器|Be the first to comment!
配置
ServerTokens ProductOnly
ServerSignature Off
在debian系的linux中配置文件太过分散,修改的时候注意要改对地方,否则将没有任何效果。
<VirtualHost *:443>
ServerName www.zhangyiqun.net
ServerAlias zhang.net
DocumentRoot /xxx
ErrorLog /xxx
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
#SSL
SSLEngine on
SSLCACertificateFile /etc/apache2/ca.txt
SSLCertificateFile /etc/ssl/crt/www.vpn38.net.crt
SSLCertificateKeyFile /etc/ssl/crt/private.key
</VirtualHost>
需要开启ssl模块,否则会出现ssl command not found之类的错误
By admin|Linux系统|Be the first to comment!
下午为凸墙调试支付宝接口,遇到了几个小问题
URL中的UTF-8–>gb2312的转换
$urlname='Month/包月'; echo urlencode($urlname); echo iconv('utf-8','gb2312',urldecode('Month%2F%E5%8C%85%E6%9C%88')); |
Apache强制字符转换
关键在于配置中的“AddDefaultCharset UTF-8”这一行,这句的意思是所有的网页显示默认的编码都是“UTF-8”,其他编码要手动选择才能够正常显示,gb2312当然不例外。在这个约束下,即便在写网页程序时用Meta标示指定为GB2312也无济于事,因为apache已经有了明文强制要求。
开始我还以为是drupal代码中写了强制utf-8相关的语句所造成的