You are currently browsing the archives for the Apache category.

Archive for the ‘Apache’ Category

ubuntu安装lamp的最简单方法

星期日, 7月 5th, 2009

ubuntu 如何搭建 lamp ?那还不容易, apache2, php5, mysql-server 之类的装一下不就可以了吗? 但是有时候也会遇到一些问题, 比如ubuntu 9.04上面安装mysql-server5.1是有些问题的。
怎么安装最简单呢? 答案是这样的:

sudo apt-get install lamp-server^

别忘了最后面那个 ^ , 这条命令和一般命令不一样哦, 原理见此处:https://help.ubuntu.com/community/Tasksel

分享家:Addthis中国

本地域名解析–hosts文件

星期一, 6月 8th, 2009

域名解析一般是通过2个地方设置的,一个是本地的hosts文件,另一个是指定的DNS服务器。在 /etc/nsswitch.conf 指定了两者的解析顺序, 一般是hosts优先, 当hosts找到时, 就停止查找,不会继续去DNS服务器查。这就是本地域名解析的基本知识。

关于hosts文件的相关内容, 见wikipedia : http://en.wikipedia.org/wiki/Hosts_file

The hosts file is a computer file used to store information on where to find a node on a computer network. This file maps hostnames to IP addresses. The hosts file is used as a supplement to (or a replacement of) the Domain Name System (DNS) on networks of varying sizes. Unlike DNS, the hosts file is under the control of the local computer’s administrator.bb

The hosts file has no extension and can be edited using most text editors.

Location and default content

The hosts file is located in different locations in different operating systems and versions.[1]

Operating System Version(s) Location
Windows 95, 98, Me %WinDir%\
Windows NT, 2000, XP, 2003, Vista, 7 %SystemRoot%\system32\drivers\etc\ by default. Actual location defined in Registry key \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DataBasePath
Macintosh 9 and earlier System Folder: Preferences or System folder
Macintosh X /private/etc/hosts
Linux, BSD based, and similar /etc/hosts[2]
Novell NetWare SYS:etc\hosts
iPhone and iPod /private/etc/hosts
OS/2 and eComStation "bootdrive":\mptn\etc\
Symbian 1st and 2nd edition phones C:\system\data\hosts
Symbian 3rd edition phones C:\private\10000882\hosts (AllFiles capable only)
分享家:Addthis中国

大型网站在用什么web服务器?Apache, nginx, lighttpd?

星期六, 5月 30th, 2009

Apache, nginx (发音 engine x), lighttpd ( 发音 lighty) 是主流的web server, 大型网站都在用哪些web 服务器? yaozer做了个简单的调查, 可以发现: Apache 目前还是占据主导地位, 但是nginx有异军突起之势,大型网站新上线的网站开始渐渐使用nginx了。 而 Microsoft-IIS 和 lighttpd 在大型网站中使用较少。

1.门户网站类:

www.sina.com Apache/2.0.54 (Unix)
blog.sina.com.cn nginx/0.6.36

www.sohu.com Apache
blog.sohu.com nginx
map.sougou.com Apache/2.2.4 (Unix) DAV/2 PHP/5.2.6

www.163.com nginx/0.6.36
news.163.com nginx/0.7.59

www.qq.com Apache

www.aol.com Apache-Coyote/1.1
www.bbc.com Apache
www.cnn.com Apache

2 搜索引擎类
www.baidu.com BWS/1.0
tieba.baidu.com apache 2.7.17.0
news.baidu.com apache2.0.29.0
zhidao.baidu.com apache 1.1.1.0
mp3.baidu.com apache 1.6.14.0
image.baidu.com apache 1.7.16.0
video.baidu.com apache 1.0.5.0

www.google.com gws
mail.google.com GFE/1.3
reader.google.com gws
maps.google.com mfe
docs.google.com GFE/2.0

3 视频网站类
www.tudou.com Apache
www.youku.com Apache
www.6.cn nginx/0.7.21

4 其他
www.hotmail.com Microsoft-IIS/6.0
www.msn.com Microsoft-IIS/6.0

www.cnbeta.com nginx/0.6.35
www.javaeye.com lighttpd/1.4.20
www.csdn.com.cn Microsoft-IIS/6.0

www.joomla.org Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.7a mod_bwlimited/1.4 PHP/5.2.6
www.magentocommerce.com nginx/0.6.36

www.yaozer.cn Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.6 with Suhosin-Patch mod_ssl/2.2.8 OpenSSL/0.9.8g

分享家:Addthis中国

Apache ab介绍

星期一, 12月 22nd, 2008

开源性能测试工具-Apache ab介绍, 原文在此

Apache ab (ApacheBench) 可以用来进行简单的并发测试。 比如  ab -n 10 -c 10 http://www.yaozer.cn/ .

分享家:Addthis中国

Apache2.0性能优化—MPM的选择与配置zz and MySQL性能优化zz

星期二, 10月 14th, 2008

Apache2.0性能优化—MPM的选择与配置: http://bbs.51cto.com/archiver/tid-32770.html
MySQL性能优化的参数简介:http://database.51cto.com/art/200512/13055.htm

分享家:Addthis中国

apache2 : (98)Address already in use

星期六, 7月 26th, 2008

突然发现无法连接51kaiyuan.com, 于是准备restart apache2。结果如下:

* Starting web server apache2 (98)Address already in use: make_sock: could not bind to address 222.73.44.209:80
no listening sockets available, shutting down
Unable to open logs                          [fail]

参看端口占用情况: sudo netstat -antup

结果如下:

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 222.73.44.209:80 0.0.0.0:*               LISTEN      4954/apache2
……

显然apache2还在运行,为什么restart不成功呢?先stop它再说,

sudo /etc/init.d/apache2 stop

* Stopping web server apache2

httpd (no pid file) not running                    [ OK ]
好了,显示stop成功。再次restart,却还是提示(98)Address already in use,为什么呢?一看端口占用情况,apache2还在?ft,stop apache2成功但是进程还在运行,这是怎么回事呢

强行kill 进程apache2, 再start apache2, 终于成功了。

分享家:Addthis中国