Learning PHP and MySQL reading note(Chapter two)

Posted on Sep 8th 2008 at 10:30am under Web by edward

In this chapter author guide audience to install software to make programme works: PHP Apache and MySQL.

After that there are several questions as follows:

1.What OS has Apache installed already?

Mac OS and many Linux distributions.

2.What dose the hash # mean?

It indicates that the lines commented out.

3.How do you work remotely?

Transfer files to the remote server.

4.How must PHP files be accessed?

Through a web server.

Learning PHP and MySQL reading note (Chapter One)

Posted on Sep 8th 2008 at 10:29am under Web by edward

In this chapter author indicate the whole scope of a dynamic web site built on PHP and MySQL with some sample codes and pics that describe how web server works.

It follows some questions:

1.what three components do you need to create a dynamic web page?

I think they are database web server and server-side programming language

2.What dose Apache use to load extensions?

Modules

3.What does SQL stand for ?

Structured Query Language

4.what are angle brackets (<>) used for?

Enclose HTML markups

5.What does the PHP interpreter do?

To interpreter/process PHP files from database

High Performance Web Site Reading Note

Posted on Sep 4th 2008 at 4:11pm under 设计 Design by edward

In this book author listed 12 rules to overcome bottleneck in web sites to make web sites run faster and user will gain better user experience. Before that author described  why the frontend performance is important and how HTTP works.

There are 12 rules as follows(by importance):

  1. Make fewer HTTP request,with image map(<map>tag that define events on specific area when click, and does not work in IE),CSS sprites(use css define backgroud of specific area),inline images(data:mediatype,base64,data) and combine stylesheet and script files into less files as possible.
  2. Use a content delivery network.When using a CDN service,end users can download files from server that most close to them. As usual, companies put static data like image and video on the CDN server.There are free CDN service too: Globule,CoDeeN,and CoralCDN. If we want to test response time from location that all over the world, services such as Keynote and Gomez are useful and helpful.
  3. Add an expires header.Add expires headers to your files especially imagines. It makes that browser load files from cache if files in cache.Another solution is max-age(Just in HTTP 1.1). At last,revving filename, if that files changed and be in expiration date.
  4. Gzip Componets
  5. Put sytlesheet at the top
  6. put js at the bottom
  7. Avoid CSS expressions
  8. Make js and css external
  9. Reduce DNS Lookups
  10. Minify JS
  11. Avoid Redirects
  12. Remove duplicate scripts
  13. Configure ETags
  14. Make Ajax Cachebale

Difference between HTTPS and HTTP

Posted on Sep 2nd 2008 at 6:09pm under Web by edward

HTTPS(Secure Hypertext Transfer Protocol)安全超文本传输协议 它是一个安全通信通道,它基于HTTP开发,用于在客户计算机和服务器之间交换信息。它使用安全套接字层(SSL)进行信息交换,简单来说它是HTTP的安全版。 它是由Netscape开发并内置于其浏览器中,用于对数据进行压缩和解压操作,并返回网络上传送回的结果。HTTPS实际上应用了Netscape的安全全套接字层(SSL)作为HTTP应用层的子层。(HTTPS使用端口443,而不是象HTTP那样使用端口80来和TCP/IP进行通信。)SSL使用40 位关键字作为RC4流加密算法,这对于商业信息的加密是合适的。HTTPS和SSL支持使用X.509数字认证,如果需要的话用户可以确认发送者是谁。 HTTPS和HTTP的区别: https协议需要到ca申请证书,一般免费证书很少,需要交费。 http是超文本传输协议,信息是明文传输,https 则是具有安全性的ssl加密传输协议 http和https使用的是完全不同的连接方式用的端口也不一样,前者是80,后者是443。 http的连接很简单,是无状态的 HTTPS协议是由SSL+HTTP协议构建的可进行加密传输、身份认证的网络协议 要比http协议安全 HTTPS解决的问题: 1 . 信任主机的问题. 采用https 的server 必须从CA 申请一个用于证明服务器用途类型的证书. 改证书只有用于对应的server 的时候,客户度才信任次主机. 所以目前所有的银行系统网站,关键部分应用都是https 的. 客户通过信任该证书,从而信任了该主机. 其实这样做效率很低,但是银行更侧重安全. 这一点对我们没有任何意义,我们的server ,采用的证书不管自己issue 还是从公众的地方issue, 客户端都是自己人,所以我们也就肯定信任该server. 2 . 通讯过程中的数据的泄密和被窜改 1. 一般意义上的https, 就是 server 有一个证书. a) 主要目的是保证server 就是他声称的server. 这个跟第一点一样. b) 服务端和客户端之间的所有通讯,都是加密的. i. 具体讲,是客户端产生一个对称的密钥,通过server 的证书来交换密钥. 一般意义上的握手过程. ii. 加下来所有的信息往来就都是加密的. 第三方即使截获,也没有任何意义.因为他没有密钥. 当然窜改也就没有什么意义了. 2. 少许对客户端有要求的情况下,会要求客户端也必须有一个证书. a) 这里客户端证书,其实就类似表示个人信息的时候,除了用户名/密码, 还有一个CA 认证过的身份. 应为个人证书一般来说上别人无法模拟的,所有这样能够更深的确认自己的身份. b) 目前少数个人银行的专业版是这种做法,具体证书可能是拿U盘作为一个备份的载体. HTTPS 一定是繁琐的. a) 本来简单的http协议,一个get一个response. 由于https 要还密钥和确认加密算法的需要.单握手就需要6/7 个往返. i. 任何应用中,过多的round trip 肯定影响性能. b) 接下来才是具体的http协议,每一次响应或者请求, 都要求客户端和服务端对会话的内容做加密/解密. i. 尽管对称加密/解密效率比较高,可是仍然要消耗过多的CPU,为此有专门的SSL 芯片. 如果CPU 信能比较低的话,肯定会降低性能,从而不能serve 更多的请求. ii. 加密后数据量的影响. 所以,才会出现那么多的安全认证提示

Useful command in bash

Posted on Sep 1st 2008 at 6:00pm under 操作系统 OS by edward

1.Delete one document and its sub nodes:

rm –rf filename

2.List information about files

ls filename

3.Change dictionary

cd nodename

4.To find IP address in Linux/Unix

ifconfig –a

5.