当前位置: 首页 > 图文教程 > 操作系统 > Unix/Linux > linux构建动态WEB服务器安装篇

Unix/Linux
小型机cpu类型
bind9的安装
如何查看服务器上有多少个CPU
wu-ftp 设置匿名服务器(转载)
Solaris硬盘分区学习笔记(转载)
如何在solaris中添加删除磁盘和分区 (转载)
共享光驱怎么做?
改solaris 8的ip地址的问题
加路径的问题 ;(
超级终端如何发送STOP+A?
如何对某个端口限制IP访问 比如 针对1521端口 只允许某个IP访问
如何让root用户远程telnet?
/usr/lib/ld.so.1损坏或丢失
[分享]Sun X3151A 光纤网卡故障排除实例
[分享]Solaris 2.6+Ultra5内置扬声器故障诊断实例
在VMWARE上装Sun Cluster 3.1 Update 3(ZT )
Windows客户端使用UNIX打印服务器上共享打印机的方法
如何改网卡IP地址
[color=darkblue]CacheFS笔记[/color]
在SUN工作站上安装RTL8139网卡

Unix/Linux 中的 linux构建动态WEB服务器安装篇


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2010-01-15   浏览: 149 ::
收藏到网摘: n/a

基本配置
安装web服务器:httpd-2.X.X
先优化吧
根据CPU设置变量
#export CFLAGS=”-O2 -march=pentium4 -pipe” && CXXFLAGS=$CFLAGS
“-march”选项表示为特定的cpu类型编译二进制代码(不能在更低级别的cpu上运行),
Intel通常是:pentium2, pentium3, pentium3m, pentium4, pentium4m, pentium-m, prescott, nocona
说明:pentium3m/pentium4m是笔记本用的移动P3/P4;pentium-m是迅驰I/II代笔记本的cpu;
prescott是带SSE3的P4(以滚烫到可以煎鸡蛋而闻名);nocona则是最新的带有EMT64(64位)的P4(同样可以煎鸡蛋)
AMD通常是:k6, k6-2, k6-3, athlon, athlon-tbird, athlon-xp, athlon-mp, opteron, athlon64, athlon-fx
用AMD的一般都是DIYer,就不必解释了吧。

1.解压缩
#./configure –sysconfdir=/etc/ –enable-ssl –enable-modules
#make;make install
2.启动服务
#/usr/local/apache2/bin/apachectl start
3. 测试
#links http://localhost
#lynx http://localhost
默认网站目录/usr/local/apache2/htdocs/index.html
netstat -tul |grep 80
安装Mysql
1.解压缩
# ./configure –sysconfdir=/etc –with-extra-charsets=latin1,utf8,gbk,big5,gb2312
–with-extra-charsets指定其它我们要用到的编码,有时象动网之类要用到gbk。

#.make ;make install
#cp /usr/local/share/mysql/my-large.cnf /etc/my.cnf
2.初始化
#useradd -d /usr/local/var mysql
#su - mysql
$/usr/local/bin/mysql_install_db
3.启动服务器
$/usr/local/bin/mysqld_safe
4.用/usr/local/bin/mysql登录测试
安装php
1.解压缩后
#./configure –with-apxs2=/usr/local/apache2/bin/apxs –with-mysql=/usr/local –enable-versioning
–enable-versioning支持老的 php3.php2

#make ; make install
#cp php.ini-dist /usr/local/lib/php.ini
2.编辑apache配置文件/etc/httpd.conf,增加
AddType application/x-httpd-php .php .phtml
3.编写测试网页/usr/local/apache2/htdocs/test.php
4.访问测试网页
# links http://localhost/test.php
收尾工作
1.让apache自动启动
加入到开机脚本/etc/rc.local
/usr/local/apache2/bin/apachectl start
2.让mysql数据库服务器自动启动
#cp /usr/local/share/mysql/mysql.server /etc/init.d/mysqld
#chkconfig mysqld on