apache

A trail of 14 pages, marked with comments, by enjoylife
About this trail:

APXS is a Perl script that is created when you build the Apache web server from source. Chances are that if you are getting these errors and you obtained Apache as a binary distribution, that APXS is not configured correctly for your system. Your best bet is to get the Apache source from http://httpd.apache.org and build it yourself. Use the following for a basic build (read the Apache docs for other options):

[user@host] ~ $ cd /usr/local/src
[user@host] ~ $ gzip -dc apache_1.3.19.tar.gz|tar xvf -
[user@host] ~ $ cd apache_1.3.19
[user@host] ~ $ ./configure --prefix=/usr/local/apache \
[user@host] ~ $ --enable-module=most \
[user@host] ~ $ --enable-shared=max
[user@host] ~ $ make
[user@host] ~ $ make install

Note: The above steps assume that you downloaded the Apache source and placed it in your /usr/local/src directory.

14 marks in this trail
1

APXS is a Perl script that is created when you build the Apache web server from source. Chances are that if you are getting these errors and you obtained Apache as a binary distribution, that APXS is not configured correctly for your system. Your best bet is to get the Apache source from http://httpd.apache.org and build it yourself. Use the following for a basic build (read the Apache docs for other options):

[user@host] ~ $ cd /usr/local/src
[user@host] ~ $ gzip -dc apache_1.3.19.tar.gz|tar xvf -
[user@host] ~ $ cd apache_1.3.19
[user@host] ~ $ ./configure --prefix=/usr/local/apache \
[user@host] ~ $ --enable-module=most \
[user@host] ~ $ --enable-shared=max
[user@host] ~ $ make
[user@host] ~ $ make install

Note: The above steps assume that you downloaded the Apache source and placed it in your /usr/local/src directory.

2

I had the very same problem. This means that you
don't have cygserver installed. Apache2 requires
cygserver. See this thread on the Cygwin mailing
list:
http://www.cygwin.com/ml/cygwin-apps/2005-02/msg00085.html

There are a few steps to installing cygserver. First
of all, try typing in:
cygserver-config

If you get something like "command not found" then you
need to run Cygwin setup, go to Admin and find
cygserver. Install it.

Then go here:
http://www.cygwin.com/cygwin-ug-net/using-cygserver.html
and follow the directions which start at "How to
start Cygserver". They claim that installing
cygserver as an NT service is optional, but that
wasn't my experience. Be sure to make sure you have a
Windows environment variable called "CYGWIN" and that
it contains the word "server".

Then you just run:
cygserver-config

When it's finished, start the service :
net start cygserver

Then you should be able to start Apache with:
/usr/sbin/apachectl2 start


Good luck!

-Ethan Herdrick
www.herdrick.com

The service has been installed under LocalSystem account.
To start it, call `net start cygserver' or `cygrunsrv -S cygserver'.

Further configuration options are available by editing the configuration
file /etc/cygserver.conf.  Please read the inline information in that
file carefully. The best option for the start is to just leave it alone.

Please keep in mind, that a client application which wants to use
the services provided by cygserver *must* have the environment variable
CYGWIN set so that it contains the word "server".  So, if you don't
need any other special CYGWIN setting, just set it to "server".

It is advisable to add this setting to the Windows system environment.

Basic Cygserver configuration finished. Have fun!
4
Using apxs to create shared DLL modules

To make the extending httpd with shared DLL modules easier, you can use apxs.

Make sure you have configured $CFG_LDFLAGS_SHLIB within apxs to include the --shared directive and the path to the shared code DLL cyghttpd.dll.

After performing make install you will probably have the following lines within your apxs:

  # apxs
  [...]
  my $CFG_LD_SHLIB      = q(dllwrap --export-all --output-def libhttpd.def --implib libhttpd.a --driver-name gcc);          # substituted via Makefile.tmpl
  my $CFG_LDFLAGS_SHLIB = q(-g); # substituted via Makefile.tmpl 
  my $CFG_LIBS_SHLIB    = q();        # substituted via Makefile.tmpl 
  [...]
Change these to reflect the new compile options needed for shared DLL modules as follows:
  # apxs
  [...]
  my $CFG_LD_SHLIB      = q(gcc);          # substituted via Makefile.tmpl
  my $CFG_LDFLAGS_SHLIB = q(-g --shared); # substituted via Makefile.tmpl 
  my $CFG_LIBS_SHLIB    = q(/path/to/cyghttpd.dll);        # substituted via Makefile.tmpl 
  [...]

Now you should be able to create a shared DLL module from a mod_foo.c source file with:

  $ apxs -c mod_foo.c -o mod_foo.dll
Place the resulting DLL in Apache's libexec directory, so the dlopen() function within the compiled in mod_so.c module can find and load it at runtime.
5
   

Apache is controlled by a series of configuration files: httpd.conf, access.conf. and srm.conf (there's actually also a mime.types file, but you have to deal with that only when you're adding or removing MIME types from your server, which shouldn't be too often). The files contain instructions, called directives, that tell Apache how to run. Several companies offer GUI-based Apache front-ends, but it's easier to edit the configuration files by hand.

Remember to make back-up copies of all your Apache configuration files, in case one of the changes you make while experimenting renders the Web server inoperable.

Also, remember that configuration changes you make don't take effect until you restart Apache. If you've configured Apache to run as an inetd server, then you don't need to worry about restarting, since inetd will do that for you.

Download the reference card

As with other open-source projects, Apache users share a wealth of information on the Web. Possibly the single most useful piece of Apache-related information--apart from the code itself, of course--is a two-page guide created by Andrew Ford.

Called the Apache Quick Reference Card, it's a PDF file (also available in PostScript) generated from a database of Apache directives. There are a lot of directives, and Ford's card gives you a handy reference to them.

While this may not seem like a tip on how to run Apache, it will make your Apache configuration go much smoother because you will have the directives in an easy-to-access format.

One quick note--we found that the PDF page was a bit larger than the printable area of our printer (an HP LaserJet 8000 N). So we set the Acrobat reader to scale-to-fit and the pages printed just fine.

http://articles.techrepublic.com.com/5100-22-5076696.html

6

If you want to build quickly and creatively, you need to set up an environment that encourages and facilitates that process. If you don’t have the following basics down, your team will be constantly battling annoying issues instead of getting on with building. You’ll need:

  1. Good version control. I suggest Git.
  2. An easy-to-use source and changeset browser. We use Codebase.
  3. Solid server infrastructure. Why not build on Flexiscale, Grid-Service, Mosso or EC2 and let the big boys worry about uptime and server load?
  4. A ‘one-click’ deployment system. This means that deploying the code from your repository should take just one click. If it’s any more complex than that, there is potential for complications and downtime. Capistrano is brilliant if you’re using Rails.
  5. Printers, chalk boards and meeting space. People need the physical space to throw around ideas. We’ve painted an entire wall with blackboard paint so the team has room to sketch ideas.
  6. Coffee, water, music and healthy snacks.
7
I worked around the problem by editing
/usr/lib/gcc-lib///specs file
to remove the --as-needed and --noas-needed switches,
now everything works!

it's very strange that this problem occurs with the same exact version of gcc+binutils that don't have a problem on other platforms.
8

A HelloWorld Module

Apache:

1)build

gcc -fpic -DSHARED_MODULE -I/usr/include/apr-0 -I/usr/include/httpd -c  ./mod_helloworld.c

ld -Bshareable -o mod_helloworld.so mod_helloworld.o


2) install

cp ./mod_helloworld.so /usr/lib/httpd/modules/

chmod 755 /usr/lib/httpd/modules/mod_helloworld.so



vi  /etc/httpd/conf/httpd.conf


LoadModule helloworld_module modules/mod_helloworld.so
<Location /helloworld>
SetHandler helloworld
</Location>

then
apachectl restart

3) testing
http://localhost/helloworld
you will see :
this is a sample paged developed by xxxx after numerious struglling!!!

for apache2 in ubuntu

gcc -fpic -DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -DSHARED_MODULE -I/usr/include/apache2 -I/usr/include/apr-1.0 -pthread -c mod_helloworld.c
ld -Bshareable -o mod_helloworld.so mod_helloworld.o
if you need to link additional library ld -Bshareable -o mod_helloworld.so mod_helloworld.o -L. -lmyutils

sudo cp ./mod_helloworld.so /usr/lib/apache2/modules
sudo chmod 644 /usr/lib/apache2/modules/mod_helloworld.so

then set up similar entries in /etc/apache2/
modules_available

like:
sudo cp ./status.load ./helloworld.load
sudo cp ./status.conf ./helloworld.conf

sudo vim ./helloworld.load
LoadModule helloworld_module /usr/lib/apache2/modules/mod_helloworld.so

sudo vim ./helloworld.conf
<IfModule mod_helloworld.c>
#
# Allow server status reports generated by mod_status,
# with the URL of http://servername/server-status
# Uncomment and change the ".example.com" to allow
# access from other hosts.
#
<Location /helloworld>
SetHandler helloworld
# Allow from .example.com
</Location>

</IfModule>


sudo ln -s ../mods-available/helloworld.conf ./helloworld.conf
sudo ln -s ../mods-available/helloworld.load ./helloworld.load



sudo /usr/sbin/apache2ctl stop
sudo /usr/sbin/apache2ctl start
9

As I said the second and third steps are troublesome only when not done before. Here is an implementation for those steps that I’ve written as a part of (yet unreleased) CGI library for C++. It implements functions that take the care of the first three steps and return to the user an STL map containing the form elements’ names in the key and their value in the map pair’s value. This functions allows to process forms in a similar way to processing forms in PHP using $_GET and $_POST.

Here is a simple example of processing a “get” form using the above getpost.h header file.

10

Apache JServ Protocol Version 1.1 (AJPv1.1)

Standard - September 9, 1998

describes the protocol used to communicate between a web server module
and the Apache JServ servlet engine over a TCP socket.

Introduction

The authentication scheme used for AJPv1.0 (used by Apache JServ 0.9.xx) was considered too simple and worked only on local environments. For this reason, while the request/response phase of the protocol were kept unchanged, authentication handshake was ported from higher versions of the protocol (proposed as a future extension) and implemented here for security reasons.

This will also provide more feedback to developers for newer revisions of the AJP protocol.

11
Cookies
Cookies are a method to store persistant data with the client. The system must be suppored by both the client (and enabled; there is much hype over a few relatively minor security considerations about cookies) and the web server (most do). Much information on exactly how this works with different browsers etc... can be found on the Internet. For the purposes of this brief document you only need to know the following:
Cookies are set with a header (before the Content) of the format:

Set-Cookie: name=value; expires=date; path=path; domain=domain; secure

Only the name=value bit is required and can contain anything other than semi-colons or whitespace. Expires is obvious, path the path on the server the cookie relates to (is provided to) i.e. /cgi-bin/ and domain is the domain the cookie relates to (is provided to) i.e. www.company.com or .company.com to provide it to www and www2.company.com).

Cookies are read via the HTTP_COOKIE environment variable and come in one long string of the format:

var1=value; var2=value; var3=value

If a cookie is set more than once (this can happen if, for example, the same cookie name is set for both .company.com and www.company.com - both are seen as seperate cookies by the browser but both are valid and provided to a request to www.company.com) it will appear twice (or however many times) in the list. By default (Firefox and IE with Apache) the cookie is valid for the FQDN of the webserver, for the directory the script that set it came from and for the duration of this session (usually until browser closes).
14
标 题: 湾区各月出游指南
发信站: BBS 未名空间站 (Mon Aug 24 00:34:07 2009, 美东)

湾区各月出游指南 by qcc

看了z00同学的yosemite for dummy,深受启发。我也是个爱四处游荡的人,在湾区8年
,逛过的地方也不少。经常看到版上有人问湾区周围有什么地方可以去玩,我也想把这
么多年走过的地方和大家分享一下。湾区乃至北加州周围有山有海,有森林,有湖泊,
地形起伏变化,风景极具多样性,全年都可以找到游玩的好地方。但是,很多地方有季
节性。所谓在正确的时间,去正确的地方,如果碰巧遇到正确的人,岂不美哉?

下面,就把我老喜欢的地方按月份列一列。我们的口号是:全湾区爱玩的人,联合起来!

一月,是滑雪的高峰季节。Kirkwood是WSN们的最爱, 每到周末,就成群结队carpool
而去,the wall 上呼啸而下的不是雪板,是寂寞。已婚有孩的爱走80去northstar,已
婚无孩的couple喜欢去heavenly,白天滑雪,晚上还可以去赌场消磨。

二月,喜欢滑雪的,还在继续滑。有心人已经开始注意到季节的变换了。湾区春来早,
有些地方已经可以看到野花的踪迹。但是,如果要看野花,二月份应该去南加州。如果
雨水好,death valley, anza borrego park, antelope valley都会有满山遍野的野花
,十分壮观。特别是antelop valley,是加州著名的州花 – 罂粟花的保留地。

三月,赏花季节进入高潮。我特别喜欢这几个地方,一个是fresno 的blossom trail,
各种果树都在此时开花,可谓繁花似锦。还有woodside的filoli garden,以郁金香闻
名。Napa valley的mustard festival也在此时。如果不想开车出远门,湾区的Mt
Diablo, Point Reyes, Henry Coe都是看花的好地方。想看油菜花,东湾coyote hill
是个不错的地方。另外,三月还是出海看鲸鱼的月份,不过本人晕船,从没去过。

四月,只剩下死忠的滑雪男还会起早贪黑往lake tahoe跑了。前半个月,大部分人在焦
头烂额的忙于保税,似乎都忘了要出门玩了。的确,四月是个比较尴尬的月份,
highlight确实不多。且慢!别忘了湾区附近无数的瑰宝。四月是个Hiking的好季节,
这时候,雨季基本结束,热天还未到来,正是四处踏青的好时光。推荐的地方有,big
basin, point reyes,sunol, pinnacle, angel island,big sur,还有中半岛一线的
众多公园。这时候,山中泉水淙淙,林茂叶盛,爱玩的朋友们正好在hiking 中相互熟
悉,为即将开始的summer旅行寻找旅伴。

五月,yeah! 大家第一个想到的就是yosemite,这时候,山路上的积雪化的查不多了,
而山中的瀑布则是最壮观的时候,所以五月份的每个周末,valley里面总是people
mountain, people sea. 不过yosemite的landmark – half dome上的缆绳一般要到
memorial weekend 前后装上去,所以,喜欢challenge的朋友要等一等。另外,我每年
五月一定会去的一个活动是三藩的baytobreakers,这个是一个7.5mile的长跑活动,横
穿三藩市,每年都有五六万人参加,已有百年历史。在这里能看到传说已久的裸奔。另
外,如果有计划穿越大峡谷的朋友,五月是你最后的机会了,之后,那里就是大火盆了。

六月,summer finally comes。爬half dome 的最好季节,yosemite依旧是出门的首选
。夏天到了,camping的季节也到了。加州是camping 的天堂,夏天基本不会有雷雨,
由于干,蚊子也很少。哦对了,六月其实是爬加州北边mt shasta的最好季节。因为这
个时候,storm的概率减少,而山上的积雪还未融化,不会有rock falling的危险。Mt
shasta有一万四千多英尺高,个人感觉,一般体力稍好,没有高山反应,会基本的
climbing技巧,都应该能爬上去。六月还是rafting的好时候,各个河流流量充沛,
american river, cache creek, russion river都是大家常去的地方。

七月,可去的地方实在太多了。我每年七月都要计划一个long trip。一条路线是加州
北边的redwood park以及oregon的crater lake. Crater lake海拔有7千尺,太早去,
路可能没开。Lassen volcanic national park我也在july 4th去过。还有sequoia/
kings canyon,都是七月出游的理想目的地。当然,加州以外,黄石,大提顿,冰川是
这个时候旅行的经典路线。如果去阿拉斯加,七月也不错。

八月,基本上,七月份能去的地方,八月份都能去。不过,我每年八月份的时候,都会
去一个地方,就是lake tahoe。八月的lake tahoe,湖水经过一个夏天的烘晒,已经不
是那么冰冷了。你既可以在湖中畅游,也可以租一艘kayak,轻舟荡漾,湖光山色,美
不胜收。另外,加州北边的shasta lake, whiskeytown lake都是消暑的好去处。湾区
周围的话, 东湾livermore的lake del valle是个消暑休闲的好地方。如果湾区出现高
温天气的话,去santa cruz, monterey 的路上就会堵满车。

九月,labor day在美国的大多数地方,是夏天结束的标志。实际上在湾区,整个九月
基本上还可以算作夏天。Again, 对喜欢爬山的朋友,labor day weekend是挑战Mt
Whitney这个美国大陆的最高峰的好时机。和mt Shasta不同,爬mt whitney 基本还是
走hiking trail, 九月的时候,山上的积雪都已融化 ,而storm season 尚未到来,正
好爬 whitney。不过,要记住,爬山的permit二月份就要开始申请。

十月,夏天的出游高潮告一段落。然而,爱玩的人是永远不会闲着的。夏去秋来,正是
赏秋叶的时光。加州以常青树居多,秋叶自然不能和东岸的满山遍野相比,倒也别有特
色。提到秋叶,不能不提eastern sierra。这里山体陡峭,气势宏伟,和西边的缓缓上
升的山脉大相径庭。Mammoth lake, june lake, bishop附近都有不错的秋色。其他大
家常去赏叶的地方有lake tahoe,hope valley, plumas county等等。湾区附近,
henry coe尚可一看。不过,只要留心,在湾区开车时,路边也经常能看到成片的秋叶。

十一月,十一月份是holiday season 的开始。湾区的第一场雨到来,气温陡降。按照
我候鸟一样的行动规律,一般是往南行。每年的十一月,或者去LA/SD探亲访友,或者
远行至arizona, utah一带的national parks。犹他和arizona接境处,有一个区域,称
作grand circle,包括大峡谷,zion, bryce canyon, arches, canyon land, capitol
reef, monument valley等国家公园和纪念碑。这一带是美国西部风景的精华。

十二月,满街都是”jingle bell, jingle bell”的音乐,是一个温馨的月份。或者说
,十二月份是团聚的日子,而不是出门的日子。但是对于我们幸苦的硅工而言,年底通
常有难得的长假,所以一定要利用。这个时间段我去过florida, Hawaii, las vegas,
LA/SD等地。十二月份也是滑雪季节的开始,我来美国最开心的时光就是和朋友们在
lake tahoe 的ski party中度过的。

Add your comment: