首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

apache利用mod_python整合

安装所需要的源码包: •  Apache 2.2.22     (http://labs.mop.com/apache-mirror//httpd/httpd-2.2.22.tar.gz) •  Python 2.7.3 (http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz) •  Mod_python 3.3.1 (http://archive.apache.org/dist/httpd/modpython/mod_python-3.3.1.tgz) •  Django 1.4        (https://www.djangoproject.com/download/1.4.1/tarball/) 安装步骤 1.  Apache安装 #tar -zxvf httpd-2.2.22.tar.gz # httpd-2.2.22 # ./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite #make && make install 2.  Python安装 # tar -zxvf Python-2.7.3.tgz #cd Python-2.7.3 # ./configure #make && make install #mv /usr/bin/python /usr/bin/python.bak #ln -s /usr/local/bin/python2.7 /usr/bin/python #python -V         #版本显示2.7.3 3.  django安装 # tar -zxvf Django-1.4.1.tar.gz #cd Django-1.4.1 #python setup.py install            #执行没有报错,就说明安装成功 也可以检查是否成功 #python >> import django                #这样import导入django模块没有报错,就安装成功 4.  mod_python安装 # tar -zxvf mod_python-3.3.1.tgz # cd mod_python-3.3.1 #./configure \ --with-apxs=/usr/local/apache2/bin/apxs \ --with-python=/usr/local/bin/python2.7 #make             #执行make的时候会报错,如下:

01
您找到你想要的搜索结果了吗?
是的
没有找到

http协议户端下载流程

/************************************************************************************** 功能:http协议客户端网络下载测试 时间:2014-03-09 version : V1.0 说明:http协议客户端工作要点 1.创建socketbind本地socket,发起连接connetct ,完成tcp三次握手 2.向服务器发起http请求,即post或get动作,http协议请求格式见   http协议规范  3.读http响应,可以判定http 服务器和客户端是否通讯正常,如果失败,  可以根据错误代码判定不成功原因。  http 响应和http 错误代码见http协议部分  4.http响应会返回内容的长度和内容类型,这个信息在在在线业务中是个  非常有用的信息,比如流媒体是边看边下载,如果要计算流媒体长度  只能从http响应读取。 ***************************************************************************************/ #include <fcntl.h> #include <sys/syscall.h> #include <sys/mman.h> #include <stdio.h> #include <unistd.h> #include <string.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> #include <sys/types.h> #include <errno.h> #include <stdlib.h> #define SERVER_PORT 5000 #define BUF_MASK 0x1ff #define BUF_SIZE (188*7*64) #define O_DIRECT 0x8000 void usage() {     printf("Usage: http_test_client: -d <srv-ip> -p <srv-port> -f <content-file> [-h -a -v]\n");     printf("options are:\n");     printf(" -d <srv-ip>   # IP address of HTTP Server (e.g. 192.168.1.110)\n");     printf(" -p <srv-port> # Port of HTTP Server (e.g. 5000)\n");     printf(" -f <file>     # url of stream; /data/videos prepended (e.g. portugal.mpg) \n");     printf(" -m            # just leave content in memory, dont write to disk (default: write to file)\n");     printf(" -v            # print periodic stats (default: no)\n");     printf(" -h            # prints http_test_client usage\n");     printf("\n"); } double difftime1(struct timeval *start, struct timeval *stop) { double dt = 1000000.*(stop->tv_sec - start->tv_sec) + (stop->tv_usec - start->tv_usec); return dt; } /* This function creates a TCP connection to server and returns the socket descriptor */ int TcpConnect(char *server, int port, int socket_type) { int sd,rc; struct sockaddr_in localAddr, servAddr; struct h

02
领券