整合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
相关文档:
1. 安装Cygwin
运行Cygwin的安装程序。从文见包的的列表中,在DEV里面,确定要选择
• Ruby
• gcc
• subversion
你需要使用gcc来建立Cygwin版本的MySQL.
2. 在windows上面安装MYSQL:
download MySQL 5.0 Windows Installer
3. & ......
目前,最常用的三种动态网页语言有ASP(Active Server Pages),JSP(Java Server Pages),
PHP (Hypertext Preprocessor)。
简 介
ASP全名Active Server & ......
版权声明
:转载时请以超链接形式标明文章原始出处和作者信息及本声明
http://bbayou.blogbus.com/logs/37045617.html
测试数据2.5G,共有数据9427567条。用的mysql的large服务器的配置。
load
一次需要大概10分钟左右。
建的表用的是MYISAM,调整了几个session的参数值
SET
SESSION
BULK_INSERT_BUFFER_S ......
转自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 ......
MySQL日期字段分Date和Time两种,oracle日期字段只有Date,包含年月日时分秒信息,用当前数据库的系统时间为sysdate,精确到秒,或者用字符串转换日期型函数:
To_date('2001-08-01','YYYY-MM-DD'); 年-月-日
24小时:分钟:秒的格式 'YYYY-MM-DD HH24:MI:SS'  ......