易截截图软件、单文件、免安装、纯绿色、仅160KB

整合freeBSD下nginx+php+mysql安装方案(ports安装)

  最近一直在研究freeBSD下nginx+php+mysql的安装,看了很多网上的资料收获不小,不过大部分都是编译安装,相对初学者来说比较复杂,不容易理解,所以我整合了一些ports安装的资料,都是经过自己验证后的,安装成功也比较容易理解,下面是两种成功的案例,其中有一个是Apache代替nginx的安装,希望对大家有所帮助。
安装前更新好ports:
       进入系统后,准备cvs更新:
1.         cd /usr/ports/net/cvsup-without-gui
2.         cp /usr/share/examples/cvsup/ports-supfile /etc/ports-supfile
3.         # vi /etc/ports-supfile
将其中的#*default host=CHANGE_THIS.FreeBSD.org一行改为
*default host=cvsup4.FreeBSDchina.org
4.         更新ports
    /usr/local/bin/cvsup -g -L 2 /etc/ports-supfile
       1,freeBSD下Apache+php+mysql安装
       
安装时必须用root用户或su方式登录后生效
安装配置apache
#cd /usr/ports/www/apache22/
#make config 将mysql勾上
#make install clean
#rehash
#ee /usr/local/etc/apache22/httpd.conf 修改以下配置
ServerAdmin James@xuwenhui.com
ServerName 192.168.1.1:80
DirectoryIndex index.html index.php
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
#ee /boot/defaults/loader.conf 修改以下配置
accf_data_load="YES"
accf_http_load="YES"
#echo 'apache22_enable="YES"' >> /etc/rc.conf 启动时自动运行apache服务
如果不成功可以:ee /etc/rc.conf 里添加
apache22_enable="YES"
#apachectl start
输入地址看到It works!表示安装成功.
安装配置php5及php5-extensions
#cd /usr/ports/lang/php5
#make config apache一定要勾上,不然apache认不出php
#make install clean
#cd /usr/ports/lang/php5-extensions
#make config 选上需要支持的扩展
#make install clean
#cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini
#apachectl restart 重启apache后php就生效了
安装配置mysql
#cd


相关文档:

ruby gem mysql on cygwin

1.    安装Cygwin
运行Cygwin的安装程序。从文见包的的列表中,在DEV里面,确定要选择
• Ruby
• gcc
• subversion
    你需要使用gcc来建立Cygwin版本的MySQL.
2. 在windows上面安装MYSQL:
    download MySQL 5.0 Windows Installer
3.  & ......

PHP插入数据库代码,编辑,删除

插入代码
 <?
$action=$_GET['action'];
switch($action){
//添加记录
case"add";
$mail = trim(htmlspecialchars($_POST["mail"]));
$username = trim(htmlspecialchars($_POST["username"]));
$tel = trim(htmlspecialchars($_POST["tel"]));
$fax = trim(htmlspecialchars($_POST["fax"]));
$c ......

一个 mysql server 上的小技巧

转自http://www.linuxbyte.org/yi-ge-mysql-server-shang-de-xiao-ji-qiao.html
在my.cnf 的 mysql 端 添加如下设置
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
prompt="(\u:mysql1@linuxbyte.org \R:\m)[\d]: "
会产生如下效果:
root@ubuntu:/home/hew# mysql -u hew -p
Enter pass ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号