注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

阿飘的博客

十里平湖霜满天 寸寸青丝愁华年

 
 
 

日志

 
 

安装Freebsd,Apache22, MySQL5.1 , PHP   

2009-09-10 13:07:00|  分类: Linux |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
1, 先用最小化安装。划分了100G空间到一个slince (总空间160G)
2, 然后用自动化分区的方法分了如下几个区
Filesystem  1K-blocks   Used    Avail Capacity  Mounted on
/dev/ad6s1a    507630  82150   384870    18%    /
devfs               1      1        0   100%    /dev
/dev/ad6s1e    507630     12   467008     0%    /tmp
/dev/ad6s1f  94136980 510078 86095944     1%    /usr
/dev/ad6s1d   2011694   3008  1847752     0%    /var

------------------------------------------------------

3, 安装Ports .
# sysinstll
选Configure, 选distribution,选ports OK, INSTALL

4, 添加用户 lidong
adduser lidong
把用户添加到wheel 组以便使用 su 命令
#pw groupmod wheel -M lidong

5,在另外一个windows电脑上用PuTTy远程管理就行了 。

6,安装Apache,
# cd /usr/ports/www/apache22
# make install
# 呵呵,自动开始从www.apache.org/dist/httpd/httpd-2.2.0.tar.bz2 下载httpd-2.2.0.tar.bz2
装完系统提示 :
To run apache www server from startup, add apache22_enable="YES"
in your /etc/rc.conf. Extra options can be found in startup script.
===>   Compressing manual pages for apache-2.2.0_7
===>   Running ldconfig
/sbin/ldconfig -m /usr/local/lib
===>   Registering installation for apache-2.2.0_7
===> SECURITY REPORT:
      This port has installed the following files which may act as network
      servers and may therefore pose a remote security risk to the system.
/usr/local/lib/libapr-1.so.2

7,下面装mysql
# /usr/port/database/mysql51-client
# make install

===> Installing rc.d startup script(s)
===>   Compressing manual pages for mysql-server-5.1.6_2
===>   Registering installation for mysql-server-5.1.6_2
===> SECURITY REPORT:
      This port has installed the following files which may act as network
      servers and may therefore pose a remote security risk to the system.
/usr/local/libexec/mysqld

      This port has installed the following startup scripts which may cause
      these network services to be started at boot time.
/usr/local/etc/rc.d/mysql-server

      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.

      For more information, and contact details about the security
      status of this software, see the following webpage:
http://www.mysql.com/
安装完成。

中间用 pkg_delete mysql-client-4.1.18_1
这个命令卸载了老版本的一个mysql,然后进入mysql51-client目录里面make install 了一下。

8,配置MySql5
用户mysql已经在安装的时候就添加到系统里面了。

#./mysql_install_db

Installing all prepared tables
Fill help tables

To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/local/bin/mysqladmin -u root password 'new-password'
/usr/local/bin/mysqladmin -u root -h bsdamd password 'new-password'
See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr/local ; /usr/local/bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the /usr/local/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com

执行下面启动MySqQL语句出错 # ./mysqld_safe &
# Starting mysqld daemon with databases from /var/db/mysql
STOPPING server from pid file /var/db/mysql/bsdamd.pid
070827 15:23:16  mysqld ended

这说明mysql 用户没有权限写 /var/db/mysql 这个目录。所以去设置一下
#chown mysql /var/db/mysql
#chgrp mysql /var/db/mysql

# /usr/local/bin/mysqld_safe --user=mysql &
#修改mySQL 的 root密码 ,和系统root密码不是一回事。完全不相关的。
#/usr/local/bin/mysqladmin -u root password 'new-password'  

#至此,mysql 安装完毕。
#########################################################

9,安装PHP
#cd /usr/ports/lang/php5
#make install

#  FreeBsd 真是太好用了,用Ports管理软件真是太方便了。这点和Debian的 apt-get 有的一拼。也和#  红帽子的yum 有的一比。

[activating module `php5' in /usr/local/etc/apache22/httpd.conf]
Installing PHP CLI binary:        /usr/local/bin/
Installing PHP CLI man page:      /usr/local/man/man1/
Installing build environment:     /usr/local/lib/php/build/
Installing header files:          /usr/local/include/php/
Installing helper programs:       /usr/local/bin/
  program: phpize
  program: php-config
Installing man pages:             /usr/local/man/man1/
  page: phpize.1
  page: php-config.1
***************************************************************

Make sure index.php is part of your DirectoryIndex.

You should add the following to your Apache configuration file:

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

***************************************************************
===>   Compressing manual pages for php5-5.1.2_1
===>   Registering installation for php5-5.1.2_1
===> SECURITY REPORT:
      This port has installed the following files which may act as network
      servers and may therefore pose a remote security risk to the system.
/usr/local/libexec/apache22/libphp5.so
/usr/local/bin/php

      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.

      For more information, and contact details about the security
      status of this software, see the following webpage:
http://www.php.net/

# vi /usr/local/etc/apache22/httpd.conf
拷贝下面两行到<ifModule>里面
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

#重起Apache
#/usr/local/sbin/apachectl restart &

#测试
新建一个文件 #vi /usr/local/www/apache22/data/test.php
里面就一条语句
<?php
phpinfo();
?>
测试一下http://localhost/test.php   ,显示出系统信息,就OK了。
#  PHP 安装完成
  评论这张
 
阅读(805)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017