<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[沧海一粟]]></title> 
<link>http://www.dzhope.com/index.php</link> 
<description><![CDATA[Web系统架构与服务器运维,php开发]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[沧海一粟]]></copyright>
<item>
<link>http://www.dzhope.com/post//</link>
<title><![CDATA[Linux系统下PHP服务器的定制安装（原创）]]></title> 
<author>jed &lt;jed521@163.com&gt;</author>
<category><![CDATA[服务器技术]]></category>
<pubDate>Fri, 03 Nov 2006 00:04:54 +0000</pubDate> 
<guid>http://www.dzhope.com/post//</guid> 
<description>
<![CDATA[ 
	 &nbsp; &nbsp; &nbsp; &nbsp;每一个电脑爱好者都希望有自己的网站，其实自己拥有一台电脑和一个IP就可以解决了。现在许多人都听说过Linux，却很少有人用过它。我刚刚接触Linux，想把自己的安装过程与大家共同交流一下。<br/>我安装系统的是Linux readhat8.0，配置是Php－4.0.4＋Mysql－3.23.46＋Apache－1.3.27。<br/><p align="center">（一）&nbsp;&nbsp;Linux系统的安装</p><br/>1、&nbsp;&nbsp;插入Linux 8.0的光盘，出现欢迎安装的界面，然后会让你选择安装过程的语言，一般默认为English（English）就行。对于初次安装最好选择汉语，这样容易安装。但是对于使用linux的用户来说，最好习惯用英语安装，因为linux有的版本不支持汉语并且好多情况下不能用汉语。<br/>2、&nbsp;&nbsp;之后会让你选择键盘语言、鼠标语言，都选择默认，直接点击“Next”就行了。<br/>3、&nbsp;&nbsp;然后会选择“install on system”（系统类型），一般有以下四类：Personal Desktop、Work Station、Server、Custom。我选择的是Custom。自己可根据需要选择。点击“Next”<br/>4、&nbsp;&nbsp;然后选择分区方式，一般有automatically partition（自动分区）、Manually Partition With Disk（自定义分区）、Manually Partition With Fdisk（experts only）几类。一般选择自定义分区。然后点击“Next”。<br/>5、&nbsp;&nbsp;选择自定义分区后，会进入分区界面。根据自己的硬盘大小和自己的需求来进行划分吧。（1）先对“/”、“/boot”、“/usr、”“/var”在第一个下拉框中选择，空间大小可改，其余的默认即可。<br/>（2）分配“/swap”。在第二个下来框中选择，大小一般为内存的2倍，作为交换分区。<br/>（3）分配“/home”。余下的空间都分给“/home”。<br/>6、接下来的页面默认即可。然后点击“Next”即可。<br/>7、配置机子的IP地址。在中间有两个选项“anutomatically &nbsp;via &nbsp;DHCP”和“manually”，选择“manually”，然后点击右上方的“Edit”，将会弹出个配置IP的窗口，这里也有两个选项“congfigure &nbsp;using &nbsp;DHCP”和“Active on boot”，选择“Active on boot”。然后配置IP和子网掩码。配完后，在这一步页面的下方配置DNS。<br/>8、接下来的页面是“select &nbsp;a &nbsp;security &nbsp;level &nbsp;for &nbsp;the &nbsp;system”（选择系统安全水平）。有“High”、“Medium”、“No firewall”三类。这个可自己选择。<br/>9、选择系统语言。一般选择中文和英文两种就可以了。<br/>10、选择系统时间。自定义。<br/>11、设置root用户密码。同时可点击“Add”添加用户。<br/>12、接下来的页面是“Authentication Configuration”（询问检查配置是否有误）。<br/>13、接下来就读取数据包。<br/>14、选择“about to install”一般必须选择的有三种“Development Tools”、“FTP”、“Networks”。其中“Networks”中只选择“telnet”即可。可根据自己需求选择，并不是多多益善，要合理搭配，没必要装的不必装。<br/>15、然后就开始读盘安装。一直点击“Next”。<br/>16、安装完毕，退出盘来，对Linux中的“FTP”和“Telnet”进行配置。具体如下：<br/>（1）&nbsp;&nbsp;重启Linux，登陆。<br/>（2）&nbsp;&nbsp;键入“cd &nbsp;/etc/xinetd.d/<br/>（3）&nbsp;&nbsp;进入xinetd.d目录下，看到有“telnet”和“vsftpd”，对这两项进行编辑。具体如下：键入“vi &nbsp;telnet”进入编辑页面，将其中的“disable＝yes”中的yes改为no。vsftpd中的用同样的方法改同样的地方即可。<br/>17、重启Linux。Linux系统彻底安装成功了。<br/><br/><p align="center">（二）&nbsp;&nbsp;Linux下的mysql的安装</p><br/>（1）将php-4[1].0.4.tar.gz、mysql-3[1].23.46.tar.gz、apache_1[1].3.27.tar.gz的压缩文件利用FTP放在刚配置的服务器上，都放在同一个目录下。<br/>（2）安装Mysql，具体如下：<br/> &nbsp; &nbsp; 解压缩Mysql<br/> &nbsp; &nbsp; tar &nbsp;zxvf &nbsp;mysql_3[1].23.46.tar.gz &nbsp; &nbsp; (解压缩后产生一个Mysql－3.23.46的文件)<br/> &nbsp; &nbsp; cd &nbsp;mysql_3.23.46<br/> &nbsp; &nbsp; ./configure --prefix=/usr/local/mysql &nbsp;(配置mysql安装信息及安装路径)<br/> &nbsp; &nbsp; make<br/> &nbsp; &nbsp; make &nbsp;install &nbsp; &nbsp;（一般不需要别的参数。编译Mysql需要很多时间）<br/> &nbsp; &nbsp; cd &nbsp;/usr/local/mysql/bin<br/> &nbsp; &nbsp; ./mysql_install_db &nbsp; &nbsp; &nbsp; &nbsp;(设置mysql初始运行库，这一步也可以这样实现：./home/download/mysql_3.23.46/scripts/mysql_install_db)这样Mysql就算编译好了，下面配置mysql的用户组。<br/> &nbsp; &nbsp; chown －R &nbsp;root &nbsp;/usr/local/mysql<br/> &nbsp; &nbsp; chown －R &nbsp;mysql &nbsp;/usr/local/mysql/var &nbsp;(msyql实际为一个linux用户，在此指令运行之前建立，否则无法运行此指令)<br/> &nbsp; &nbsp; 拷贝配置文件<br/> &nbsp; &nbsp; cp support-files/my-medium.cnf/etc/my.cnf &nbsp; (overwrite??---yes)<br/> &nbsp; &nbsp; 运行mysql<br/> &nbsp; &nbsp; /usr/local/mysql/bin/safe_mysqld &nbsp;–user=mysql &nbsp;&<br/> &nbsp; &nbsp; mysql安装完成，看一下进程<br/> &nbsp; &nbsp; ps –ef &#124; grep mysqld <br/> &nbsp; &nbsp; 就能够看到mysql进程已经运行起来了，把mysql写入开机自启动项里，编辑/etc/rc.d/rc.local文件<br/> &nbsp; &nbsp; vi &nbsp;/etc/rc.d/rc.local<br/> &nbsp; &nbsp; 按“i”进入编辑模式，加入一行 /usr/local/mysql/bin/safe_mysqld –user=mysql &<br/> &nbsp; &nbsp; 这样，mysql配置完成了，然后是用户设置。<br/> &nbsp; &nbsp; ./mysql –u root –p &nbsp; &nbsp; (登陆mysql)<br/> &nbsp; &nbsp; CREATE DATABASE samp_db; &nbsp; &nbsp; &nbsp;建立用户数据库<br/> &nbsp; &nbsp; GRANTALL &nbsp;ON samp_db.* To test@localhost IDENTIFIED BY “pass”; &nbsp;用户授权<br/> &nbsp; &nbsp; flush privileges<br/> &nbsp; &nbsp; 这样mysql就彻底安装完成了。<br/><p align="center">（三）Apache和Php的编译</p><br/>Apache和Php是一起安装的。<br/>（1）&nbsp;&nbsp;首先解压缩Apache和Php。<br/>tar &nbsp;zxvf &nbsp;apache_1[1].3.27.tar.gz<br/>tar &nbsp;zxvf &nbsp;php-4[1].0.4.tar.gz<br/>cd &nbsp;apache_1.3.27<br/>./configure –prefix=/usr/local/apache<br/>cd &nbsp;/home/download/php-4.0.4<br/>./configure –-with-apache=/home/download/apache_1.3.27 –with-mysql=/usr/local/mysql –disable-debug –enable-track-vars(上面的配置参数是一般的情况，可以根据需求修改，with、disable、enable前是两条小短横线)<br/>make<br/>make install<br/>（2） &nbsp;拷贝配置文件<br/>cp &nbsp;php.ini-dist &nbsp;/usr/local/lib/php.ini<br/>cd &nbsp;../apache_1.3.27<br/>（3） &nbsp;加入php模块，从新配置apache<br/>./configure –prefix=/usr/local/apache –activate-module=src/modules/php4/libphp4.amake（prefix、active前是两条小短线）<br/>make<br/>make install<br/>（4） &nbsp;好了，编译工作已经完成了，现在需要修改一些配置文件。<br/>cd &nbsp;/usr/local/apache/conf<br/>vi &nbsp;httpd.conf<br/>将AddType &nbsp;application/x-httpd-php.php那一行前面的＃去掉<br/>再加入一行AddType &nbsp;application/x-httpd-php.php3<br/>如果没有这一行，那么找到AddType application…..字段，在下面添加这么两行<br/>AddType &nbsp;application/x-httpd-php.php<br/>AddType &nbsp;application/x-httpd-php.php3<br/>(vi 里面搜索字段方法：键入“/”,进入搜索模式，输入要搜索的字段，回车)<br/>修改DirectoryIndex index.html那一行，在index.html后面加入index.php、 index.php3<br/>有可能还需要修改现在几个参数<br/>Server Name（主机名称，申请域名则填入域名，如：www.***.com,或者填入主机IP地址均可。）<br/>Server Admin（管理员信箱，如无需要可不做修改）<br/>DoumentRoot“/usr/local/apache/htdocs”（主页文件放置目录，可自行设置）<br/><Directory “/usr/local/apache/htdocs”> &nbsp;(主页文件放置目录，可自行设置)<br/>都改完以后，启动Apache。<br/>/usr/local/apache/bin/apachect1 start<br/>测试Php的安装情况，在你所指定的DoumentRoot目录下，建立一个文件test.php<br/>内容如下：<br/><?php phpinfo();?><br/>然后在另一台机器上试着访问一下这个test.php。<br/>最后将apache启动信息写入rc.local<br/>vi &nbsp;/etc/rc.d/rc.local<br/>写入一行：<br/>/usr/local/apache/bin/apachect1 start<br/>至此，apache+php安装完成。<br/><br/><br/><br/><br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ******************************************<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *这是我2004年的时候整理的，现在拿出来跟大家分享一下！*<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ******************************************<br/>Tags - <a href="http://www.dzhope.com/tags/linux/" rel="tag">linux</a> , <a href="http://www.dzhope.com/tags/php/" rel="tag">php</a> , <a href="http://www.dzhope.com/tags/mysql/" rel="tag">mysql</a> , <a href="http://www.dzhope.com/tags/apache/" rel="tag">apache</a> , <a href="http://www.dzhope.com/tags/%25E6%259C%258D%25E5%258A%25A1%25E5%2599%25A8/" rel="tag">服务器</a> , <a href="http://www.dzhope.com/tags/%25E6%259C%258D%25E5%258A%25A1%25E5%2599%25A8%25E5%25AE%259A%25E5%2588%25B6%25E5%25AE%2589%25E8%25A3%2585/" rel="tag">服务器定制安装</a>
]]>
</description>
</item><item>
<link>http://www.dzhope.com/post//#blogcomment</link>
<title><![CDATA[[评论] Linux系统下PHP服务器的定制安装（原创）]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.dzhope.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>