免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 6824 | 回复: 12
打印 上一主题 下一主题

用家里的老电脑按装了freebsd 8.2 +nginx + mysql+ php+ wordpress [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-03-19 19:31 |只看该作者 |倒序浏览
看了这篇文章http://www.linuxeden.com/forum/thread-216469-1-1.html
也想用家里的老电脑配台服务器,就当废物利用
安装时必须以root或su登入

1.安装前更新好ports

2.安装mysql

安装过程如下  shell>pw groupadd mysql

shell>pw useradd -g mysql mysql

shell>cd /usr/ports/database/mysql55-server

shell>make install clean

shell>cd /usr/local/bin

shell>mysql_install_db –user=myql –dasedir=/usr/local –datadir=/var/db/mysql

shell>chown -R root

shell>chown -R mysql /var/db/mysql

shell>chgrp -R mysql

shell>mysqld_safe –user=mysql &

这样 mysql以安装完成并且以经启动,如要开机就自动运行的话编辑/etc/rc.conf j加入mysql_enbale=”YES”

3.安装 nginx

shell>cd /usr/ports/www/nginx

shell>make install clean

4.安装 spawn-fcgi

shell>cd /usr/ports/www/spawn-fcgi

shell>make install clean

5.安装 php5

shell>pkg_add -R php5

6.安装php扩展

shell>pkg_add -R php5-mysqli

shell>pkg_add -R php5-gd

shell>pkg_add -R php5-mysql

shell>pkg_add -R php5-dbase

shell>pkg_add -R php5-posix

shell>pkg_add -R php5-sockets

shell>pkg_add -R php5-openssl

shell>pkg_add -R php5-zip

shell>pkg_add -R php5-zlib

可以根据你的需要安装扩展

7.编辑你的nginx.conf

shell>vi /usr/local/etc/nginx/nginx.conf
找到如下内容

#user nobody;

改成

user www; #去掉前面#号
—————-

找到如下内容
location / {
root   /usr/local/www/nginx;
index index.html index.htm;
}

改成

location / {
root   /usr/local/www/nginx; #这里是站点根目录,根据需要修改
index index.php index.html index.htm; #添加 index.php
}

找到如下内容

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
#    root           html;
#    fastcgi_pass   127.0.0.1:9000;
#    fastcgi_index index.php;
#    fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
#    include        fastcgi_params;
#}

改成

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root           html;

fastcgi_pass   127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/www/nginx$fastcgi_script_name;

include        fastcgi_params;
}

然后重启 nginx

shell>/usr/local/etc/rc.d/nginx restart

我的网站地址:http://www.freegx.tk/

各位朋友帮我看看速度怎么样

硬件配置: cpu cy1.7
                主板 华硕 p4s533mx
                内存 64*2 sdram pc133
                硬盘 迈拓 80G

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
2 [报告]
发表于 2011-03-19 21:00 |只看该作者
速度比较慢

论坛徽章:
0
3 [报告]
发表于 2011-03-19 21:17 |只看该作者
龟速

论坛徽章:
0
4 [报告]
发表于 2011-03-19 23:59 |只看该作者
这个有什么意义呢

论坛徽章:
3
操作系统版块每日发帖之星
日期:2016-02-23 06:20:00操作系统版块每日发帖之星
日期:2016-03-12 06:20:00IT运维版块每日发帖之星
日期:2016-03-14 06:20:00
5 [报告]
发表于 2011-03-20 00:43 |只看该作者
18querys in 2.731 seconds.

论坛徽章:
2
技术图书徽章
日期:2013-11-23 01:55:57白羊座
日期:2013-12-08 15:48:16
6 [报告]
发表于 2011-03-20 02:19 |只看该作者
回复 4# b86873564


    我觉得吧,可以练练手!

论坛徽章:
3
操作系统版块每日发帖之星
日期:2016-02-23 06:20:00操作系统版块每日发帖之星
日期:2016-03-12 06:20:00IT运维版块每日发帖之星
日期:2016-03-14 06:20:00
7 [报告]
发表于 2011-03-20 16:44 |只看该作者
樓主可以開著它...看看能保持多長時間不關機記錄.

论坛徽章:
0
8 [报告]
发表于 2011-03-20 18:29 |只看该作者
樓主可以開著它...看看能保持多長時間不關機記錄.
猴马大叶 发表于 2011-03-20 16:44



    ^_^,这取决于电源……

论坛徽章:
2
技术图书徽章
日期:2013-11-23 01:55:57白羊座
日期:2013-12-08 15:48:16
9 [报告]
发表于 2011-03-20 20:06 |只看该作者
^_^,这取决于电源……
nxzdi 发表于 2011-03-20 18:29



    要是开上一个月不关机,他的家人肯定要奔溃了!  

论坛徽章:
0
10 [报告]
发表于 2011-03-21 02:53 |只看该作者
要是开上一个月不关机,他的家人肯定要奔溃了!
7looki 发表于 2011-03-20 20:06



    我机器如果不停电, 基本上不关机!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP