java程序员学php — 1. 动态数据类型
1. php里的数据类型是动态的,不要求在使用变量之前声明变量,如 $var = 0; 2. php里变量的数据类型可在运行时变换,比如,你可以先后如下赋值: $var = 5; $var = ‘abc’; 不会报错
1. php里的数据类型是动态的,不要求在使用变量之前声明变量,如 $var = 0; 2. php里变量的数据类型可在运行时变换,比如,你可以先后如下赋值: $var = 5; $var = ‘abc’; 不会报错
摘自"Dive into Python" statically typed language A language in which types are fixed at compile time. Most statically typed languages enforce this by requiring you to declare all variables with their datatypes before using them. Java and C are statically typed languages. dynamically typed language A language in which types are discovered at …
http://serverfault.com/ 是面向系统管理的StackOverflow,收藏一下
http://product.china-pub.com/57048日本人写 目录回到顶部↑ 《大规模web服务开发技术》 第1章 大规模web服务的开发定位——掌握整体 2 第0课 本书的起源——本书讲述的范围 3 从事大规模web服务开发——面向大学生的hatena实习 3 本书讲述的内容 3 本书不讲述的内容 5 致今后从事大规模web服务的人 5 第1课 大规模服务和小规模服务 6 hatena的服务规模 6 hatena是大规模,google、facebook是超大规模 8 小规模服务和大规模服务的区别 9 应对大规模数据量 11 第2课 持续增长的服务和大规模化的障碍 13 web服务的困难 13 hatena的成长经历 13 系统增长战略——最小化开端、预见变化的管理和设计 17 第3课 服务开发现场 18 hatena的技术团队体制 18 hatena的沟通方式 19 服务开发的实际状况 19 .开发所用的工具 21 总结 23 第2章 大规模数据处理入门——内存和磁盘、web应用程序和负载 24 第4课 hatena …
[img][/img]这类文章在网上太多了,但我看到的都是乱糟糟的,要么没重点,要么只讲配置不讲道理。干脆我自己写一个 1.概述 这种设计可以称作“反向代理”,即把web server当作app server的代理. Apache的模块mod_proxy就是为此而生的 Proxy就是我们要配的第一个东西 proxy会导致一个问题。tomcat的host/port与apache的hostp/port肯定有所不同。那在tomcat中的webapp下执行servlet.getServerName()和getServerPort()时,拿到的主机名和端口是什么? 如果不作配置的话,就是tomcat自己的host/port;这显然不是我们想要的。我们要的是用户请求的host/port,即apache的host/port. 我们要配置的第二步就是来解决这个问题。 最后一个问题跟session stickiness相关. 由于我们有两个tomcat,怎么让同一个session下的所有请求都发到同一个tomcat上呢? Apache通过mod_proxy_balancer解决这个问题。这是我们要配的第三个东西。 下面就一个一个来配: 2.配置proxy #apache的httpd-vhosts.conf <VirtualHost *:80> … #先只配一个tomcat ProxyPass /tomcat/ http://tomcat:8080/ ProxyPassReverse /tomcat/ http://tomcat:8080/ #上面两句话会把 http://apache/tomcat下的所有请求转发给 http://tomcat:8080 … </VirtualHost> 3.解决proxy引发的request.getServerName()问题 <!–Tomcat的server.xml–> <Connector port=”8080″ protocol=”HTTP/1.1″ connectionTimeout=”20000″ redirectPort=”8443″ proxyName=”apache” proxyPort=”80″ /> <!–这样一来,拿到的getServerName()和getServerPort()就是用户真正请求的东西–> 4.1 – 把两个tomcat做成一个集群 <VirtualHost *:80> … #两个tomcat并作一个集群 <Proxy balancer://tomcat-cluster> BalancerMember http://tomcat:3535 BalancerMember http://tomcat:3636 </Proxy> #把proxy指向这个集群 …
答案是: (摘自Apache Cookbook) The ProxyPassReverse directive ensures that any redirect headers sent from the backend server will be modified so that they appear to come from the main server.
摘自"Apache Cookbook" Aliasing refers to mapping a URL to a particular directory. Redirecting refers to mapping a URL to another URL. And Rewriting refers to using mod_rewrite to alter the URL in some way.
"Apache Cookbook"
摘自 Apache Cookbook There are two primary forms of virtual hosts: IP-based virtual hosts, where each virtual host has its own unique IP address; and name-based virtual hosts, where more than one virtual host runs on the same IP address but with different names.
libapache2-mod-auth-mysql:A module for the Apache 2 web server which enables HTTP authentication against information stored in a MySQL database. phpmyadmin: 通过php页面管理mysql php5-mysql: 让mysql与php直接连接