用家里的老电脑按装了freebsd 8.2 +nginx + mysql+ php+ wordpress
时间:2011-03-19
来源:互联网
看了这篇文章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
也想用家里的老电脑配台服务器,就当废物利用
安装时必须以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
作者: lalitou 发布时间: 2011-03-19
速度比较慢
作者: chenyx 发布时间: 2011-03-19
龟速
作者: macafee 发布时间: 2011-03-19
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28