转:http://www.uplook.cn/kbase-Index-show-view10393.html

#!/bin/bash
# BY kerryhu
# MAIL:king_819@163.com
# BLOG:http://kerry.blog.51cto.com
# Please manual operation yum of before Operation.....
#============================ 更新系统时间 ============================
yum install -y ntp
ntpdate time.nist.gov
echo "00 01 * * * ntpdate time.nist.gov" >> /etc/crontab

#============================ Varnish安装 =============================

如果是RedHat/CentOS系统,在安装varnish的时候首先要安装以下软件包
automake
autoconf
libtool
ncurses-devel
libxslt
groff
pcre-devel
pkgconfig

groupadd www
useradd www -g www -s /sbin/nologin
mkdir -p /data/varnish/{cache,logs}
chmod +w /data/varnish/{cache,logs}
chown -R www:www /data/varnish/{cache,logs}
cd /opt
yum install -y automake autoconf libtool ncurses-devel libxslt groff pcre-devel pkgconfig
wget download">http://sourceforge.net/projects/varnish/files/varnish/2.1.3/varnish-2.1.3.tar.gz/download
tar -zxvf varnish-2.1.3.tar.gz
cd varnish-2.1.3
./configure --prefix=/usr/local/varnish
make;make install

axel插件是基于yum下的一个多线程下载插件,通过打开多个HTTP/FTP连接来将一个文件进行分段下载,从而达到加速下载的目的。对于下载大文件,该工具特别有用。可用于CentOS、RHEL、Fedora等使用yum的Linux发行版。暂时找不到rpm包,只能编译安装。
0. CentOS6 64位 快速免编译安装脚本
wget "http://www.151051.com/soft/axel/ins_axel_centos6.sh" -O - | bash
1. 下载axel源码并安装axel:

wget --no-check-certificate https://alioth.debian.org/frs/download.php/file/3015/axel-2.4.tar.gz
tar zxvf axel-2.4.tar.gz
cd axel-2.4
./configure
make
make install

2. 下载配置文件axelget.conf与axelget.py到yum里:

cd /etc/yum/pluginconf.d/
wget http://cnfreesoft.googlecode.com/svn/trunk/axelget/axelget.conf
cd /usr/lib/yum-plugins/
wget http://cnfreesoft.googlecode.com/svn/trunk/axelget/axelget.py

最后确认 /etc/yum.conf中plugins=1 

3. 测试并安装yum-fastestmirror插件:

yum install -y yum-fastestmirror

注:axel插件也可以当独立下载工具来使用。当成独立下载工具使用时,适用于绝大部分Linux发行版。

使用参数如下:
一般使用:axel url(下载文件地址);
限速使用:加上 -s 参数,如 -s 10240,即每秒下载的字节数,这里是 10 Kb;
限制连接数:加上 -n 参数,如 -n 5,即打开 5 个连接。

以上配置在CentOS 5.x、Fedora 12上验证通过。在yum的时候可能会遇到很长时间都没有速度的现象,这时可以按Ctrl+C键。这样是终止了从当前站点的下载,然后会自动选择其他站点下载,速度会快很多。

原文:http://www.freebsdsystem.org/yum_axel/

 ---★ 本文转摘自『IT学习者』→ http://www.itlearner.com/article/4671
yum -y install wget --noplugins
wget freevps.us/downloads/nginx-centos-6.sh -O - | bash

注意安装完成后 php-fpm 默认跑在 apache 用户上。

安装完成后,如果你需要的 PHP 扩展未安装,可输入如下命令查询:

yum list | grep ^php*

找到了扩展的名字,就可以直接安装了:

# 以 php memcache 扩展为例
yum install -y php-pecl-memcached

此外还遇到的问题是 DOMDocument 找不到,直接 yum 安装 php-xml:

yum install -y php-xml

所有扩展 yum 安装完成后都需要重新启动 / 载入 php-fpm。
贴下内容来看看(非最新版本,请直接下载 .sh 文件):

#!/bin/bash

##################
# disable apache #
##################
service httpd stop 
chkconfig httpd off
service xinetd stop
chkconfig xinetd off
service saslauthd stop
chkconfig saslauthd off
service sendmail stop
chkconfig sendmail off
service postfix stop
chkconfig postfix off

#Optimize yum on OpenVZ
if [ -e "/proc/user_beancounters" ]
then
  sed -i 's/plugins=1/plugins=0/' /etc/yum.conf
fi

#remove all current PHP and MySQL, will reinstall later. Also, remove apache 
yum -y remove httpd php mysql rsyslog sendmail postfix

###################
# Add a few repos #
###################
# install the Atomic repo for php and nginx (may use epel for nginx depending on version)
wget -q -O - http://www.atomicorp.com/installers/atomic | sh

# RPMForge for nginx dependencies
rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm

#EPEL for syslog-ng and nginx (may use atomic for nginx depending on version)
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm

################################
# Install PHP, NGINX and MySQL #
################################
#yum install GeoIP libGeoIP.so.1 --enablerepo=repoforge
yum -y install mysql-server php-fpm php-mysql php-gd nginx nano exim syslog-ng

#################
# install MySQL #
#################
#yum -y install mysql-server
cat > /etc/my.cnf <<END
[mysqld]
default-storage-engine = myisam
key_buffer = 8M
query_cache_size = 8M
query_cache_limit = 4M
max_connections=25
thread_cache=1
skip-innodb 
query_cache_min_res_unit=0
tmp_table_size = 4M
max_heap_table_size = 4M
table_cache=256
concurrent_insert=2 
END
echo  Do not worry if you see a error stopping MySQL or NGINX
/etc/init.d/mysqld stop
/etc/init.d/mysqld start

####################
# Set up NGINX PHP #
####################
cat > /etc/nginx/php <<END
index index.php index.html index.htm;

location ~ \.php$ {

   include fastcgi_params;
    fastcgi_intercept_errors on;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
  try_files \$uri =404;
    fastcgi_pass 127.0.0.1:9000;
    error_page 404 /404page.html; #makes nginx return it's default 404 
#	page instead of a blank page

} 
END

cat > /etc/nginx/nginx.conf <<END
user              nginx nginx;
worker_processes  2;

error_log         logs/error.log;

pid               logs/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    client_max_body_size 64M;
    sendfile        on;
    tcp_nopush      on;

    keepalive_timeout  3;

    gzip  on;
    gzip_comp_level 2;
    gzip_proxied any;
    gzip_types      text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    server_tokens off;

    include /etc/nginx/conf.d/*;
} 
END
rm /etc/nginx/conf.d/*
cat > /etc/nginx/conf.d/default.conf <<END
server {
    listen 80 default;
    server_name _;
    root /var/www/html;
    include php;

  } 
END
mkdir /usr/share/nginx/logs/
service nginx restart
chkconfig nginx on
chkconfig mysqld on

cat > /etc/php-fpm.d/www.conf <<END
; Start a new pool named 'www'.
[www]

; The address on which to accept FastCGI requests.
; Valid syntaxes are:
;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific address on
;                            a specific port;
;   'port'                 - to listen on a TCP socket to all addresses on a
;                            specific port;
;   '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = 127.0.0.1:9000

; Set listen(2) backlog. A value of '-1' means unlimited.
; Default Value: -1
;listen.backlog = -1

; List of ipv4 addresses of FastCGI clients which are allowed to connect.
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
; must be separated by a comma. If this value is left blank, connections will be
; accepted from any ip address.
; Default Value: any
listen.allowed_clients = 127.0.0.1

; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server. Many
; BSD-derived systems allow connections regardless of permissions. 
; Default Values: user and group are set as the running user
;                 mode is set to 0666
;listen.owner = nobody
;listen.group = nobody
;listen.mode = 0666

; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
;       will be used.
; RPM: apache Choosed to be able to access some dir as httpd
user = apache
; RPM: Keep a group allowed to write in log dir.
group = apache

; Choose how the process manager will control the number of child processes.
; Possible Values:
;   static  - a fixed number (pm.max_children) of child processes;
;   dynamic - the number of child processes are set dynamically based on the
;             following directives:
;             pm.max_children      - the maximum number of children that can
;                                    be alive at the same time.
;             pm.start_servers     - the number of children created on startup.
;             pm.min_spare_servers - the minimum number of children in 'idle'
;                                    state (waiting to process). If the number
;                                    of 'idle' processes is less than this
;                                    number then some children will be created.
;             pm.max_spare_servers - the maximum number of children in 'idle'
;                                    state (waiting to process). If the number
;                                    of 'idle' processes is greater than this
;                                    number then some children will be killed.
; Note: This value is mandatory.
pm = dynamic

; The number of child processes to be created when pm is set to 'static' and the
; maximum number of child processes to be created when pm is set to 'dynamic'.
; This value sets the limit on the number of simultaneous requests that will be
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
; CGI.
; Note: Used when pm is set to either 'static' or 'dynamic'
; Note: This value is mandatory.
pm.max_children = 5

; The number of child processes created on startup.
; Note: Used only when pm is set to 'dynamic'
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
pm.start_servers = 1

; The desired minimum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.min_spare_servers = 1

; The desired maximum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.max_spare_servers = 3

; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
pm.max_requests = 500

; The URI to view the FPM status page. If this value is not set, no URI will be
; recognized as a status page. By default, the status page shows the following
; information:
;   accepted conn    - the number of request accepted by the pool;
;   pool             - the name of the pool;
;   process manager  - static or dynamic;
;   idle processes   - the number of idle processes;
;   active processes - the number of active processes;
;   total processes  - the number of idle + active processes.
; The values of 'idle processes', 'active processes' and 'total processes' are
; updated each second. The value of 'accepted conn' is updated in real time.
; Example output:
;   accepted conn:   12073
;   pool:             www
;   process manager:  static
;   idle processes:   35
;   active processes: 65
;   total processes:  100
; By default the status page output is formatted as text/plain. Passing either
; 'html' or 'json' as a query string will return the corresponding output
; syntax. Example:
;   http://www.foo.bar/status
;   http://www.foo.bar/status?json
;   http://www.foo.bar/status?html
; Note: The value must start with a leading slash (/). The value can be
;       anything, but it may not be a good idea to use the .php extension or it
;       may conflict with a real PHP file.
; Default Value: not set 
;pm.status_path = /status

; The ping URI to call the monitoring page of FPM. If this value is not set, no
; URI will be recognized as a ping page. This could be used to test from outside
; that FPM is alive and responding, or to
; - create a graph of FPM availability (rrd or such);
; - remove a server from a group if it is not responding (load balancing);
; - trigger alerts for the operating team (24/7).
; Note: The value must start with a leading slash (/). The value can be
;       anything, but it may not be a good idea to use the .php extension or it
;       may conflict with a real PHP file.
; Default Value: not set
;ping.path = /ping

; This directive may be used to customize the response of a ping request. The
; response is formatted as text/plain with a 200 response code.
; Default Value: pong
;ping.response = pong

; The timeout for serving a single request after which the worker process will
; be killed. This option should be used when the 'max_execution_time' ini option
; does not stop script execution for some reason. A value of '0' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
;request_terminate_timeout = 0

; The timeout for serving a single request after which a PHP backtrace will be
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
;request_slowlog_timeout = 0

; The log file for slow requests
; Default Value: /var/log/php-fpm.log.slow
;slowlog = /var/log/php-fpm.log.slow

; Set open file descriptor rlimit.
; Default Value: system defined value
;rlimit_files = 1024

; Set max core size rlimit.
; Possible Values: 'unlimited' or an integer greater or equal to 0
; Default Value: system defined value
;rlimit_core = 0

; Chroot to this directory at the start. This value must be defined as an
; absolute path. When this value is not set, chroot is not used.
; Note: chrooting is a great security feature and should be used whenever 
;       possible. However, all PHP paths will be relative to the chroot
;       (error_log, sessions.save_path, ...).
; Default Value: not set
;chroot = 

; Chdir to this directory at the start. This value must be an absolute path.
; Default Value: current directory or / when chroot
;chdir = /var/www

; Redirect worker stdout and stderr into main error log. If not set, stdout and
; stderr will be redirected to /dev/null according to FastCGI specs.
; Default Value: no
;catch_workers_output = yes

; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
; the current environment.
; Default Value: clean env
;env[HOSTNAME] = $HOSTNAME
;env[PATH] = /usr/local/bin:/usr/bin:/bin
;env[TMP] = /tmp
;env[TMPDIR] = /tmp
;env[TEMP] = /tmp

; Additional php.ini defines, specific to this pool of workers. These settings
; overwrite the values previously defined in the php.ini. The directives are the
; same as the PHP SAPI:
;   php_value/php_flag             - you can set classic ini defines which can
;                                    be overwritten from PHP call 'ini_set'. 
;   php_admin_value/php_admin_flag - these directives won't be overwritten by
;                                     PHP call 'ini_set'
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.

; Defining 'extension' will load the corresponding shared extension from
; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
; overwrite previously defined php.ini values, but will append the new value
; instead.

; Default Value: nothing is defined by default except the values in php.ini and
;                specified at startup with the -d argument
;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
;php_flag[display_errors] = off
php_admin_value[error_log] = /var/log/php-fpm/www-error.log
php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 32M
php_admin_value[upload_max_filesize] = 32M
END

mkdir /var/www
mkdir /var/www/html/
useradd apache
service php-fpm start
chkconfig php-fpm on
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
service iptables save

wget freevps.us/downloads/setup-vhost.sh -O /bin/setup-vhost
chmod 755 /bin/setup-vhost
echo "alias nano='nano -w'" >> ~/.bashrc
clear
echo Installation done.
echo to create a vhost, run
echo setup-vhost example.com
echo do not include the www. subdomain.

什么是epel

如果既想获得 RHEL 的高质量、高性能、高可靠性,又需要方便易用(关键是免费)的软件包更新功能,那么 Fedora Project 推出的 EPEL(Extra Packages for Enterprise Linux)正好适合你。EPEL(http://fedoraproject.org/wiki/EPEL) 是由 Fedora 社区打造,为 RHEL 及衍生发行版如 CentOS、Scientific Linux 等提供高质量软件包的项目。

安装http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-5.noarch.rpm

[root@centos6 ~]# ll /etc/yum.repos.d/
total 20
-rw-r--r--. 1 root root 1926 Jul 3 10:16 CentOS-Base.repo
-rw-r--r--. 1 root root 637 Jul 3 10:16 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 624 Oct 24 13:06 CentOS-Media.repo
-rw-r--r--. 1 root root 957 Oct 12 2010 epel.repo
-rw-r--r--. 1 root root 1056 Oct 12 2010 epel-testing.repo

查看epel.repo内容如下

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$ba search
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$b asearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

 

为什么要配置epel源呢

 

因为rhel6里很多开发包没有在iso里,在epel的源里!rhel6 是建立在fedra 12上的

感谢kevin的提醒

本文出自 “学习linux” 博客,请务必保留此出处http://tonychiu.blog.51cto.com/656605/696442

转:http://www.myhack58.com/Article/sort099/sort0102/2011/29472.htm

一、更改yum源为网易的源加快速度

vi /etc/yum.repos.d/CentOS-Base.repo
更改内容如下

# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and the

# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
baseurl=http://mirrors.163.com/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

二、update yum

yum -y update

三、利用CentOS Linux系统自带的yum命令安装、升级所需的程序库

LANG=C
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers

四、安装php和mysql

yum -y install php mysql mysql-server mysql-devel php-mysql php-cgi php-mbstring php-gd php-fastcgi

五、安装nginx
由于centos没有默认的nginx软件包,需要启用REHL的附件包

rpm -Uvh http://download.Fedora.RedHat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
yum -y install nginx

设置开机启动

chkconfig nginx on

六、安装spawn-fcgi来运行php-cgi

yum install spawn-fcgi

七、下载spawn-fcgi 的启动脚本

wget http://bash.cyberciti.biz/dl/419.sh.zip
unzip 419.sh.zip
mv 419.sh /etc/init.d/php_cgi
chmod +x /etc/init.d/php_cgi

启动php_cgi

/etc/init.d/php_cgi start

查看进程

netstat -tulpn | grep :9000

若出现如下代表一切正常

tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 4352/php-cgi

八、配置nginx(详细配置见nginx.conf详细说明)

location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;
include fastcgi_params;
}

九、查看phpinfo
编写脚本

phpinfo();

十、安装phpmyadmin
修改/var/lib/php/session的权限和nginx和php_cgi一致

chown -R www.www /var/lib/php/session

转:http://apps.hi.baidu.com/share/detail/14819035

如果你打算使用Apache httpd Web服务器,请看这里。

一、系统约定

软件源代码包存放位置 /usr/local/data-original

源码包编译安装位置(prefix) /usr/local/software_name

脚本以及维护程序存放位置 /usr/local/sbin

MySQL 数据库位置 /var/lib/mysql(可按情况设置)

网站根目录 /home/www/wwwroot(可按情况设置)

虚拟主机日志根目录 /home/www/logs(可按情况设置)

运行账户 www:www

二、系统环境部署及调整

1、检查系统是否正常

# more /var/log/messages (检查有无系统级错误信息)

# dmesg (检查硬件设备是否有错误信息)

# ifconfig(检查网卡设置是否正确)

# ping www.163.com (检查网络是否正常)

# cat /proc/cpuinfo (检查CPU频率是否正常)

# top (按1检测CPU核数是否正常,内存大小是否正常)

2、关闭不需要的服务

# ntsysv

以下仅列出需要启动的服务,未列出的服务一律推荐关闭:

atd

crond

irqbalance

microcode_ctl

network

sendmail

sshd

syslog

关闭SElinux:修改/etc/selinux/config文件中的SELINUX= 为 disabled

3、更换yum国内源

# cd /etc/yum.repos.d

# mv CentOS-Base.repo CentOS-Base.repo.save

# wget http://centos.ustc.edu.cn/CentOS-Base.repo.5

# mv CentOS-Base.repo.5 CentOS-Base.repo

# yum clean all

4、服务器时间检查和设置

#data (检查时间是否正确,是否是中国时间CST)

#cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime (如果时区不对,则执行,时间正常的跳过)

#yum -y install ntp (安装ntp对时工具)

#chkconfig ntpd on (让对时服务开机启动)

5、使用 yum 对系统进行更新并且安装必要软件包

#yum update –y

  1. #yum -y install make openssl openssl-devel pcre pcre-devel libpng libpng-devel libjpeg-6b libjpeg-devel-6b freetype freetype-devel gd gd-devel zlib zlib-devel gcc gcc-c++ libXpm libXpm-devel ncurses ncurses-devel libmcrypt libmcrypt-devel libxml2 libxml2-devel imake autoconf automake screen sysstat compat-libstdc++-33 curl curl-devel

复制代码

6. 重新启动系统

# init 6

三、编译安装L.A.M.P环境

1、下载软件(截止到09年10月的最新版本)

# cd /usr/local/data-original

#wget http://sysoev.ru/nginx/nginx-0.7.63.tar.gz

#wget http://download.scientificlinux.net/nginx

#wget http://download.scientificlinux.net/php-fpm.conf

#wget http://download.scientificlinux.net/nginx.conf

#wget http://download.scientificlinux.net/fcgi.conf

#wget http://download.scientificlinux.net/php-5.2.10.tar.gz

#wget http://download.scientificlinux.net/php-5.2.10-fpm-0.5.13.diff.gz

#wget http://download.scientificlinux. ... glibc23-i386.tar.gz (32位系统)

#wget http://download.scientificlinux. ... ibc23-x86_64.tar.gz (64位系统)

#wget http://download.scientificlinux. ... i686-glibc23.tar.gz (32位系统)

#wget http://download.scientificlinux. ... 6_64-glibc23.tar.gz (64位系统)

2、安装MySQL

cd /usr/local/data-original

tar zxvf mysql-5.1.39-linux-i686-glibc23.tar.gz

mv mysql-5.1.39-linux-i686-glibc23 /usr/local/

ln -s /usr/local/mysql-5.1.39-linux-i686-glibc23/ /usr/local/mysql

groupadd mysql

useradd -g mysql mysql

chown -R mysql:mysql /usr/local/mysql

chown -R mysql:mysql /usr/local/mysql-5.1.39-linux-i686-glibc23/

cd /usr/local/mysql

./scripts/mysql_install_db --user=mysql

cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld

chmod 755 /etc/rc.d/init.d/mysqld

chkconfig --add mysqld

chkconfig --level 3 mysqld on

cp ./support-files/my-huge.cnf /etc/my.cnf

mv /usr/local/mysql/data /var/lib/mysql

chown -R mysql:mysql /var/lib/mysql

编辑/etc/my.cnf

在 [mysqld] 段增加

  1. datadir = /var/lib/mysql
  2. skip-innodb
  3. wait-timeout = 10
  4. max_connections = 512
  5. max_connect_errors = 10000000

复制代码

在 [mysqld] 段修改

  1. max_allowed_packet = 16M
  2. thread_cache_size = CPU个数*2

复制代码

将 log-bin 注释

service mysqld start

bin/mysqladmin -u root password 'password_for_root'

其中引号内的password_for_root是要设置的root密码

3、安装Nginx

cd /usr/local/data-original/

tar zxvf nginx-0.7.63.tar.gz

cd nginx-0.7.63

./configure --prefix=/usr/local/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --with-http_realip_module --with-http_addition_module --with-http_gzip_static_module --with-http_random_index_module --with-http_stub_status_module --with-http_sub_module --with-http_dav_module

make

make install

cp /usr/local/data-original/nginx /etc/init.d/nginx

chmod 755 /etc/init.d/nginx

chkconfig --add nginx

chkconfig nginx on

4、安装PHP和Zend

cd /usr/local/data-original

tar zxvf php-5.2.10.tar.gz

gzip -cd php-5.2.10-fpm-0.5.13.diff.gz | patch -d php-5.2.10 -p1

cd php-5.2.10

./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/etc/cgi --enable-mbstring --enable-ftp --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --enable-magic-quotes --with-mysql=/usr/local/mysql --with-pear --enable-sockets --with-ttf --with-freetype-dir=/usr --enable-gd-native-ttf --with-zlib --enable-sysvsem --enable-sysvshm --with-libxml-dir=/usr --enable-force-cgi-redirect --enable-fastcgi --with-xmlrpc --enable-zip --enable-fpm

make

make install

mkdir -p /usr/local/etc/cgi/

cp php.ini-dist /usr/local/etc/cgi/php.ini

mv -f /usr/local/data-original/php-fpm.conf /usr/local/php5/etc/php-fpm.conf

groupadd www

useradd -g www www

echo 'ulimit -SHn 65535' >> /etc/rc.local

echo '/usr/local/php5/sbin/php-fpm start' >> /etc/rc.local

cd /usr/local/data-original

tar zxvf ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz

cd ZendOptimizer-3.3.3-linux-glibc23-i386

./install

(注意第一个要填的路径是Zend安装路径,第二个是php.ini所在的路径,即/usr/local/etc/cgi)

(不要选重启apache)

5、启动Nginx和php

mv -f /usr/local/data-original/fcgi.conf /usr/local/nginx/conf/

cp -f /usr/local/data-original/nginx.conf /usr/local/nginx/conf/nginx.conf

mkdir -p /home/www/wwwroot

ulimit -SHn 65535

/usr/local/php5/sbin/php-fpm start

service nginx start

在/home/www/wwwroot放入一个index.php,内容为

打开浏览器访问,即可看到phpinfo页面

6、设置系统防火墙

编辑/usr/local/sbin/fw.sh

复制以下内容进去

  1. #!/bin/bash
  2. # Stop iptables service first
  3. service iptables stop
  4. # Load FTP Kernel modules
  5. /sbin/modprobe ip_conntrack_ftp
  6. /sbin/modprobe ip_nat_ftp
  7. # Inital chains default policy
  8. /sbin/iptables -F -t filter
  9. /sbin/iptables -P INPUT DROP
  10. /sbin/iptables -P OUTPUT ACCEPT
  11. # Enable Native Network Transfer
  12. /sbin/iptables -A INPUT -i lo -j ACCEPT
  13. # Accept Established Connections
  14. /sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
  15. # ICMP Control
  16. /sbin/iptables -A INPUT -p icmp -m limit --limit 1/s --limit-burst 10 -j ACCEPT
  17. # WWW Service
  18. /sbin/iptables -A INPUT -p tcp --dport 80 -j ACCEPT
  19. # FTP Service
  20. /sbin/iptables -A INPUT -p tcp --dport 21 -j ACCEPT
  21. # SSH Service
  22. /sbin/iptables -A INPUT -p tcp --dport 22 -j ACCEPT

复制代码

退出编辑,执行以下命令

# chmod 755 /usr/local/sbin/fw.sh
# echo '/usr/local/sbin/fw.sh' >> /etc/rc.local
# /usr/local/sbin/fw.sh

大结局在这里,刷个BIOS就行了。http://www.151051.com/2010/03/modt%e5%b9%b3%e5%8f%b0%e6%8a%80%e5%98%89gm965t8300%e4%b9%8b%e7%bb%93%e5%b1%80%e7%af%87.html

-----------------------------------------------------

http://www.auctionking.jp/detail/b108137323.html

最新发现

从外观上看,和我这个板子一样,这点很重要,我是完全根据外观判断主板型号,因为我主板上写的GA-TGM965WJ在谷歌上是搜索不到的。最终判定该主板是MGM965M2R。

全新没用过的,才卖2000日元,换成人民的币只有150多块。唉~咋那么不值钱捏。

文中提到:“富士通(Giga-byteOEM)製、MGM965M2Rです”,根据其中的汉字理解为个FMV-K5250的一体机用的,技嘉给富士通出的OEM板子。

搜索了一下官网,对于不懂日文的人来说,谷歌这时候显得异常强大

http://www.fmworld.net/biz/fmv/product/hard/vdt0801/k5250/spec.html

然后一点点扣嗤,竟然发现了bios的下载

download.cgi?DRIVER_NUM=E1007993&COLOR=1" target="_blank">http://www.fmworld.net/cgi-bin/driversearch/drvdownload.cgi?DRIVER_NUM=E1007993&COLOR=1

然后。。。下载了拷贝回家,冒死试试,不成公则成人,咳咳,不成功则成仁。

回去试试再说,大不了再买个板子。。

原创链接:http://hjp.viviti.com/entries/class3/Google-Spider-Dessert

文章来源:爬网志

所谓谷歌蜘蛛甜点(Google Spider Dessert、GSD)是指用户检索量较大而Google实际收录量相对较少的关键词或词组。由于有大量的检索要求,而谷歌数据库中索引的相关网页又较少,因而搜索引擎蜘蛛机器人不得不大量的采集和收录相关的资源,有的时候甚至达到饥不择食的地步!本文将着重讲解如何获取GSD和GSD的使用技巧。

1、GSD的获取:如何找到谷歌蜘蛛甜点是整个技巧的关键所在!GSD怎么找呢呢?其实,GSD到处都是,比如:网络上参考资源较少的热门话题、汉字错别字、拼写错误的英文单词或网站域名等。可以利用一些专业的关键字工具来获取GSD,但是实际效果并不是很好,原因是绝大多数的关键字工具所给出的数据并不准确,有些甚至是误导,信息量也较少,其实最直接的办法是利用Google自带的关键词使用频度查询工具(谷歌搜索查询建议)来找GSD最方便。还是直接用实例来说明吧,不知道大家是否了解songtaste这个网站,是一个提供音乐试听及共享的网站,每天的访问量很大,其中有不少人是通过在Google中输入“songtaste”来访问该网站的,但是经常会有人将“songtaste”错输成“songtastes”,导致“songtastes”这个词出现在Google的相关查询建议框内,大家可以在Google搜索框中键入“songtaste”时在下方的下拉框中找到“songtastes”这个词,大家一定要注意其后面的结果数量,我现在看到的结果数只有7个,相对于其他的结果少多了,这个就是我们要找的甜点了。有了甜点,下面该说一说如何应用了,如下图:

[caption id="attachment_126" align="aligncenter" width="591"] GSD的获取[/caption] 

2、GSD的应用:接着用上面的例子说,首先要做一个以“songtastes”为标题的引诱网页,标题不要做的太长,随便一些就可以,网页的正文也要尽量简炼,随意的放两个关键词做做样子,如果懂一些seo就注意搞一下,不懂的也无所谓,反正甜点对于Google蜘蛛的诱惑力是极大的,只要发现即会被收录。当然,引诱页也可以用来发一些实质性的有意义的东西,比如一小段新闻事件就不错,由于被收录的快,因而更能抢得先机。这是本人做的引诱页:SongTastes 用音乐倾听彼此 。好了,引诱页做好后,我们该用它来引导读者发现自己网站上的优秀内容了。这里要强调一点:内容永远是第一位的,seo的最终目的就是要让来到你网站上的访客发现网站中好的内容,如果做不到这一点,前面的工作就等于是白费功夫!引导过程其实很简单,在你想要向访客展示的页面的一个不太重要的地方写上一段话,其中包含“songtastes”这个词就可以了,尽量不要破坏原网页内容的和谐,本人就把这段话加在留言当中,还需要注意的就是引诱页和实质内容页要有一定的相关性,关键要迎合读者的需求。这就是我要展示的有实质内容的网页:download">在songtaste下载完整歌曲的秘笈! ,下面就是坐等Google收录了,由于甜点很香,不到十分钟蜘蛛就来了。大家知道,Google如果在返回的搜索结果的所属网站中发现有相关的内容会一起展示出来,因此,带有实质内容的网页就这样同引诱页一起被展示出来了,实际的展示效果见这里:Google上搜索“songtastes” (本站的内容现在是被排在首页的第二位,大家知道查询结果是可能会随时变化的,由于本站是免费空间,速度较慢,而且是新站,权重很低,因此说不准哪天会被甩到后面去了)。

download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">

MP3下载地址:http://www.luluinwater.com/wp-content/uploads/2009/10/LauraShigihara-ZombiesOnYourLawn.mp3