|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
对于linux命令,一定要学会用man和info去查他们的解释;
1、先在/etc/make.conf到场sync站点,待会儿要用emerge举行同步。
.代码以下:
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
在实行emerge--sync同步portage树。
2、晋级portage版本,要不待会儿安装mysql的时分会提醒portage版本旧的!
.代码以下:
emergeportage
先界说USE:
.代码以下:
/etc/portage/package.use
dev-lang/phpclimingxmlftpcurlpdomysqlimysqlsqlitejsoncgictypegdhash
www-servers/nginxfastcgi
编纂/etc/portage/package.keywords
www-servers/spawn-fcgi~x86
3、安装mysqlnginxphpspawn-fcgipecl-apcpecl-memcache。
.代码以下:
emergemysqlnginxphpspawn-fcgipecl-apcpecl-memcache
4、设置mysql。
.代码以下:
mkdir-p/data0/mysql/data
mysql_install_db--user=mysql--basedir=/usr--datadir=/data0/mysql/data
设置my.cnf
.代码以下:
rm-f/etc/mysql/my.cnf
vim/etc/mysql/my.cnf
[client]
port=3306
socket=/var/run/mysqld/mysqld.sock
[mysql]
prompt="(u:s135[d]>"
no-auto-rehash
[mysqld]
bind-address=173.252.207.109
user=mysql
port=3306
socket=/var/run/mysqld/mysqld.sock
basedir=/usr
datadir=/data0/mysql/data
open_files_limit=600
back_log=20
max_connections=100
max_connect_errors=200
table_cache=60
external-locking=FALSE
max_allowed_packet=16M
sort_buffer_size=128K
join_buffer_size=128K
thread_cache_size=10
thread_concurrency=8
query_cache_size=0M
query_cache_limit=2M
query_cache_min_res_unit=2k
default_table_type=MyISAM
thread_stack=192K
transaction_isolation=READ-UNCOMMITTED
tmp_table_size=512K
max_heap_table_size=32M
/var/log/slow.log
/var/log/error.log
long_query_time=1
log_long_format
server-id=1
#log-bin=/usr/local/mysql/data/binlog
binlog_cache_size=2M
max_binlog_cache_size=4M
max_binlog_size=512M
expire_logs_days=7
key_buffer_size=4M
read_buffer_size=1M
read_rnd_buffer_size=2M
bulk_insert_buffer_size=2M
myisam_sort_buffer_size=4M
myisam_max_sort_file_size=10G
myisam_max_extra_sort_file_size=10G
myisam_repair_threads=1
myisam_recover
[mysqldump]
quick
max_allowed_packet=16M
mysqladmin-urootpassword""
启动mysql
/etc/init.d/mysqlstart
5、设置nginx
vim/etc/nginx/nginx.conf
.代码以下:
usernginxnginx;
worker_processes1;
error_log/var/log/nginx/nginx_error.logcrit;
pid/var/run/nginx.pid;
#Specifiesthevalueformaximumfiledescriptorsthatcanbeopenedbythisprocess.
worker_rlimit_nofile52100;
events
{
useepoll;
worker_connections52100;
}
http
{
includemime.types;
default_typeapplication/octet-stream;
#charsetgb2312;
server_names_hash_bucket_size128;
client_header_buffer_size32k;
large_client_header_buffers432k;
client_max_body_size8m;
sendfileon;
tcp_nopushon;
keepalive_timeout7020;
tcp_nodelayon;
server_tokensoff;
fastcgi_connect_timeout300;
fastcgi_send_timeout300;
fastcgi_read_timeout300;
fastcgi_buffer_size64k;
fastcgi_buffers464k;
fastcgi_busy_buffers_size128k;
fastcgi_temp_file_write_size128k;
gzipoff;
gzip_min_length1k;
gzip_buffers416k;
gzip_http_version1.0;
gzip_comp_level2;
gzip_typestext/plainapplication/x-javascripttext/CSSapplication/xml;
gzip_varyon;
server
{
server_namewww.freebsdsystem.org;
root/data0/www/wwwroot/;
indexindex.htmlindex.htmindex.php;
location~.*.php?$
{
#fastcgi_passunix:/tmp/php-cgi.sock;
fastcgi_pass127.0.0.1:9000;
fastcgi_indexindex.php;
includefcgi.conf;
}
location~.*.(gif|jpg|jpeg|png|bmp|swf)$
{
expires30d;
}
location~.*.(js|css)?$
{
expires1h;
}
log_formatblog$remote_addr-$remote_user[$time_local]"$request"
$status$body_bytes_sent"$http_referer"
"$http_user_agent"$http_x_forwarded_for;
access_log/var/log/nginx/blog.logblog;
}
}
设置spawn-fcgi
.代码以下:
vim/usr/local/bin/php-fcgi
#!/bin/sh
#author:coralzd
#poweredbywww.freebsdsystem.org
bin=/usr/bin/php-cgi
case$1in
start)
echo"startingphp-cgi"
spawn-fcgi-a127.0.0.1-p9000-C8-unginx-gnginx-f/usr/bin/php-cgi2>&1>/dev/null&
echo"Done"
stop)
killallphp-cgi
echo"php-cgistop"
*)
echo"usagestart|stop";;
esac
6、开机启动nginxmysql
.代码以下:
rc-updateaddnginxdefault
rc-updateaddmysqldefault
至此设置完成!
看不懂man文档的人.在linux中,命令可分为系统基本命令和应用程序命令.系统基本命令是所有的unix类系统都支持的命令,走到哪都不变,只要是unix类系统上就肯定有. |
|