凡是wp-admin下面的php全都找不到,因为默认”http://域名/*.php”在nginx看来是根目录下的,因此需要在配置文件中添加:
[code]
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
[/code]
凡是wp-admin下面的php全都找不到,因为默认”http://域名/*.php”在nginx看来是根目录下的,因此需要在配置文件中添加:
[code]
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
[/code]
最近用了一个chrome插件叫做Wappalyzer的,可以看到网站的cms,统计工具,js框架等等。
看到自己的网站时,发现连OS,apache版本和php版本都出来了,这也太全了。
隐藏的办法如下:
在httpd.conf当中
ServerSignature Off
ServerTokens Prod
在php.ini中
expose_php Off
这样子就不会透露太多不必要的信息了
发现在默认的服务器配置中,html网站无法通过阿里云oss的防盗链验证,但是wordpress就可以,猜想可能是wordpress通过别的方法实现了refer,但是html需要设置服务器。
打开httpd.conf,找到CustomLog logs/refer_log referer一行,消去前面的#,这下apache就可以正常和阿里云oss交换refer信息了。
话说阿里云oss的确很强悍,之前打开网页有明显的图片下载过程,现在完全看不出啦(或者有的地方能轻微看出)。
文章比较早,阿里云也发生了不少变化,当然系统一如既往的旧,推荐大家去阅读一些更新的文章。-2014.1.20
阿里云的centos源比较老,php,httpd,mysql都不怎么新,php竟然还是5.1.16版本,现在最新都5.4.7了,漏洞多不说,很多组件也不兼容,因此完全编译安装以下:
PHP 5.4.7
HTTPD 2.4.3
MySQL Community Server 5.5.28
1、安装httpd
首先安装必须的环境
#yum install gcc gcc-c++ make
下载所有安装包,包括apr,apr-util,httpd,pcre
#wget http://mirror.bjtu.edu.cn/apache/apr/apr-util-1.5.1.tar.gz #wget http://mirror.bjtu.edu.cn/apache/apr/apr-1.4.6.tar.gz #wget http://mirror.bjtu.edu.cn/apache/httpd/httpd-2.4.3.tar.gz #wget http://sourceforge.net/projects/pcre/files/pcre/8.31/pcre-8.31.tar.gz/download
解压pcre并安装 继续阅读CentOS完全编译安装最新版LAMP
Rewrite规则开启,vi /etc/httpd/conf/httpd.conf找到并修改以下规则:
Options FollowSymLinks AllowOverride None(修改为AllowOverride All) Options Indexes FollowSymLinks MultiViews AllowOverride None(修改为AllowOverride All) Order allow,deny allow from all
Gzip开启,在httpd.conf当中输入
<IfModule mod_deflate.c> DeflateCompressionLevel 5 SetOutputFilter DEFLATE AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-javascript application/x-httpd-php AddOutputFilter DEFLATE js css </IfModule>
expires开启
<IfModule mod_expires.c> ExpiresActive On ExpiresDefault "access plus 12 month" ExpiresByType text/html "access plus 12 months" ExpiresByType text/css "access plus 12 months" ExpiresByType image/gif "access plus 12 months" ExpiresByType image/jpeg "access plus 12 months" ExpiresByType image/jpg "access plus 12 months" ExpiresByType image/png "access plus 12 months" EXpiresByType application/x-shockwave-flash "access plus 12 months" EXpiresByType application/x-javascript "access plus 12 months" ExpiresByType video/x-flv "access plus 12 months" </IfModule>
当然前提是rewrite,expires,defalte模块存在