<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>白舟工作室 &#187; apache</title>
	<atom:link href="http://www.baizoo.cn/tag/apache/feed" rel="self" type="application/rss+xml" />
	<link>http://www.baizoo.cn</link>
	<description>——长风破浪会有时</description>
	<lastBuildDate>Mon, 30 Jan 2012 08:09:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>iis+apache不能连接mysql的问题</title>
		<link>http://www.baizoo.cn/archives/1141.html</link>
		<comments>http://www.baizoo.cn/archives/1141.html#comments</comments>
		<pubDate>Sat, 11 Jun 2011 14:36:30 +0000</pubDate>
		<dc:creator>baizoo</dc:creator>
				<category><![CDATA[技术爱好]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.baizoo.cn/?p=1141</guid>
		<description><![CDATA[网上找了很多资料，调试了好久，终于解决了这个难题。 修改php.ini里的 extension_dir = &#8220;./&#8221; 为 extension_dir = &#8220;D:\PHP5\ext&#8221; 注：D:\PHP5 是我的php目录。 在环境变量Path里面添加 D:\PHP5\;D:\PHP5\ext; 网上说的将 lib文件拷到windows/system32目录下 这个是没必要的，设置好Path环境变量就可以了。 我因为误将 Mysql/bin 目录下的libmySQL.dll复制到了windows/system32目录下，导致php链接mysql时 出现 0x0075ac50 内存不能为read 的错误。后来还是进了安全模式，删除几个system32目录下的几个dll才解决了这个难题。 以下为引用网文 我以前碰到过一模一样的问题, 折腾了很久才搞清楚. 在&#8221;mysql的安装目录\bin&#8221;中, 有一个libmySQL.dll, 而在安装mysql的时候, windows installer版的安装 程序会问我们要不要把&#8221;mysql安装目录\bin&#8221;放入环境变量path中, 一般我们都会同意放入path中. 然后在装完php和apache时, 我们需要把php扩展的环境变量手动添加到path中, 一般就是我们会把 这个路径添加到path的最后 然后在apache的phpmodule调用mysql的库来访问mysql时, 会首先查找libmysql.dll文件, 然后这个dll 会使用php ext里的dll来完成访问工作. 问题就出在这里了, 因为在path中mysql的环境变量在php环境变量的前面, 所以libmysql.dll文件时 mysql的, 而他所需要的dll文件却是有php ext来提供的, 而php ext也提供了自己的libmysql.dll,却由于 优先级问题, 而并没有被使用, 而按照我刚才所描述的安装方式会造成用mysql带的libmysql.dll来访问 php ext带的其他dll文件的问题, [...]]]></description>
			<content:encoded><![CDATA[<p>网上找了很多资料，调试了好久，终于解决了这个难题。</p>
<p>修改php.ini里的<br />
extension_dir = &#8220;./&#8221; 为 extension_dir = &#8220;D:\PHP5\ext&#8221;</p>
<p>注：D:\PHP5 是我的php目录。</p>
<p>在环境变量Path里面添加 D:\PHP5\;D:\PHP5\ext; </p>
<p>网上说的将 lib文件拷到windows/system32目录下 这个是没必要的，设置好Path环境变量就可以了。<br />
我因为误将 Mysql/bin 目录下的libmySQL.dll复制到了windows/system32目录下，导致php链接mysql时<br />
出现 0x0075ac50  内存不能为read  的错误。后来还是进了安全模式，删除几个system32目录下的几个dll才解决了这个难题。</p>
<p><span id="more-1141"></span><br />
<strong>以下为引用网文</strong><br />
我以前碰到过一模一样的问题, 折腾了很久才搞清楚.<br />
在&#8221;mysql的安装目录\bin&#8221;中, 有一个libmySQL.dll, 而在安装mysql的时候, windows installer版的安装<br />
程序会问我们要不要把&#8221;mysql安装目录\bin&#8221;放入环境变量path中, 一般我们都会同意放入path中.<br />
然后在装完php和apache时, 我们需要把php扩展的环境变量手动添加到path中, 一般就是我们会把<br />
这个路径添加到path的最后<br />
然后在apache的phpmodule调用mysql的库来访问mysql时, 会首先查找libmysql.dll文件, 然后这个dll<br />
会使用php ext里的dll来完成访问工作.<br />
问题就出在这里了, 因为在path中mysql的环境变量在php环境变量的前面, 所以libmysql.dll文件时<br />
mysql的, 而他所需要的dll文件却是有php ext来提供的, 而php ext也提供了自己的libmysql.dll,却由于<br />
优先级问题, 而并没有被使用, 而按照我刚才所描述的安装方式会造成用mysql带的libmysql.dll来访问<br />
php ext带的其他dll文件的问题, 这样会造成版本不一致而出现崩溃. 决绝方法很简单, LS的方式是将<br />
php ext的libmysql放到system32, 认为提升这个dll的优先级, 另外一种也是我推荐的方式, 就是在<br />
path设置中改变php ext目录和mysql bin目录的顺序, 或者直接删掉mysql bin.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.baizoo.cn/archives/1141.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu中配置Apache</title>
		<link>http://www.baizoo.cn/archives/718.html</link>
		<comments>http://www.baizoo.cn/archives/718.html#comments</comments>
		<pubDate>Wed, 28 Oct 2009 13:20:25 +0000</pubDate>
		<dc:creator>baizoo</dc:creator>
				<category><![CDATA[网站相关]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[配置]]></category>

		<guid isPermaLink="false">http://www.baizoo.cn/?p=718</guid>
		<description><![CDATA[前些时候给自己的ubuntu虚拟机里装了lamp，详见：Ubuntu中安装配置LAMP服务器，不过装好后一直没去调配它，今天就来配置一下Apache。 一般linux中的apache配置文件目录为：/etc/httpd/conf/httpd.conf 但我用apt方式安装的apache配置文件却不在该目录下，后来查找之后才发现其配置文件目录为：/etc/apache2/apache2.conf 在该文件中，我们能找到几个被include进来的文件 # Include module configuration: Include /etc/apache2/mods-enabled/*.load Include /etc/apache2/mods-enabled/*.conf # Include all the user configurations: Include /etc/apache2/httpd.conf # Include ports listing Include /etc/apache2/ports.conf 以及最后的 # Include generic snippets of statements Include /etc/apache2/conf.d/ # Include the virtual host configurations: Include /etc/apache2/sites-enabled/ 从注释中，我们可以知道虚拟站点的配置文件在/etc/apache2/sites-enabled/目录下 接下来就来配置一下虚拟站点 终端进入/etc/apache2/sites-enabled/目录 运行：gedit default 编辑这个配置文件 这里我要实现几个简单的目的 一、禁止浏览用户访问目录列表 这个需要找到Options Indexes FollowSymLinks MultiViews [...]]]></description>
			<content:encoded><![CDATA[<p>前些时候给自己的ubuntu虚拟机里装了lamp，详见：<a href="http://www.baizoo.cn/archives/591.html">Ubuntu中安装配置LAMP服务器</a>，不过装好后一直没去调配它，今天就来配置一下Apache。</p>
<p>一般linux中的apache配置文件目录为：/etc/httpd/conf/httpd.conf</p>
<p>但我用apt方式安装的apache配置文件却不在该目录下，后来查找之后才发现其配置文件目录为<strong>：/etc/apache2/apache2.conf </strong><br />
在该文件中，我们能找到几个被include进来的文件<span id="more-718"></span></p>
<p><coolcode><br />
# Include module configuration:<br />
Include /etc/apache2/mods-enabled/*.load<br />
Include /etc/apache2/mods-enabled/*.conf</p>
<p># Include all the user configurations:<br />
Include /etc/apache2/httpd.conf</p>
<p># Include ports listing<br />
Include /etc/apache2/ports.conf<br />
</coolcode><br />
以及最后的<br />
<coolcode># Include generic snippets of statements<br />
Include /etc/apache2/conf.d/</p>
<p># Include the virtual host configurations:<br />
Include /etc/apache2/sites-enabled/</coolcode><br />
从注释中，我们可以知道虚拟站点的配置文件在/etc/apache2/sites-enabled/目录下</p>
<p>接下来就来配置一下虚拟站点<br />
终端进入/etc/apache2/sites-enabled/目录<br />
运行：<coolcode>gedit default</coolcode><br />
编辑这个配置文件</p>
<p>这里我要实现几个简单的目的<br />
一、禁止浏览用户访问目录列表<br />
这个需要找到Options Indexes FollowSymLinks MultiViews 将 Indexes去掉，如果只是针对某个目录，比如，我在站点跟目录/var/www/下建了个123目录，我希望用户不能浏览123目录列表，于是我就可以加入下面配置<br />
	<coolcode><Directory /var/www/123/><br />
	Options FollowSymLinks MultiViews<br />
	</Directory></coolcode><br />
去掉Indexes即可。<br />
二、修改默认首页<br />
可在directory下面加上<br />
//添加文件支持类型<br />
<coolcode><br />
AddType application/x-httpd-php .php<br />
AddType application/x-httpd-php .phtml<br />
</coolcode><br />
//添加首页文件<br />
<coolcode><br />
DirectoryIndex index.htm<br />
DirectoryIndex index.php<br />
</coolcode><br />
优先权由上而下<br />
三、添加虚拟目录<br />
一个最简单的虚拟目录可以包含下面几个部分<br />
<coolcode lang="html"><br />
<VirtualHost 192.168.1.59><br />
    ServerName linux.baizoo.cn<br />
    ServerAdmin ubuntu@baizoo.cn<br />
    DocumentRoot “/var/www/baizoo/”<br />
    ErrorLog “/var/log/apache2/baizoo_errors.log”<br />
    CustomLog “/var/log/apache2/linux_accesses.log” combined<br />
</VirtualHost><br />
</coolcode><br />
当然，里面还可以包含一些directory参数配置。<br />
配置完成后重启apache <coolcode>sudo /etc/init.d/apache2 restart </coolcode></p>
<p>今天实现了三个简单的配置目的，apache配置还有很多，比如重定向，代理等更复杂的配置留到以后再弄吧。</p>
<p>相关文章：<a href="http://hi.baidu.com/52hack/blog/item/535a6ad0b3512a87a0ec9cbc.html">apache服务器指令大全</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.baizoo.cn/archives/718.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux+Apache+Mysql+Php运行环境的配置</title>
		<link>http://www.baizoo.cn/archives/296.html</link>
		<comments>http://www.baizoo.cn/archives/296.html#comments</comments>
		<pubDate>Fri, 25 Apr 2008 01:11:55 +0000</pubDate>
		<dc:creator>baizoo</dc:creator>
				<category><![CDATA[网站相关]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[SecureCRT ：远程控制工具SSH Secure File Transfer：文件上传工具首先，安装好上面提到的两个支持工具，它们都能很容易在网上找到下载1.安装Mysql 详见：Linux下的Mysql的安装与使用 http://www.baizoo.cn/article.asp?id=295简单介绍为：官网http://dev.mysql.com/downloads/ 下载安装文件分别上传client和server版本的rpm安装包定位到你上传的目录，如cd /home/rpm -ivh MySQL-server-standard-4.1.22-0.rhel3.i386.rpm #安装mysql server rpm -ivh MySQL-client-standard-4.1.22-0.rhel3.i386.rpm #安装mysql client #启动mysql server safe_mysqld &#038; 卸载如果系统中已经安装过mysql数据库，现在要重装的话，需要首先进行卸载，网上转来卸载方法如下：1）首先查找以前是否安装MySQL&#160;&#160;命令：rpm -qa &#124; grep mysql 可以看到两个MySQL包：mysql-server、mysql-devel-3.23.54a-11。注：这一步我并没看到效果，但我肯定自己曾经装过，所以我删除的时候直接是运行rpm -e &#8211;nodeps MySQL-client-standard-4.1.22-0.rhel3rpm -e &#8211;nodeps MySQL-server-standard-4.1.22-0.rhel32）删除命令： rpm -e &#8211;nodeps 包名 3）然后删除mysql老版本的开发头文件和库 rm -fr /usr/lib/mysql rm -fr /usr/include/mysql 之后可以正常安装了。2.安装Apache到官方网站http://www.apache.org/上下载你所需的Apache版本 我用的是2.0.63版 下载地址：http://apache.mirror.phpchina.com/httpd/httpd-2.0.63.tar.gz本地下载之后，通过使用SSH Secure File Transfer工具，将其上传到/home/目录执行安装命令：cd /home/tar –zxvf httpd-2.0.63.tar.gz./configure &#8211;prefix=/usr/local/apache [...]]]></description>
			<content:encoded><![CDATA[<p>SecureCRT ：远程控制工具<br/>SSH Secure File Transfer：文件上传工具<br/>首先，安装好上面提到的两个支持工具，它们都能很容易在网上找到下载<br/><br/><strong>1.安装Mysql </strong><br/>详见：Linux下的Mysql的安装与使用 <a href="http://www.baizoo.cn/article.asp?id=295" target="_blank" rel="external">http://www.baizoo.cn/article.asp?id=295</a><br/><br/>简单介绍为：<br/>官网<a href="http://dev.mysql.com/downloads/" target="_blank" rel="external">http://dev.mysql.com/downloads/</a> 下载安装文件<br/>分别上传client和server版本的rpm安装包<br/><br/>定位到你上传的目录，如<br/>cd /home/<br/><br/>rpm -ivh MySQL-server-standard-4.1.22-0.rhel3.i386.rpm #安装mysql server <br/>rpm -ivh MySQL-client-standard-4.1.22-0.rhel3.i386.rpm #安装mysql client <br/><br/>#启动mysql server <br/>safe_mysqld &#038; <br/><br/><strong>卸载</strong><br/>如果系统中已经安装过mysql数据库，现在要重装的话，需要首先进行卸载，<br/>网上转来卸载方法如下：<br/><br/>1）首先查找以前是否安装MySQL&nbsp;&nbsp;<br/><br/>命令：rpm -qa | grep mysql <br/><br/>可以看到两个MySQL包：mysql-server、mysql-devel-3.23.54a-11。<br/><br/><strong>注：</strong>这一步我并没看到效果，但我肯定自己曾经装过，所以我删除的时候直接是运行<br/>rpm -e &#8211;nodeps MySQL-client-standard-4.1.22-0.rhel3<br/>rpm -e &#8211;nodeps MySQL-server-standard-4.1.22-0.rhel3<br/><br/>2）删除命令： <br/><br/>rpm -e &#8211;nodeps 包名 <br/><br/>3）然后删除mysql老版本的开发头文件和库 <br/><br/>rm -fr /usr/lib/mysql <br/><br/>rm -fr /usr/include/mysql <br/>之后可以正常安装了。<br/><br/><strong>2.安装Apache</strong><br/><br/>到官方网站<a href="http://www.apache.org/" target="_blank" rel="external">http://www.apache.org/</a>上下载你所需的Apache版本 <br/><br/>我用的是2.0.63版 下载地址：<a href="http://apache.mirror.phpchina.com/httpd/httpd-2.0.63.tar.gz" target="_blank" rel="external">http://apache.mirror.phpchina.com/httpd/httpd-2.0.63.tar.gz</a><br/><br/>本地下载之后，通过使用SSH Secure File Transfer工具，将其上传到/home/目录<br/><br/>执行安装命令：<br/>cd /home/<br/>tar –zxvf httpd-2.0.63.tar.gz<br/>./configure &#8211;prefix=/usr/local/apache &#8211;enable-module=so &#8211;enable-module=rewrite &#8211;enable-shared=max &#8211;htdocsdir=/var/www &#038;&#038;<br/>make &#038;&#038;<br/>make install<br/><br/>#这里我们通过enable-module参数告诉设置脚本，我们需要启动so和rewrite模块，so模块是用来提DSO支持的apache核心模块，而rewrite模块则是用意实现地址重写的模块，由于rewrite模块需要DBM支持，如果在初次安装时没有编译进apache，以后需要用到时需要重新编译整个apache才可以实现。为此除非你可以确定以后不会用到rewrite模块，否则还是建议你在第一次编译的时候把rewrite模块编译好。<br/><br/>启动Apache<br/>/usr/local/apache/bin/apachectl start<br/><br/><strong>3.安装PHP</strong><br/><br/>软件获取：<a href="http://www.php.net/downloads.php" target="_blank" rel="external">http://www.php.net/downloads.php</a><br/>我下的为5.2.5版，地址：<a href="http://cn.php.net/distributions/php-5.2.5.tar.gz" target="_blank" rel="external">http://cn.php.net/distributions/php-5.2.5.tar.gz</a><br/><br/>同样上传到/home/目录下<br/><br/>tar zvxf php-5.2.5.tar.gz<br/>cd php-5.2.5<br/>./configure &#8211;prefix=/usr/local/php &#8211;with-apxs=/usr/local/apache/bin/apxs &#8211;with-config-file-path=/usr/local/lib &#8211;enable-track-vars &#8211;with-xml &#8211;with-mysql <br/>make <br/>make install <br/><br/>CPOPY PHP的配置文件<br/>cp php.ini-dist /usr/local/lib/php.ini<br/><br/>以dso方式安装php至/usr/local/php 设置配置文件目录为/usr/local/lib 开启mysql,xml支持<br/><br/><strong>4.配置Apache</strong><br/><br/>vi /usr/local/apache/conf/httpd.conf <br/>对apache做如下配置 <br/>#将ServerAdmin q3boy@younet.com一行改为您的邮箱地址 <br/><br/>#DocumentRoot &#8220;/home/httpd/html/&#8221; 此处为html文件主目录 <br/><br/># 同上 <br/><br/>#Options FollowSymLinks MultiViews 为安全起见，去掉&#8221;Indexes&#8221; <br/><br/># <br/># DirectoryIndex default.php default.phtml default.php3 default.html default.htm <br/># <br/>#设置apache的默认文件名次序 <br/><br/>#AddType application/x-httpd-php .php .phtml .php3 .inc <br/>#AddType application/x-httpd-php-source .phps <br/>#设置php文件后缀 <br/><br/><br/>　　存盘退出 （esc&nbsp;&nbsp;:wq）<br/><br/><br/>vi /usr/local/lib/php.ini <br/>#register-golbals = On <br/><br/>　　存盘退出 （esc&nbsp;&nbsp;:wq）</p>
]]></content:encoded>
			<wfw:commentRss>http://www.baizoo.cn/archives/296.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

