﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-cAng^Er-文章分类-About Linux</title><link>http://www.blogjava.net/xiaosao/category/15985.html</link><description>不懂我的人 , 离不了我 , 该了解了解我 !而懂我的人 , 更离不了我 , 因为他们爱我 。</description><language>zh-cn</language><lastBuildDate>Fri, 02 Mar 2007 03:32:35 GMT</lastBuildDate><pubDate>Fri, 02 Mar 2007 03:32:35 GMT</pubDate><ttl>60</ttl><item><title>如何用 Linux 拨号上网</title><link>http://www.blogjava.net/xiaosao/articles/92148.html</link><dc:creator>cAng^Er</dc:creator><author>cAng^Er</author><pubDate>Sat, 06 Jan 2007 01:09:00 GMT</pubDate><guid>http://www.blogjava.net/xiaosao/articles/92148.html</guid><wfw:comment>http://www.blogjava.net/xiaosao/comments/92148.html</wfw:comment><comments>http://www.blogjava.net/xiaosao/articles/92148.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaosao/comments/commentRss/92148.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaosao/services/trackbacks/92148.html</trackback:ping><description><![CDATA[
		<a href="http://fanqiang.chinaunix.net/a1/b1/20010822/0800001162.html">
				<font color="#000000">http://fanqiang.chinaunix.net/a1/b1/20010822/0800001162.html</font>
		</a>
		<br />
		<table height="400" cellspacing="0" cellpadding="0" width="750" border="0">
				<tbody>
						<tr>
								<td valign="center" align="middle" height="40">
										<font color="#000000" size="5">
												<b>如何用 Linux 拨号上网</b>
										</font>
								</td>
						</tr>
						<tr>
								<td align="middle" height="20">
										<small>
												<font color="#000000">本文出自: 作者: 陈汉柱 (2001-08-22 08:00:00)</font>
										</small>
								</td>
						</tr>
						<tr>
								<td align="middle">
										<table cellspacing="0" cellpadding="0" width="700" align="center" border="0">
												<tbody>
														<tr>
																<td valign="top">
																		<font color="#000000">一、Linux 上的 PPP <br />Linux 中已经包括了点对点协议PPP，其主体是 pppd ，如果你已经使用过 Windows95 或 NT 的拨号网络， <br />那么你已经具备了 PPP 的基本经验了。在 Windows95 的 PPP 在同 ISP 连接后，视 ISP 情况不同，会自 <br />动为 Windows 客户机提供 IP 地址和 DNS 服务器地址，而 Linux 的 PPP 不会自动接收 DNS 地址，这是  <br />Linux 与 Windows 的一点区别，所以，Linux 上的 PPP 在协议连接成功后，要多一步 DNS 的配置。  <br /><br />二、Kernel 的准备 <br />你的 Linux 系统必须在 kernel 中配置支持 PPP 功能。如果你的 kernel 目前不支持 PPP，你需要重新生 <br />成一个支持 PPP 的 kernel。重新编译 kernel 的方法可看相关 Howto。  <br /><br />三、用辅助脚本配置 PPP 拨号网络 <br />我一开始想运行 pppd 来连接拨号网络，但很快发现这是太麻烦了，因为选项太多。后来我发现，其实在  <br />Linux 上已经提供了几个 PPP 拨号程序模版，只要对这些模板略作修改，就可轻松联上 PPP 了。根据我 <br />的经验，如果顺利的话，10分钟就能完成配置。  <br /><br />（1）拨号程序所在的目录  <br /><br />对于 RedHat 5.0，这几个拨号程序（Script）在 /usr/doc/ppp-2.2.0f/scripts 下，如果要使用这些脚本， <br />需要把它们拷贝到正确的目录中，具体如下：  <br />ppp-on： PPP 连接脚本 拷贝到 /usr/sbin  <br />ppp-off： PPP 断开脚本 拷贝到 /usr/sbin  <br />ppp-on-dialer： PPP 登录会话脚本 拷贝到 /etc/ppp  <br />ppp-redialer： 可轮循多个电话号码的登陆脚本 拷贝到 /usr/sbin （本文不用）  <br />对于 Slackware 的用户，这些脚本已经安装到正确的目录了，无需做什么。 <br />假定你在你的系统上找不到上述文件，可直接在本文后面的附录中cut。  <br /><br />（2）创建自己的拨号程序  <br /><br />假定现在我们要用 PPP 连接 163 网，我们就可以利用上述脚本来作很简单的配置。虽然我们可以直接在这 <br />些模板上做修改，我还是建议为自己拷贝一份模板，在新的拷贝上作修改比较好。所以，我们先做如下拷贝：  <br /><br />cd /usr/sbin <br />cp ppp-on ppp.163 <br />chmod +x ppp.163 <br />cd /etc/ppp <br />cp ppp-on-dialer dialer.163 <br />chmod +x dialer.163 <br /><br />此外，要保证 ppp-off 也是可执行的  <br /><br />（3）定制自己的拨号程序  <br /><br />首先编辑你的 ppp.163，其中多数内容都不必改动，只要修改以下几处：  <br /><br />TELEPHONE=163 <br />ACCOUNT=<your_login_name><br />PASSWORD=<your_login_password><br />DIALER_SCRIPT=/etc/ppp/dialer.163 <br /><br />另外，在最后的 exec 启动 pppd 一行里，注意提供你的 Modem 所在的串口设备文件（通常是 <br /> COM1 /dev/cua0 或 /dev/ttyS0，COM2 /dev/cua1 或 /dev/ttyS1），并设置串口的通信速度（缺省是 38400， <br /> 对于现在的高速 Modem，这个速度太低了，可设置成 57600以上）。完成后的 ppp.163 内容是：  <br /><br />#!/bin/sh <br /># <br /># Script to initiate a ppp connection. This is the first part of the <br /># pair of scripts. This is not a secure pair of scripts as the codes <br /># are visible with the 'ps' command. However, it is simple. <br /># <br /># These are the parameters. Change as needed. <br />TELEPHONE=163 # 拨号号码 <br />ACCOUNT=YourUserName # 用户名  <br />PASSWORD=YourPassword # 口令，注意限制其他人读取本文件！ <br />LOCAL_IP=0.0.0.0 # 本地IP地址，0.0.0.0 表示动态分配 <br />REMOTE_IP=0.0.0.0 # 原端IP地址，一般是 0.0.0.0 <br />NETMASK=255.255.255.0 # 子网掩码 <br />export TELEPHONE ACCOUNT PASSWORD <br />#  <br /># This is the location of the script which dials the phone and logs <br /># in. Please use the absolute file name as the $PATH variable is not <br /># used on the connect option. (To do so on a 'root' account would be <br /># a security hole so don't ask.) <br /># <br />DIALER_SCRIPT=/etc/ppp/dialer.163 # 拨号登录脚本文件名 <br /># <br /># Initiate the connection <br />#  <br /># I put most of the common options on this command. Please, don't <br /># forget the 'lock' option or some programs such as mgetty will not <br /># work. The asyncmap and escape will permit the PPP link to work with <br /># a telnet or rlogin connection. You are welcome to make any changes <br /># as desired. Don't use the 'defaultroute' option if you currently <br /># have a default route to an ethernet gateway. <br /># <br />exec /usr/sbin/pppd debug lock modem crtscts /dev/ttycua0 57600 \ <br />asyncmap 20A0000 escape FF kdebug 0 $LOCAL_IP:$REMOTE_IP \ <br />noipdefault netmask $NETMASK defaultroute connect $DIALER_SCRIPT <br /><br />然后，检查一下你的登录会话程序 /etc/ppp/dialer.163，在我所在的 163 ISP，这个从模板拷贝过来的 <br />会话程序可直接使用，如果有以下情况，你需要对这个会话程序略作改动：  <br /><br />（1）如果拨号提示输入用户名的提示符不是 login:  <br />（2）如果登录成功后还要用户再交互打入命令 ，才启动 ppp 协议 <br />本文后面的附录三是一个根据上述要求略加修改后的登录脚本。  <br />建议：假如你有多个 ISP 可连接，就创建多个拨号 PPP 连接脚本和相应的 PPP 登录脚本。  <br /><br />四、启动 PPP 和断开 PPP <br />启动你的 PPP 连接唯一要做的就是开启 Modem，运行刚才写好的 ppp.163。你的 ppp.163 脚本将自动拨 <br />号、送出登录信息、完成协议认证，等你看到你的 Modem 上的数据传输指示灯不再闪动并保持连接状态， <br />PPP 连接就完成了，你可以打命令：  <br /><br />netstat -r  <br /><br />查看当前的路由表，如果 PPP 协议连接成功的话，路由表里就会有连接你的 ISP 的缺省路由。你的 PPP <br /> 已经配置成功了。  <br /><br />如果没有成功，注意看一下 /etc/ppp 下的 PPP 出错记录文件。  <br /><br />要断开 PPP 连接，运行 ppp-off。  <br /><br />五、DNS 的配置 <br />PPP 连接成功后，如果要使用 WWW 浏览器、Ftp、Telnet 等服务，必须正确配置 DNS 域名解析。所以， <br />一旦 PPP 连接完毕，应该在 /etc/resolv.conf 中加入一行：  <br /><br />nameserver <your_isp's_dns_server>  <br /><br />注意 nameserver 后面的是你的 ISP 的 DNS 服务器的 IP 地址，并且这一行说明必须放在其他的  <br />nameserver 说明之前，否则，你的 Linux 系统不会访问你的 ISP 的 DNS 服务器。然后，你就能使用各 <br />项 Internet 服务了。  <br /><br />六、自动配置 DNS 解析 <br />本节内容并不是配置 PPP 必需的，但能对 PPP 的使用提供一些方便。  <br /><br />由于你的 Linux 并不总是连在 Internet 上，所以在不连接 PPP 时，需要的 resolv.conf 是不同的。 <br />所以，我们希望有一种办法能根据不同的情况，在 Linux 系统上自动设置合适的 resolv.conf 。  <br /><br />在 /etc/ppp 下，有两个根据 PPP 连接状态自动运行的脚本，ip-up 和 ip-down，分别在 PPP 建立连接 <br />和断开连接时运行，如果用户希望在 PPP 连接或断开时执行某些命令，可以在 /etc/ppp 目录下建立脚 <br />本文件 ip-up.local 和 ip-up.local，在这两个文件中放入要执行的命令。当 PPP 建立连接后，ip-up  <br />会调用 ip-up.local，执行用户命令；当 PPP 断开连接后，ip-down 会调用 ip-down.local ，执行用户 <br />命令。  <br /><br />所以我们可以利用这个机制实现 DNS 解析的自动配置，方法如下：  <br /><br />（1）在 /etc 下编辑分别适用于 PPP 连接状态和正常本地状态的 DNS 解析配置文件，我们假定这两个 <br />文件是 resolv.ppp 和 resolv.normal。  <br /><br />（2）在 /etc/ppp 下建立 ip-up.local，设置其执行权限，并在文件中加入：  <br /><br />cp /etc/resolv.ppp /etc/resolv.conf  <br /><br />（3）在 /etc/ppp 下建立 ip-down.local，设置其执行权限，并在文件中加入：  <br /><br />cp /etc/resolv.normal /etc/resolv.conf  <br /><br />这样设置后，每当 PPP 连接成功后，/etc/resolv.conf 的内容就是 resolv.ppp，而 PPP 断开后， <br />/etc/resolv.conf 被恢复成 resolv.normal 的内容。  <br /><br />附录一：PPP 连接脚本模板 ppp-on <br /><br />#!/bin/sh <br /># <br /># Script to initiate a ppp connection. This is the first part of the <br /># pair of scripts. This is not a secure pair of scripts as the codes <br /># are visible with the 'ps' command. However, it is simple. <br /># <br /># These are the parameters. Change as needed. <br />TELEPHONE=555-1212 # The telephone number for the connection <br />ACCOUNT=george # The account name for logon <br />PASSWORD=gracie # The password for this account <br />LOCAL_IP=0.0.0.0 # Local IP address if known. Dynamic = 0.0.0.0 <br />REMOTE_IP=0.0.0.0 # Remote IP address if desired. Normally 0.0.0.0 <br />NETMASK=255.255.255.0 # The proper netmask if needed <br /># <br /># Export them so that they will be available at 'ppp-on-dialer' time. <br />export TELEPHONE ACCOUNT PASSWORD <br />#  <br /># This is the location of the script which dials the phone and logs <br /># in. Please use the absolute file name as the $PATH variable is not <br /># used on the connect option. (To do so on a 'root' account would be <br /># a security hole so don't ask.) <br /># <br />DIALER_SCRIPT=/etc/ppp/ppp-on-dialer <br /># <br /># Initiate the connection <br />#  <br /># I put most of the common options on this command. Please, don't <br /># forget the 'lock' option or some programs such as mgetty will not <br /># work. The asyncmap and escape will permit the PPP link to work with <br /># a telnet or rlogin connection. You are welcome to make any changes <br /># as desired. Don't use the 'defaultroute' option if you currently <br /># have a default route to an ethernet gateway. <br /># <br />exec /usr/sbin/pppd debug lock modem crtscts /dev/ttyS0 38400 \ <br />asyncmap 20A0000 escape FF kdebug 0 $LOCAL_IP:$REMOTE_IP \ <br />noipdefault netmask $NETMASK defaultroute connect $DIALER_SCRIPT <br /><br />附录二：PPP 登录脚本模板 ppp-on-dialer <br /><br />#!/bin/sh <br /># <br /># This is part 2 of the ppp-on script. It will perform the connection <br /># protocol for the desired connection. <br /># <br />exec chat -v \ <br />TIMEOUT 3 \ <br />ABORT '\nBUSY\r' \ <br />ABORT '\nNO ANSWER\r' \ <br />ABORT '\nRINGING\r\n\r\nRINGING\r' \ <br />'' \rAT \ <br />'OK-+++\c-OK' ATH0 \ <br />TIMEOUT 30 \ <br />OK ATDT$TELEPHONE \ <br />CONNECT '' \ <br />ogin:--ogin: $ACCOUNT \ <br />assword: $PASSWORD <br /><br />附录三：一个稍作修改的 PPP 登录脚本 <br />#!/bin/sh <br /># <br /># This is part 2 of the ppp-on script. It will perform the connection <br /># protocol for the desired connection. <br /># <br />exec chat -v \ <br />TIMEOUT 3 \ <br />ABORT '\nBUSY\r' \ <br />ABORT '\nNO ANSWER\r' \ <br />ABORT '\nRINGING\r\n\r\nRINGING\r' \ <br />'' \rAT \ <br />'OK-+++\c-OK' ATH0 \ <br />TIMEOUT 30 \ <br />OK ATDT$TELEPHONE \ <br />CONNECT '' \ <br />sername:--sername: $ACCOUNT \ <br />assword: $PASSWORD \ <br />nnex: ppp <br /><br />说明：（1）用户登录提示符从由 login: 改为 username:  <br /><br />（2）用户登录后，访问服务器出现提示符 annex: ，需要手工输入 ppp 命令  <br /><br />附录四：可轮询拨号的 PPP 连接脚本模板 ppp-redialer <br /><br />#!/bin/sh <br />################################################################### <br /># <br /># These parameters control the attack dialing sequence. <br /># <br /># Maximum number of attempts to reach the telephone number(s) <br />MAX_ATTEMPTS=10 <br /># Delay between each of the attempts. This is a parameter to sleep <br /># so use "15s" for 15 seconds, "1m" for 1 minute, etc. <br />SLEEP_DELAY=15s <br />################################################################### <br /># <br /># This is a list of telephone numbers. Add new numbers if you wish <br /># and see the function 'callall' below for the dial process. <br />PHONE1=555-1212 <br />PHONE2=411 <br />################################################################### <br /># <br /># If you use the ppp-on script, then these are passed to this routine <br /># automatically. There is no need to define them here. If not, then <br /># you will need to set the values. <br /># <br />ACCOUNT=my_account_name <br />PASSWORD=my_password <br />################################################################### <br /># <br /># Function to initialize the modem and ensure that it is in command <br /># state. This may not be needed, but it doesn't hurt. <br /># <br />function initialize <br />{ <br />chat -v TIMEOUT 3 '' AT 'OK-+++\c-OK' <br />return <br />} <br />################################################################### <br /># <br /># Script to dial a telephone <br /># <br />function callnumber <br />{ <br />chat -v \ <br />ABORT '\nBUSY\r' \ <br />ABORT '\nNO ANSWER\r' \ <br />ABORT '\nRINGING\r\n\r\nRINGING\r' \ <br />'' ATDT$1 \ <br />CONNECT '' \ <br />ogin:--ogin: $ACCOUNT \ <br />assword: $PASSWORD <br /># <br /># If the connection was successful then end the whole script with a <br /># success. <br /># <br />if [ "$?" = "0" ]; then <br />exit 0 <br />fi <br />return <br />} <br />################################################################### <br /># <br /># Script to dial any telephone number <br /># <br />function callall <br />{ <br /># echo "dialing attempt number: $1" &gt;/dev/console <br />callnumber $PHONE1 <br /># callnumber $PHONE2 <br />} <br />################################################################### <br /># <br /># Initialize the modem to ensure that it is in the command state <br /># <br />initialize <br />if [ ! "$?" = "0" ]; then <br />exit 1 <br />fi <br /># <br /># Dial telephone numbers until one answers <br /># <br />attempt=0 <br />while : ; do <br />attempt=`expr $attempt + 1` <br />callall $attempt <br />if [ "$attempt" = "$MAX_ATTEMPTS" ]; then <br />exit 1 <br />fi  <br />sleep "$SLEEP_DELAY" <br />done <br /><br />附录五：PPP 断开脚本 ppp-off <br /><br />#!/bin/sh <br />###################################################################### <br /># <br /># Determine the device to be terminated. <br /># <br />if [ "$1" = "" ]; then <br />DEVICE=ppp0 <br />else <br />DEVICE=$1 <br />fi <br />###################################################################### <br /># <br /># If the ppp0 pid file is present then the program is running. Stop it. <br />if [ -r /var/run/$DEVICE.pid ]; then <br />kill -INT `cat /var/run/$DEVICE.pid` <br /># <br /># If the kill did not work then there is no process running for this <br /># pid. It may also mean that the lock file will be left. You may wish <br /># to delete the lock file at the same time. <br />if [ ! "$?" = "0" ]; then <br />rm -f /var/run/$DEVICE.pid <br />echo "ERROR: Removed stale pid file" <br />exit 1 <br />fi <br /># <br /># Success. Let pppd clean up its own junk. <br />echo "PPP link to $DEVICE terminated." <br />exit 0 <br />fi <br /># <br /># The ppp process is not running for ppp0 <br />echo "ERROR: PPP link is not active on $DEVICE" <br />exit 1 <br /></your_isp's_dns_server></your_login_password></your_login_name></font>
																</td>
														</tr>
												</tbody>
										</table>
								</td>
						</tr>
				</tbody>
		</table>
<img src ="http://www.blogjava.net/xiaosao/aggbug/92148.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaosao/" target="_blank">cAng^Er</a> 2007-01-06 09:09 <a href="http://www.blogjava.net/xiaosao/articles/92148.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Linux+Apache+Mysql+PHP典型配置</title><link>http://www.blogjava.net/xiaosao/articles/73739.html</link><dc:creator>cAng^Er</dc:creator><author>cAng^Er</author><pubDate>Sun, 08 Oct 2006 03:43:00 GMT</pubDate><guid>http://www.blogjava.net/xiaosao/articles/73739.html</guid><wfw:comment>http://www.blogjava.net/xiaosao/comments/73739.html</wfw:comment><comments>http://www.blogjava.net/xiaosao/articles/73739.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaosao/comments/commentRss/73739.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaosao/services/trackbacks/73739.html</trackback:ping><description><![CDATA[
		<font color="#0000ff" size="+1">Linux+Apache+Mysql+PHP典型配置&lt;转&gt;</font>
		<p>调试环境：Redhat9.0 Apache1.3.29 Mysql3.23.58 PHP4.3.4</p>
		<p>Linux系统的安装我就不讲了，这是基本功，其实这篇文章在类似Redhat的其他linux也应该通用，大家只要掌握我提供的方法就行。记得安装Redhat9。0的时候不要安装系统默认的apache，mysql和php以及相关的软件。已经安装的请用rpm 
    -e * 删除已经安装的包。</p>
		<p>
				<strong>
						<font size="+1">1.</font>
				</strong>安装Mysql3.23.58</p>
		<p>其
实老实说直接安装Mysql官方网站提供的rpm包也是一个比较可行的办法，他的官方网站的rpm包的提供基本跟tar包发行是同步的，这点我比较喜欢，
至少安装rpm包的在后面的调试中不会出现mysql库文件找不到的情况。但这里还是有必要讲一下自定义安装的步骤，毕竟网友自定义安装的还说挺多的。</p>
		<p>软件获取：<a href="http://www.mysql.com/downloads/index.html">http://www.mysql.com/downloads/index.html</a></p>
		<p>安装步骤：</p>
		<p>
				<font face="Arial">tar zxvf mysql-3.23.58.tar.gz <br />
    cd mysql-3.23.58</font>
		</p>
		<p>
				<font face="Arial">./configure --prefix=/usr/local/mysql --sysconfdir=/etc 
    --localstatedir=/var/lib/mysql</font>
		</p>
		<p>
				<font face="Arial">make</font>
		</p>
		<p>
				<font face="Arial">make install</font>
		</p>
		<p>#prefix=/usr/local/mysql mysql安装的目标目录</p>
		<p>#sysconfdir=/etc my.ini配置文件的路径</p>
		<p>#<font face="Arial">localstatedir=/var/lib/mysql</font> 数据库存放的路径</p>
		<p>安装完以后要初始化数据库，当然你是升级的话不用做这步；</p>
		<p>/usr/local/mysql/bin/mysql_install_db<br /></p>
		<p>如果系统没有mysql这个用户的话，最好做以下这步：</p>
		<p>useradd -M -o -r -d /var/lib/mysql -s /bin/bash -c "MySQL Server" 
    -u 27 mysql </p>
		<p>然后我启动mysql</p>
		<p>/usr/local/mysql/bin/safe_mysqld &amp;</p>
		<p>ok，先看看mysql能否正常工作</p>
		<p>mysql -uroot mysql</p>
		<p>一般情况下都是不能正常链接数据库，错误提示一般为：</p>
		<p>ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' 
    (2) </p>
		<p>其实网上大家问的最多的都是整个问题，说什么链接不到mysqld.sock，其实大家不妨看看mysql的错误日志就明白怎么回事，我这里的错误日志是在</p>
		<p>/var/lib/mysql/*.err 你会发现mysql只所以不能启动，是因为/var/lib/mysql的权限不允许mysql服务访问，英文mysql默认是调用mysql用户来启动服务的，好了，既然知道是什么原因找到不能启动，那就简单了。我们只要</p>
		<p>chown -R mysql:mysql /var/lib/mysql 就行，如果还是启动不了，再慢慢调试权限，反正一般启动不了都是权限的问题。</p>
		<p>如果大家还是不能启动不了的话，那就用我的比较繁琐的权限的设置，反正我每次都是这么做的，一般不会有问题，见下：</p>
		<p>chown -R root /usr/local/mysql <br />
    chgrp -R mysql /usr/local/mysql <br />
    chown -R root /usr/local/mysql/bin <br />
    chgrp -R mysql /usr/local/mysql/bin <br />
    chgrp -R mysql /var/lib/mysql <br />
    chmod 777 /var/lib/mysql <br />
    chown -R root /var/lib/mysql/mysql <br />
    chgrp -R mysql /var/lib/mysql/mysql <br />
    chmod 777 /var/lib/mysql/mysql <br />
    chown -R root /var/lib/mysql/mysql/* <br />
    chgrp -R mysql /var/lib/mysql/mysql/* <br />
    chmod 777 /var/lib/mysql/mysql/* <br />
    chmod 777 /usr/local/mysql/lib/mysql/libmysqlclient.a</p>
		<p> </p>
		<p>做完上面的步骤，然后把你编译目录的一个脚本COPY过去</p>
		<p>cp support-files/mysql.server /etc/rc.d/init.d/mysqld</p>
		<p>chkconfig --add mysqld</p>
		<p>用ntsysv设置使mysql每次启动都能自动运行。</p>
		<p>好了，至此mysql安装完毕，你可以这样起动你的mysql服务</p>
		<p>/etc/rc.d/init.d/mysqld start</p>
		<p>下面这步比较关键，</p>
		<p>
				<font color="#0000ff">ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql<br />
    ln -s /usr/local/mysql/include/mysql /usr/include/mysql</font>
		</p>
		<p>大家可以不做这步，大可以在编译其他软件的时候自定义myslq的库文件路径，但我还是喜欢把库文件链接到默认的位置，这样你在编译类似PHP，Vpopmail等软件时可以不用指定mysql的库文件地址。</p>
		<p>
				<strong>
						<font size="+1">2.</font>
				</strong>安装Apache1.3.29。我没有选择安装Apache2.0是我对他还是不放心，因为网上最新公布的apache的漏洞基本上是针对2.0，当然大家可以自己选择安装相应的版本。我这里讲的都是采用DSO动态编译的方法编译Apache.</p>
		<p>至于有关apache的编译方法，可以参考我以前的文章<a href="http://www.5ilinux.com/apache01.html">《apache的静态/动态编译在apache+php+mysql的应用》</a><a href="http://www.5ilinux.com/apache01.html">http://www.5ilinux.com/apache01.html</a></p>
		<p>软件获取：<a href="http://httpd.apache.org/">http://httpd.apache.org/</a></p>
		<p>tar zvxf apache_1.3.29.tar.gz<br />
    cd apache_1.3.29<br />
    修改src/include/httpd.h 增大最大线程数</p>
		<p>#define HARD_SERVER_LIMIT 256</p>
		<p>改成</p>
		<p>#define HARD_SERVER_LIMIT 2560</p>
		<p>保存退出编译apache</p>
		<p>
				<br />
    ./configure --prefix=/usr/local/apache --enable-module=so --enable-module=rewrite 
    --enable-shared=max --htdocsdir=/var/www &amp;&amp;<br />
    make &amp;&amp;<br />
    make install</p>
		<p>#
这里我们通过enable-module参数告诉设置脚本，我们需要启动so和rewrite模块，so模块是用来提DSO支持的apache核心模块，
而rewrite模块则是用意实现地址重写的模块，由于rewrite模块需要DBM支持，如果在初次安装时没有编译进apache，以后需要用到时需要
重新编译整个apache才可以实现。为此除非你可以确定以后不会用到rewrite模块，否则还是建议你在第一次编译的时候把rewrite模块编译
好。</p>
		<p>enable-shared=max 这个参数的作用时编译apache时，把除了so以外的所有apache的标准模块都编译成DSO模块。而不是编译进apache核心内。</p>
		<p> </p>
		<p>好了安装apache很简单的哦，启动apache看看</p>
		<p>/usr/local/apache/bin/apachectl start</p>
		<p>然后用ie看http://你的服务器地址。应该能看到熟悉的apache羽毛标志。</p>
		<p>
				<font size="+1">
						<strong>3.</strong>
				</font>安装PHP4.3.4</p>
		<p>软件获取：<a href="http://www.php.net/downloads.php">http://www.php.net/downloads.php</a></p>
		<p>tar zvxf php-4.3.4.tar.gz<br />
    cd php-4.3.4</p>
		<p>./configure \<br />
    --prefix=/usr/local/php \<br />
    --with-mysql=/usr/local/mysql \ <br />
    --enable-force-cgi-redirect \<br />
    --with-freetype-dir=/usr \<br />
    --with-png-dir=/usr \<br />
    --with-gd --enable-gd-native-ttf \<br />
    --with-ttf \<br />
    --with-gdbm \<br />
    --with-gettext \<br />
    --with-iconv \<br />
    --with-jpeg-dir=/usr \<br />
    --with-png \<br />
    --with-zlib \<br />
    --with-xml \<br />
    --enable-calendar \<br />
    --with-apxs=/usr/local/apache/bin/apxs</p>
		<p>make</p>
		<p>make install</p>
		<p> </p>
		<p>#
我这里由于服务器需要用到GD库，所以加了一些支持GD的编译参数
，GD直接用了redhat自带的GD库，大家没有安装的话可以从安装盘安装，注意除了安装GD以外，还要安装libjpeg，libpng等库文件。另
外--with-mysql=/usr/local/mysql指向你安装mysql的路径。--with-apxs指向apache的apxs文件的路
径。</p>
		<p>vi /usr/local/apache/conf/httpd.conf</p>
		<p>查找&lt;IfModule mod_mime.c&gt; </p>
		<p>在此范围添加 </p>
		<p>AddType application/x-httpd-php .php <br />
    AddType application/x-httpd-php-source .phps </p>
		<p> </p>
		<p>然CPOPY PHP的配置文件</p>
		<p>cp ../php4.3.4/php.ini.dist /usr/local/php/lib/php.ini </p>
		<p>修改php.ini文件<br />
    register_globals = On</p>
		<p>ok！重新启动一下apache服务器 <br />
    /usr/local/apache/bin/apachectl restart </p>
		<p>然后写个php测试页info.php:内容如下 </p>
		<p>&lt;?php <br />
    phpinfo(); <br />
    ?&gt; </p>
		<p>正常的话，应该能看到php的信息了，恭喜你的Apche+Mysql+PHP安装成功。</p>
		<p> </p>
		<p>好了写了这么多，希望对大家有所帮助！！！</p>
		<p>
				<font color="#0000ff">参看文档：</font>
		</p>
		<p>apache的静态/动态编译在apache+php+mysql的应用 <a href="http://www.5ilinux.com/apache01.html">http://www.5ilinux.com/apache01.html</a></p>
		<p>
		</p>
		<p>作者：张微波</p>
		<p>2003年12月3日于北京</p>
		<br />
<img src ="http://www.blogjava.net/xiaosao/aggbug/73739.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaosao/" target="_blank">cAng^Er</a> 2006-10-08 11:43 <a href="http://www.blogjava.net/xiaosao/articles/73739.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>linux 9 下 apache2.2.2+svn 1.3.1安装(转)</title><link>http://www.blogjava.net/xiaosao/articles/73735.html</link><dc:creator>cAng^Er</dc:creator><author>cAng^Er</author><pubDate>Sun, 08 Oct 2006 03:34:00 GMT</pubDate><guid>http://www.blogjava.net/xiaosao/articles/73735.html</guid><wfw:comment>http://www.blogjava.net/xiaosao/comments/73735.html</wfw:comment><comments>http://www.blogjava.net/xiaosao/articles/73735.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaosao/comments/commentRss/73735.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaosao/services/trackbacks/73735.html</trackback:ping><description><![CDATA[
		<span class="bold">linux 9 下 apache2.2.2+svn 1.3.1安装(转)</span>
		<br />
		<br />
		<div style="font-size: 12px;" id="text203">
				<font color="Red">
						<b>本文基本上网络上都能找到,只是安装的过程中略有不同,小有问题吧,转载的基础上略有改动,我是完全按照下面步骤安装,并取得成功的</b>
				</font>
				<br />
				<br />
apache的安装 <br />
httpd是web服务器，用来通过web访问subversion，我下载到httpd-2.2.2.tar.bz2。<br />
解压该文件:<br />
#bunzip2 httpd-2.2.2.tar.bz2<br />
#tar xvf httpd-2.2.2.tar<br /><br />
//进入解压后的目录<br />
# cd httpd-2.2.2<br />
//配置apache安装，前两个参数是必须要加的，你还可以根据您的需要添加其他的参数。<br />
//后面的参数制定你要把apache安装哪里<br />
# ./configure --enable-dav --enable-so --prefix=/usr/local/apache2/<br />
# make<br />
//安装<br />
# make install<br />
# cd /usr/local/apache2/bin<br />
//启动apache服务<br />
# ./apachectl start<br />
//打开浏览器<a href="http://localhost/" target="_blank">http://localhost/</a>如果有测试页"It works!"出现则证明已经安装成功。<br />
//打开浏览器<a href="http://localhost/" target="_blank">http://localhost/</a>如果有测试页"It works!"出现则证明已经安装成功。<br />
//如果配置文件/apache2/conf/httpd.conf中,下面两行没有注释掉的话,需要先注释,然后再启动apache,否则可能报错:
"httpd: Syntax error on line 232 of /usr/local/apache2/conf/httpd.conf:
API m....."提示不能加载svn的.so文件<br />
LoadModule dav_svn_module     modules/mod_dav_svn.so<br />
LoadModule authz_svn_module   modules/mod_authz_svn.so<br /><br />
//这个时候只要把上面两行注释掉,就能成功运行apache,当然,测试apache成功运行后,把注释干掉,还是要加载这个.so模块<br />
3. 安装Subversion<br />
//解压SubVersion安装包 (root用户进行下面的操作)<br />
# tar xvzf Subversion-1.3.1.tar.gz<br />
//进入解压后的目录<br />
# cd Subversion-1.3.1<br />
//配置subversion安装<br />
#./configure --with-apxs=/usr/local/apache2/bin/apxs --prefix=/usr/local/subversion <br />
--with-apr=/usr/local/apache2 --with-apr-util=/usr/local/apache2 --with-ssl --with-zlib <br />
--enable-maintainer-mode<br />
# make<br />
//安装<br />
# make install<br />
//创建库文件所在的目录 (svnroot用户进行下面的操作)<br />
# mkdir /home/svnroot/repository<br />
//进入subversion的bin目录<br />
# cd /usr/local/subversion/bin<br />
//创建仓库"test"<br />
# ./svnadmin create /home/svnroot/repository/test<br />
# cd /home/svnroot/repository/test<br />
//看看是不是多了些文件，如果是则说明Subversion安装成功了<br />
# ls –l<br />
# cd /usr/local/subversion/bin<br />
//这条语句将把路径/home/user/import下找到的文件导入到你创建的Subversion 仓库中去，<br />
//提交后的修订版为1。<br />
# ./svn import /home/user/import file:///home/svnroot/repository/test –m "注释"<br />
//不让其他人有该目录的权限<br />
# chmod 700 /home/svnroot/repository<br /><br />
//**注意,直接这么chmod会导致svn客户端无法访问,需要修改apache配置文件/conf/httpd.conf文件<br />
//这个文件中有这么一段内容:<br />
User nobody<br />
Group #-1<br />
//把上述内容改成:<br />
User apache<br />
Group apache<br />
//(我的系统在安装apache的时候,自动增加了apache用户和apache组,如果你系统没有这个用户和组,则请自己添加该用户和组)<br />
//修改svn仓库的所有者<br />
chown -R apache:apache /home/svnroot/repository<br />
//修改该目录权限只能apache拥有<br />
# chmod 700 /home/svnroot/repository<br /><br /><br /><br />
4. 修改Apache配置文件<br />
# cd /usr/local/apadche2/bin <br />
//启动Apache <br />
# ./apachect1 start <br />
# vi /usr/local/apache2/conf/httpd.conf <br />
   //在最下面添加 <br />
   LoadModule dav_svn_module modules/mod_dav_svn.so <br />
   LoadModule authz_svn_module modules/mod_authz_svn.so <br />
   &lt;Location /svn&gt; <br />
   DAV svn <br />
   SVNParentPath /home/svnroot/repository/ //svn父目录 <br />
   AuthzSVNAccessFile /home/svnroot/repository/authz.conf //权限配置文件 <br />
   AuthType Basic //连接类型设置 <br />
   AuthName "Subversion.zoneyump" //连接框提示 <br />
   AuthUserFile /home/svnroot/repository/authfile //用户配置文件 <br />
   Require valid-user //采用何种认证 <br />
   &lt;/Location&gt;<br />
   //其中authfile是通过"htpasswd [–c] /home/svnroot/repository/authfile username password"来创建的 <br />
   //"Require valid-user"告诉apache在authfile中所有的用户都可以访问。如果没有它，<br />
   //则只能第一个用户可以访问新建库 <br /><br /><br />
5. 重启apache # ./usr/local/apache2/bin/apachectl restart <br />
//打开浏览器访问<a href="http://localhost/svn/test/" target="_blank">http://localhost/svn/test/</a>，如果有东西显示就说明成功。<br /><br /><br />
6. 权限管理<br />
1)增加用户<br />
# htpasswd [-c] /home/svnroot/repository/authfile wooin<br />
//第一次设置用户时使用-c表示新建一个用户文件。回车后输入用户密码，完成对用户的增加<br />
# htpasswd authfile 用户名(加入新的用户)<br /><br />
2)权限分配<br />
# vi /home/svnroot/repository/authz.conf <br />
   [test:/] //这表示，仓库test的根目录下的访问权限 <br />
   wooin = rw //test仓库wooin用户具有读和写权限 <br />
   bao = r //test仓库bao用户具有读权限 <br />
   [test2:/] //test2仓库根目录下的访问权限 <br />
   wooin = r //wooin用户在test2仓库根目录下只有读权限 <br />
   bao = //bao用户在 test2仓库根目录下无任何权限 <br />
   [/] //这个表示在所有仓库的根目录下 <br />
   * = r //这个表示对所有的用户都具有读权限 <br />
   #[groups] //这个表示群组设置 <br />
   #svn1-developers = wooin, bao //这个表示某群组里的成员 <br />
   #svn2-developers = wooin <br />
   #[svn1:/] <br />
   #@svn1-developers = rw //如果在前面加上@符号，则表示这是个群组权限设置<br /><br />
将这个设置完成后。重启Apache，就可以通过 <br /><a href="http://localhost/svn/test" target="_blank">http://localhost/svn/test</a><br />
这个URL来访问仓库了，当然，受权限的限制，必须是合法用户才能访问且具有相应的权限 <br /><br /><br />
7. 一些备忘：<br />
1. svn checkout <a href="http://localhost/svn/hello.world" target="_blank">http://localhost/svn/hello.world</a><br /><br />
2. svn commit 时的默认编辑器的环境变量$SVN_EDITOR=vi需要手动设定，用kate好像有问题<br /><br />
3. 如果linux的登录用户名密码都和svn的其中一个用户名密码相同时，在checkout的时候不会要求输
入用户名密码直接就可以checkout出来。比如：linux有个用户wooin，svn也有一个用户wooin，并且密码
都是一样的，当用wooin登录linux后，执行checkout，可以直接提取出源码文件，不用输入认证信息。<br /><br />
4. 在svn使用过程中牵扯到几种权限：文件系统的权限，linux系统权限，svn用户的权限，apache进程的权限。<br /><br />
文件系统的权限，linux系统权限：这里相同的意思，就是平时大家使用linux时文件夹和文件的访问权限。在
svn建立仓库，文件夹，配置文件的时候用svnroot用户，并将仓库权限设置为700，不允许其他用户直接通过
文件系统查看，只能由svnroot进行管理。<br /><br />
apache进程的权限：因为所有跟仓库传输的操作都是通过apache进程进行的，所以即使你给svn用户设置了
很大的权限，但是apache进程没有访问仓库或者相关文件的权限也没有用，apache进程的权限设置在
/usr/local/apache2/conf/httpd.conf 文件中配置，找到文件中的这两行：<br />
User daemon # 将daemon改为svnroot，让apache进程以svnroot的身份运行 <br />
Group daemon <br /><br /><br />
svn用户的权限：就是在repository/authz.conf文件中设置的权限信息，是svn用来管理仓库访问权限的。<br /><br />
5. svn服务器设置有两种方式：http 和 svnserve。这里介绍的是http方法<br /><br />
6. 在/etc/profile的结尾设置一些svn启动时要做的工作 # start apache server for svn <br />
/usr/sbin/apachectl start <br />
export SVN_EDITOR=vi <br /><br /><br />
7. APR libraries 安装 SVN 的时候最好指定 --with-apr= 和 --with-apr-util= 参数到 Apache 安装的根目录 <br />
（ServerRoot）下，而不是使用缺省的 SVN 安装包中自带的 apr 。否则如果你安装的 Apache <br />
版本不同有可能导致 APR 库不匹配，出现类似：<br />
Can't set position pointer in file '/svn/test/db/revs/1': Invalid argument 的错误。<br />
Updated 2006-04-20 16:30 -- 比如说如果你安装的是apache 2.2.0版本，就需要在编译安装svn的时候指定 <br />
--with-apxs和--with-apr参数到你的apache2.2.0安装目录下：<br />
./configure --prefix=${subversionInstallFolder} / <br />
--with-apxs=${apacheInstallFolder}/bin/apxs / <br />
--with-apr=${apacheInstallFolder} / <br />
--with-apr-util=${apacheInstallFolder} / <br />
--with-ssl / <br />
--with-zlib / <br />
--enable-maintainer-mode</div>
<img src ="http://www.blogjava.net/xiaosao/aggbug/73735.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaosao/" target="_blank">cAng^Er</a> 2006-10-08 11:34 <a href="http://www.blogjava.net/xiaosao/articles/73735.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>