用家里的老电脑按装了freebsd 8.2 +nginx + mysql+ php+ wordpress
看了这篇文章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