ImageVerifierCode 换一换
格式:DOCX , 页数:13 ,大小:18.73KB ,
资源ID:4930688      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/4930688.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(apache完全安装手册.docx)为本站会员(b****4)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

apache完全安装手册.docx

1、apache完全安装手册Unix 服务器的安装与配置 (FreeBSD) 之Apache的完全安装(apache+php4+mod_ssl+mod_perl+mod_fastcgi+mod_gzip) 本文主要讨论源代码方式的安装。 从互联网下载以下几个程序(本文采用DSO方式安装),按如下步骤进行处理: 1、apache_1.3.27.tar.gz 2、mod_ssl-2.8.12-1.3.27.tar.gz 3、mod_perl-1.0-current.tar 4、mod_gzip-1.3.26.1a.tar.gz 5、mod_fastcgi-2.4.0.tar.gz 6、php-4.3.

2、1.tar.gz (另需安装pth-1.4.1.tar.gz、mm-1.1.3.tar.gz、perl-5.6.1.tar.gz、zlib-1.1.4.tar.gz、libpng-1.2.5.tar.gz、png、gettext、freetype、jpeg、gd、gd2) 安装pth-1.4.1 server# tar zxvf pth-1.4.1.tar.gz server# cd pth-1.4.1 server# ./configure -enable-pthread server# make server# make test server# make install 安装mm-1.1

3、.3 server# tar zxvf mm-1.1.3.tar.gz server# cd mm-1.1.3 server# ./configure -disable-shared server# make server# make test server# make install 安装perl-5.6.1 server# tar zxvf perl-5.6.1.tar.gz server# cd perl-5.6.1 server# sh Configure -de server# make server# make test server# make install 安装zlib-1.

4、1.4 server# tar zxvf zlib-1.1.4.tar.gz server# cd zlib-1.1.4 server# ./configure server# make test server# make install 安装libpng-1.2.5 (need zlib-1.1.4、png) server# pkg_add png-version server# tar zxvf libpng-1.2.5.tar.gz server# cd libpng-1.2.5 server# cp scripts/makefile.freebsd makefile server# m

5、ake server# make test server# make install 安装apache_1.3.27 + mod_ssl-2.8.12-1.3.27 (need OpenSSL、MM、Prel_5.6.0) + mod_perl-1.0-current 1、解压缩包(以下文件解压在同一个目录下) server# tar zxvf apache_1.3.27.tar.gz server# tar zxvf mod_ssl-2.8.12-1.3.27.tar.gz server# tar zxvf mod_perl-1.0-current.tar 2、配置mod_ssl-2.8.1

6、2-1.3.27 server# cd mod_ssl-2.8.12-1.3.27 server# ./configure -with-apache=./apache_1.3.27 -with-mm=./mm-1.1.3 -prefix=/usr/local/apache -enable-shared=ssl server# cd . 3、配置安装mod_perl-1.27 server# cd mod_perl-1.27 server# perl Makefile.PL EVERYTHING=1 APACHE_SRC= USE_APACI=1 PREP_HTTPD=1 DO_HTTPD=1

7、(Freebsd 4.7下有两处错误提示,忽略) server# make server# make install server# cd . 4、配置安装apache_1.3.27 server# cd apache_1.3.27 server# ./configure -prefix=/usr/local/apache -enable-module=ssl -activate-module=src/modules/perl/libperl.a -enable-module=most -enable-shared=max server# make server# make certifica

8、te(生成证书,按提示选择,并记下密码) server# make install 安装mod_gzip-1.3.26 server# tar zxvf mod_gzip-1.3.26.1a.tar.gz server# cd mod_gzip-1.3.26.1a server# edit Makefile(将APXS的路径 APXS?=/usr/local/sbin/apxs 改成apache安装路径: APXS?=/usr/local/apache/bin/apxs) server# make server# make install 安装mod_fastcgi-2.4.0 server#

9、 tar zxvf mod_fastcgi-2.4.0.tar.gz server# cd mod_fastcgi-2.4.0 server# /usr/local/apache/bin/apxs -o mod_fastcgi.so -c *.c server# /usr/local/apache/bin/apxs -i -a -n fastcgi mod_fastcgi.so 安装php-4.3.1 (need gettext、freetype、jpeg、gd、gd2、png、这里假设mySQL已经安装并运行) server# pkg_add gettest-version server#

10、pkg_add jpeg-version server# pkg_add gd-version server# pkg_add gd2-version server# tar zxvf php-4.3.1.tar.gz server# cd php-4.3.1 server# ./configure -with-apxs=/usr/local/apache/bin/apxs -with-config-file-path=/usr/local/apache/conf -with-mysql=/usr/local/MYSQL -with-mySQL-sock=/tmp/-enable-versio

11、ning -enable-ftp -enable-bcmath -disable-debug -enable-memory-limit=yes -enable-track-vars -enable-sysvsem -enable-sysvshm -with-gettext -enable-trans-sid -enable-fastcgi -with-tsrm-pth=pth-config -with-freetype-dir=/usr/local -with-jpeg-dir=/usr/local -with-gd=/usr/local -enable-gd-native-ttf -with

12、-png-dir=/usr/local -with-zlib=/usr/local -with-zlib-dir=/usr/local -with-mm=/usr/local -with-openssl -with-iconv server# make server# make install server# cp php.ini-dist /usr/local/apache/conf/php.ini 配置apache是其支持php,及php.ini文件: 在/use/local/apache/conf下有这两个文件: 1、/usr/local/apache/conf/httpd.conf 示

13、例:httpd.conf 2、/usr/local/apache/conf/php.ini 示例:php.ini 在httpd.conf中添加: AddType application/x-httpd-php .php .php3 AddType application/x-httpd-php-source .phps 配置php.ini: upload_tmp_dir /tmp default_charset gb2312 register_globals On 安装至此完成,可以使用如下命令启动apache: server# /usr/local/apache/bin/apachectl

14、start 如果要使用https则使用如下命令启动: server# /usr/local/apache/bin/apachectl startssl (键入证书密码,然后回车) 编写apache的自启动文件(Freebsd下): server# edit /usr/local/etc/rc.d/apache-server.sh 示例:apache-server.sh server# chmod 755 apache-server.sh 重新启动服务器,Bind9就可以自动运行! 测试服务器: 在/usr/local/apache/htdocs下编辑test.php来测试php是否安装成功 示

15、例:test.php 在浏览器中的地址栏中输入 如果你使用的是apachects startssl命令启动的话,你可以 在浏览器中的地址栏中输入: 虚拟服务器的设置(摘自化境编程界Apache Server设置虚拟WEB 作者:不详)原文,未加修改: 一 、IP型虚拟主机 IP型虚拟主机指每一虚拟主机对应唯一的IP。可通过多个物理网卡或虚拟网口实现多IP,Solaris2.5和Windows NT都支持这种方式。 两种配置多虚拟主机的方法: 1、为每一虚拟主机启动一个httpd进程。 下列情况下使用此方法: 1) 需考虑安全隔离问题,如两个httpd运行于不同的User、Group、Liste

16、n、ServerRoot,两者用户除通过Web相互浏览数据,无法访问其他数据。 2) 能提供足够内存和文件描述器。 设置方法: 为每一虚拟主机建立一个独立的httpd安装,在每一个安装路径的配置文件httpd.conf里,用Listen指令指定进程服务的IP,如:Listen 10.68.37.10:80 2、为所有虚拟主机启动一个httpd进程。 下列情况下使用此方法: 1) 允许在虚拟主机间共享httpd配置。 2) 计算机服务于大量的请求,运行多个进程使服务器性能降低成为重要考虑因素。 设置方法: 在配置文件httpd.conf里,用VirtualHost指令为每一虚拟主机设置Serve

17、rAdmin、ServerName、DocumentRoot、 ErrorLog、TransferLog或CustomLog,如: #此处建议用IP ServerAdmin webmaster DocumentRoot /usr/local/etc/httpd/htdocs/smallco ServerName #建议此处用域名 ErrorLog /usr/local/etc/httpd/logs/smallco/error_log TransferLog /usr/local/etc/httpd/logs/smallco/Access_log #此处建议用IP ServerAdmin web

18、mastermail.baygroup.org DocumentRoot /groups/baygroup/www ServerName www.baygroup.org #建议此处用域名 ErrorLog /groups/baygroup/logs/error_log TransferLog /groups/baygroup/logs/Access_log 同时要做虚拟网口或网卡的配置,在DNS也要做相应设置。 二 、名字型虚拟主机(Apache1.3以上版本支持) IP型虚拟主机虽好,但不是最佳方案。它要求每一虚拟主机有一专用 IP,在某些机器上难于实现。名字型虚拟主机是指每一虚拟主机的名

19、字不相同,但IP一样。它的好处是不限制虚拟主机数量,配置、使用简单,不需另外的软硬件。缺点是客户端必须支持该部分协议,最近版本的浏览器都支持,某些老版本浏览器不支持。但Apache为此提供了解决方法。 设置方法: 在配置文件httpd.conf里,用NameVirtualHost指令设置虚拟主机,如: NameVirtualHost 111.22.33.44 #建议此处用IP ServerName www.domain.tld #建议此处用域名 DocumentRoot /web/domain 同时,在DNS定义www.domain.tld指向111.22.33.44。 注意:当在NameVi

20、rtualHost指令后使用IP时,任何使用IP的URL请求都是针对虚拟主机的,主服务器从不会响应一个使用IP的URL 请求。另外,有些服务器希望以多个名字被访问。例如,假设有某一IP的服务器,希望以名domain.tld、www2.domain.tld都能被访问,做法是在VirtualHost指令部分使用ServerAlias指令。如:ServerAlias domain.tld *.domain.tld 另附一些虚拟主机的设置实例。 附:虚拟主机设置实例 IP型的虚拟主机配置 Setup 1: 服务器有两个IP, 111.22.33.44 server.domain.tld 111.22.

21、33.55 www.otherdomain.tld www.domain.tld 是server.domain.tld 的别名(CNAME),代表主服务器。 服务器配置: . Port 80 DocumentRoot /www/domain ServerName www.domain.tld DocumentRoot /www/otherdomain ServerName www.otherdomain.tld . Setup 2: 基本同Setup1,但不设置专门的主服务器。 服务器配置: . Port 80 ServerName server.domain.tld DocumentRoot

22、 /www/domain ServerName www.domain.tld . DocumentRoot /www/otherdomain ServerName www.otherdomain.tld . 这种设置只有当URLhttp:/server.domain.tld时才击中主服务器 Setup 3: 服务器有两个IP, 111.22.33.44 server.domain.tld 111.22.33.55 www-cache.domain.tld www.domain.tld 是server.domain.tld 的别名(CNAME),代表主服务器。 www-cache.domain.

23、tld是proxy-cache,端口是8080,Web服务器使用默认的80。 服务器配置: . Port 80 Listen 111.22.33.44:80 Listen 111.22.33.55:8080 ServerName server.domain.tld DocumentRoot /www/domain ServerName www.domain.tld . ServerName www-cache.domain.tld . order deny,allow deny from all allow from 111.22.33 名字型虚拟主机配置 Setup 1: 服务器有一个IP,

24、 111.22.33.44 server.domain.tld. www.domain.tld和www.sub.domain.tld是别名(CNAMEs) 。 服务器配置: . Port 80 ServerName server.domain.tld NameVirtualHost 111.22.33.44 DocumentRoot /www/domain ServerName www.domain.tld . DocumentRoot /www/subdomain ServerName www.sub.domain.tld . 若使用IP访问服务器,由于 www.domain.tld 有最高

25、优先级,被认为是默认服务器或 第一服务器。 Setup 2:服务器有两个IP, 111.22.33.44 server1.domain.tld 用于主服务器 111.22.33.55 server2.domain.tld 用于虚拟主机 别名www.domain.tld用于主服务器, 别名www.otherdomain.tld用于一个虚拟主机, 别名www.sub.domain.tld,*.sub.domain.tld 用于另一虚拟主机, 服务器配置: . Port 80 ServerName www.domain.tld DocumentRoot /www/domain NameVirtual

26、Host 111.22.33.55 . DocumentRoot /www/otherdomain ServerName www.otherdomain.tld . DocumentRoot /www/subdomain ServerName www.sub.domain.tld ServerAlias *.sub.domain.tld . 混合型(IP/名字)虚拟主机配置 Setup:服务器有三个IP, 111.22.33.44 server.domain.tld 用于名字型虚拟主机 111.22.33.55 www.otherdomain1.tld 用于IP型虚拟主机 111.22.33.

27、66 www.otherdomain2.tld 用于IP型虚拟主机 服务器配置: . Port 80 ServerName server.domain.tld NameVirtualHost 111.22.33.44 DocumentRoot /www/domain ServerName www.domain.tld . DocumentRoot /www/subdomain1 ServerName www.sub1.domain.tld . DocumentRoot /www/subdomain2 ServerName www.sub2.domain.tld . DocumentRoot /www/otherdomain1 ServerName www.otherdomain1.tld . DocumentRoot /www/otherdomain2 ServerName www.otherdomain2.tld . 端口型虚拟主机配置 Setup: 服务器有一个IP, 111.22.33.44 www.domain.tld 不需要另外的别名或IP,采用端口

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1