⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 1296.html

📁 著名的linux英雄站点的文档打包
💻 HTML
📖 第 1 页 / 共 3 页
字号:
                    <TBODY>
                    <TR>
                        <TD vAlign=top width="80%"> 
                          <DIV align=center>
                        <FORM action="search.html" tppabs="http://www.linuxhero.com/docs/search.html" method=get>
                            </FORM>
                        <TABLE cellSpacing=0 cellPadding=0 width="95%" 
                          border=0><TBODY>
                          <TR>
                            <TD background="images/bgi.gif" tppabs="http://www.linuxhero.com/docs/images/bgi.gif" 
                          height=30></TD></TR></TBODY></TABLE>
                        <TABLE cellSpacing=0 cellPadding=3 width="95%" 
                        align=center border=0>
                          <TBODY>
                          <TR>
                            <TD>
                              <TABLE cellSpacing=0 cellPadding=3 width="100%" 
                              border=0>
                                <TBODY>
                                <TR>
                                      <TD vAlign=top> 
<p><FONT class=normalfont><B><font color=blue>apache的完全安装</font></B></FONT><BR><FONT class=smallfont color=#ff9900>2004-04-23 15:18 pm</FONT><BR><FONT class=normalfont>作者:作者<br>来自:Linux知识宝库<br>联系方式:无名<br><br>Unix 服务器的安装与配置 (FreeBSD) 之Apache的完全安装(apache+php4+mod_ssl+mod_perl+mod_fastcgi+mod_gzip)<br>
<br>
本文主要讨论源代码方式的安装。<br>
<br>
从互联网下载以下几个程序(本文采用DSO方式安装),按如下步骤进行处理:<br>
1、apache_1.3.27.tar.gz<br>
2、mod_ssl-2.8.12-1.3.27.tar.gz<br>
3、mod_perl-1.0-current.tar<br>
4、mod_gzip-1.3.26.1a.tar.gz<br>
5、mod_fastcgi-2.4.0.tar.gz<br>
6、php-4.3.1.tar.gz<br>
(另需安装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)<br>
<br>
安装pth-1.4.1<br>
server# tar zxvf pth-1.4.1.tar.gz<br>
server# cd pth-1.4.1<br>
server# ./configure --enable-pthread<br>
server# make<br>
server# make test<br>
server# make install<br>
<br>
安装mm-1.1.3<br>
server# tar zxvf mm-1.1.3.tar.gz<br>
server# cd mm-1.1.3<br>
server# ./configure --disable-shared<br>
server# make<br>
server# make test<br>
server# make install<br>
<br>
安装perl-5.6.1<br>
server# tar zxvf perl-5.6.1.tar.gz<br>
server# cd perl-5.6.1<br>
server# sh Configure -de<br>
server# make<br>
server# make test<br>
server# make install<br>
<br>
安装zlib-1.1.4<br>
server# tar zxvf zlib-1.1.4.tar.gz<br>
server# cd zlib-1.1.4<br>
server# ./configure<br>
server# make test<br>
server# make install<br>
<br>
安装libpng-1.2.5 (need zlib-1.1.4、png)<br>
server# pkg_add png-version<br>
server# tar zxvf libpng-1.2.5.tar.gz<br>
server# cd libpng-1.2.5<br>
server# cp scripts/makefile.freebsd makefile<br>
server# make<br>
server# make test<br>
server# make install<br>
<br>
安装apache_1.3.27 + mod_ssl-2.8.12-1.3.27 (need OpenSSL、MM、Prel_5.6.0) + mod_perl-1.0-current<br>
1、解压缩包(以下文件解压在同一个目录下)<br>
server# tar zxvf apache_1.3.27.tar.gz<br>
server# tar zxvf mod_ssl-2.8.12-1.3.27.tar.gz<br>
server# tar zxvf mod_perl-1.0-current.tar<br>
2、配置mod_ssl-2.8.12-1.3.27<br>
server# cd mod_ssl-2.8.12-1.3.27<br>
server# ./configure --with-apache=../apache_1.3.27 <br>
--with-mm=../mm-1.1.3 <br>
--prefix=/usr/local/apache <br>
--enable-shared=ssl<br>
server# cd ..<br>
3、配置安装mod_perl-1.27<br>
server# cd mod_perl-1.27<br>
server# perl Makefile.PL EVERYTHING=1 APACHE_SRC=../apache_1.3.27/src USE_APACI=1 PREP_HTTPD=1 DO_HTTPD=1 (Freebsd 4.7下有两处错误提示,忽略)<br>
server# make<br>
server# make install<br>
server# cd ..<br>
4、配置安装apache_1.3.27<br>
server# cd apache_1.3.27<br>
server# ./configure --prefix=/usr/local/apache <br>
--enable-module=ssl <br>
--activate-module=src/modules/perl/libperl.a <br>
--enable-module=most <br>
--enable-shared=max<br>
server# make<br>
server# make certificate(生成证书,按提示选择,并记下密码)<br>
server# make install<br>
<br>
安装mod_gzip-1.3.26<br>
server# tar zxvf mod_gzip-1.3.26.1a.tar.gz<br>
server# cd mod_gzip-1.3.26.1a<br>
server# edit Makefile(将APXS的路径 APXS?=/usr/local/sbin/apxs 改成apache安装路径: APXS?=/usr/local/apache/bin/apxs)<br>
server# make<br>
server# make install<br>
<br>
安装mod_fastcgi-2.4.0<br>
server# tar zxvf mod_fastcgi-2.4.0.tar.gz<br>
server# cd mod_fastcgi-2.4.0<br>
server# /usr/local/apache/bin/apxs -o mod_fastcgi.so -c *.c<br>
server# /usr/local/apache/bin/apxs -i -a -n fastcgi mod_fastcgi.so<br>
<br>
安装php-4.3.1 (need gettext、freetype、jpeg、gd、gd2、png、这里假设mysql已经安装并运行)<br>
server# pkg_add gettest-version<br>
server# pkg_add jpeg-version<br>
server# pkg_add gd-version<br>
server# pkg_add gd2-version<br>
server# tar zxvf php-4.3.1.tar.gz<br>
server# cd php-4.3.1<br>
server# ./configure --with-apxs=/usr/local/apache/bin/apxs <br>
--with-config-file-path=/usr/local/apache/conf <br>
--with-mysql=/usr/local/mysql --with-mysql-sock=/tmp/--enable-versioning <br>
--enable-ftp --enable-bcmath --disable-debug --enable-memory-limit=yes <br>
--enable-track-vars --enable-sysvsem --enable-sysvshm --with-gettext <br>
--enable-trans-sid --enable-fastcgi --with-tsrm-pth=pth-config <br>
--with-freetype-dir=/usr/local --with-jpeg-dir=/usr/local --with-gd=/usr/local <br>
--enable-gd-native-ttf --with-png-dir=/usr/local --with-zlib=/usr/local <br>
--with-zlib-dir=/usr/local --with-mm=/usr/local --with-openssl --with-iconv<br>
server# make<br>
server# make install<br>
server# cp php.ini-dist /usr/local/apache/conf/php.ini<br>
配置apache是其支持php,及php.ini文件:<br>
在/use/local/apache/conf下有这两个文件:<br>
1、/usr/local/apache/conf/httpd.conf 示例:httpd.conf<br>
2、/usr/local/apache/conf/php.ini 示例:php.ini<br>
在httpd.conf中添加:<br>
AddType application/x-httpd-php .php .php3<br>
AddType application/x-httpd-php-source .phps<br>
配置php.ini:<br>
upload_tmp_dir /tmp<br>
default_charset gb2312<br>
register_globals On<br>
<br>
安装至此完成,可以使用如下命令启动apache:<br>
server# /usr/local/apache/bin/apachectl start<br>
如果要使用https则使用如下命令启动:<br>
server# /usr/local/apache/bin/apachectl startssl<br>
(键入证书密码,然后回车)<br>
<br>
编写apache的自启动文件(Freebsd下):<br>
server# edit /usr/local/etc/rc.d/apache-server.sh 示例:apache-server.sh<br>
server# chmod 755 apache-server.sh<br>
重新启动服务器,Bind9就可以自动运行!<br>
<br>
测试服务器:<br>
在/usr/local/apache/htdocs下编辑test.php来测试php是否安装成功 示例:test.php<br>
&lt;?<br>
phpinfo()<br>
?&gt;<br>
在浏览器中的地址栏中输入http://www.nankai.edu.cn/test.php即可以显示php的安装信息。<br>
如果你使用的是apachects startssl命令启动的话,你可以<br>
在浏览器中的地址栏中输入:https://www.nankai.edu.cn/test.php来显示php的安装信息。<br>
<br>
虚拟服务器的设置(摘自化境编程界Apache Server设置虚拟WEB 作者:不详)原文,未加修改:<br>
一 、IP型虚拟主机<br>
IP型虚拟主机指每一虚拟主机对应唯一的IP。可通过多个物理网卡或虚拟网口实现多IP,Solaris2.5和Windows NT都支持这种方式。<br>
两种配置多虚拟主机的方法:<br>
1、为每一虚拟主机启动一个httpd进程。<br>
下列情况下使用此方法:<br>
1) 需考虑安全隔离问题,如两个httpd运行于不同的User、Group、Listen、ServerRoot,两者用户除通过Web相互浏览数据,无法访问其他数据。<br>
2) 能提供足够内存和文件描述器。<br>
设置方法:<br>
为每一虚拟主机建立一个独立的httpd安装,在每一个安装路径的配置文件httpd.conf里,用Listen指令指定进程服务的IP,如:Listen 10.68.37.10:80<br>
2、为所有虚拟主机启动一个httpd进程。<br>
下列情况下使用此方法:<br>
1) 允许在虚拟主机间共享httpd配置。<br>
2) 计算机服务于大量的请求,运行多个进程使服务器性能降低成为重要考虑因素。<br>
设置方法:<br>
在配置文件httpd.conf里,用VirtualHost指令为每一虚拟主机设置ServerAdmin、ServerName、DocumentRoot、 ErrorLog、TransferLog或CustomLog,如:<br>
&lt;VirtualHost www.smallco.com&gt; #此处建议用IP<br>
ServerAdmin webmaster@mail.smallco.com<br>
DocumentRoot /usr/local/etc/httpd/htdocs/smallco<br>
ServerName www.smallco.com #建议此处用域名<br>
ErrorLog /usr/local/etc/httpd/logs/smallco/error_log<br>
TransferLog /usr/local/etc/httpd/logs/smallco/access_log<br>
&lt;/VirtualHost&gt;<br>
&lt;VirtualHost www.baygroup.org&gt; #此处建议用IP<br>
ServerAdmin webmaster@mail.baygroup.org<br>
DocumentRoot /groups/baygroup/www<br>
ServerName www.baygroup.org #建议此处用域名<br>
ErrorLog /groups/baygroup/logs/error_log<br>
TransferLog /groups/baygroup/logs/access_log<br>
&lt;/VirtualHost&gt;<br>
同时要做虚拟网口或网卡的配置,在DNS也要做相应设置。<br>
二 、名字型虚拟主机(Apache1.3以上版本支持)<br>
  IP型虚拟主机虽好,但不是最佳方案。它要求每一虚拟主机有一专用 IP,在某些机器上难于实现。名字型虚拟主机是指每一虚拟主机的名字不相同,但IP一样。它的好处是不限制虚拟主机数量,配置、使用简单,不需另外的软硬件。缺点是客户端必须支持该部分协议,最近版本的浏览器都支持,某些老版本浏览器不支持。但Apache为此提供了解决方法。<br>
设置方法:<br>
在配置文件httpd.conf里,用NameVirtualHost指令设置虚拟主机,如:<br>
NameVirtualHost 111.22.33.44<br>
&lt;VirtualHost 111.22.33.44&gt; #建议此处用IP<br>
ServerName www.domain.tld #建议此处用域名<br>
DocumentRoot /web/domain<br>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -