Month: May 2013

apache mod_rewrite: 把首页URL重写为另一个URL

试了半天,发现要这样写才行 引用         RewriteEngine on         RewriteRule ^/$ /homepage/index.htm  [PT] 1. 首页"/"前后要用^和$包裹起来,表示只重写首页 2. 如果不写[PT],apache就会去linux根目录(而不是应用根目录)查找 /homepage/index.htm这个文件 3. 如果把[PT]改成[R],则会发现302跳转,用户的浏览器里会出现http://…/homepage/index.htm

php include 路径问题的解决方案

大家都知道,A包含B时必须包含B的绝对路径,才不会因为A的位置改变而导致错误。 那么绝对路径怎么来?有个人给出的方法不错: 在每个php的文件开头写上: <?php set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER[‘DOCUMENT_ROOT’] ); ?> Now anywhere you do an include you can do something like: <?php include ( "Templates/header.inc") ?>

apache httpd各种文件的路径

ubuntu用apt安装的apache2    主配置文件:/etc/apache2/apache2.conf,  httpd.conf已经废弃不用了。    端口配置:  /etc/apache2/ports.conf    VirtualHost配置: 每个host都定义在/etc/apache2/sites-available文件夹里作为独立文件,然后在/etc/apache2/sites-enabled以连接的方式引用定义文件    Mod配置:  机制与VirtualHost类似        日志文件:/var/log/apache2/ 目录下     php.ini:  /etc/php5/apache2/php.ini  (以phpinfo()打印的为准) centos中的apache2    主配置文件:/etc/httpd/conf/httpd.conf    VirtualHost配置:/etc/httpd/conf.d/all-sites.conf    apache可执行文件:/usr/sbin/apachectl, 如sudo /usr/sbin/apachectl restart  mac os中的apache2    注:mac os中自带了apache和php,不需要另外安装    主配置文件:/etc/apache2/httpd.conf    VirtualHost配置:/etc/apache2/extra/httpd-vhosts.conf . 配置前要去主配置文件中把这行去注释:Include /private/etc/apache2/extra/httpd-vhosts.conf    apache可执行文件:/usr/sbin/apachectl, 如sudo /usr/sbin/apachectl restart 

Fixed Layout 和 Fluid Layout

即固定布局和流动布局,前者用像素定义宽度,后者用百分比。 前者可以确保用户看到的跟设计者看到的风格一致,后者则更可以让宽屏、窄屏用户都有很好的体验。 我比较倾向固定布局,它比较保险; 而流动布局可能一不小心就会弄坏掉。  这里有篇很不错的介绍: http://blog.benhuoer.com/posts/fixed-fluid-elastic-css-layout-comparement.html ================================ 在bootstrap中, css "row" 和 "container" 用于fixed layout, "row-fluid"和"container-fluid"用于fluid layout

收藏一下bootstrap相关的一些链接

不同布局的模板: http://twitter.github.io/bootstrap/getting-started.html#examples 现成的bootstrap css库,快速改变主题:  http://bootswatch.com/ 用less重新编译bootstrap css:  http://bootstrap.lesscss.ru/less.html bootstrap theme的市场: https://wrapbootstrap.com 80个基于bootstrap的建站模板: http://www.tripwiremagazine.com/2013/02/twitter-bootstrap-templates.html , 有的还能跟wordpress整合

为什么vim不能正确地缩进html?

你需要这样: 引用 You have to add the following lines to your .vimrc to make sure vim uses file-specific indentions: filetype on filetype plugin on filetype indent on 看这里: http://stackoverflow.com/questions/10213744/vim-html-autoindent-not-working#10215433

qmail相关资料

查看状态: http://support.godaddy.com/help/article/1582/how-do-i-view-messages-in-the-qmail-queue 引用 #/var/qmail/bin/qmail-qstat #/var/qmail/bin/qmail-qread 查看日志: 引用 # cat /usr/local/psa/var/log/maillog 更多: Basic qmail commands:  http://artoflinux.blogspot.com/2008/02/qmail.html