FreeBSD6.1安装apache+mysql+php

一、最小化安装freebsd6.1

二、设置网络
vi /etc/rc.conf
添加:
hostname="server.test.com"
ifconfig_lnc0="inet 192.168.10.121 netmask 255.255.255.0"
defaultrouter="192.168.10.1"
保存退出

vi /etc/resolv.conf
添加
nameserver 202.96.209.133
保存退出

运行:
/etc/netstart

三、安装ports
运行sysinstall->Configure->Distributions->ports

四、安装perl
cd /usr/ports/lang/perl5.8 && make install clean

五、安装mysql5.0
用adduser添加用户mysql到mysql组中
下载mysql5.0然后运行
tar zxvf mysql.tar.tar
mv mysql-standard-5.0.22-freebsd6.0-i386 /usr/local/mysql
cd /usr/local/mysql
scripts/mysql_install_db --user=mysql
第一次启动mysql服务
bin/mysqld_safe --user=mysql &
修改数据库管理员密码为123456
bin/mysqladmini -uroot password 123456 
cp support-files/mysql.server /usr/local/etc/rc.d/mysql.sh

六、安装apache2.0
下载apache2.0然后运行
tar zxvf httpd.tar.gz
cd httpd-2.0.59
./configure --prefix=/usr/local/http --enable-so --enable-rewrite
make
make install
make clean
修改httpd.conf
vi /usr/local/httpd/conf/http.conf
添加
ServerName localhost
运行
/usr/local/http/bin/apachectl start
自动运行服务
cp /usr/local/http/bin/apachectl /usr/local/etc/rc.d/http.sh

七、安装gd
cd /usr/ports/graphics/gd && make install clean

八、安装libxml2
cd /usr/ports/textproc/libxml2 && make install clean

九、安装t1lib
cd /usr/ports/devel/t1lib/ && make install clean

十、安装PHP5.1
下载php5.1然后运行
tar zxvf php.tar.gz
cd php-5.1.4
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php --with-apxs2=/usr/local/http/bin/apxs --with-mysql=/usr/local/mysql --with-gd --with-jpeg-dir=/usr/local/bin --with-zlib-dir=/usr/local/bin --with-freetype-dir --with-xpm-dir=/usr/loacl/bin --with-t1lib 
make 
make install
make clean
cp php.ini-dist /usr/local/php/php.ini
修改apache配置文件
vi /usr/local/http/conf/httpd.conf
添加
AddType application/x-httpd-php .php 
修改DirectoryIndex为
DirectoryIndex index.html index.php
保存退出
重启apache服务
安装全部完成  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值