注册 | 登陆
浏览模式: 标准 | 列表2011年09月的文章

[置顶] linux下几个lnmp一键安装包

wdlinux

安装方法:
一 RPM包安装(超简单超快速,强烈建议新手用此方式安装)
wget http://www.xreacn.com/linux/cp/wdlinux/rpm_install

sh rpm_install
然后按提示选择安装lamp or lnmp
即开始安装,5分钟左右

二 源码安装
wget http://www.xreacn.com/linux/cp/wdlinux/lanmp.tar.gz
tar zxvf lanmp.tar.gz
sh lanmp.sh

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

imcat

tar zxvf lnmp1.5.tar.gz
 

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

lnmp

wget -c http://www.xreacn.com/linux/cp/lnmp0.7-full.tar.gz 

或者 wget -c http://soft.vpser.net/lnmp/lnmp0.7-full.tar.gz

安装办法 http://www.xreacn.com/linux/cp/lnmp/

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

LLsMP

Centos:
wget http://llsmp.googlecode.com/files/llsmp0.6beta.tar.gz;tar zxvf llsmp0.6beta.tar.gz;cd centos;sh install.sh

Debian
wget http://llsmp.googlecode.com/files/llsmp0.6beta.tar.gz;tar zxvf llsmp0.6beta.tar.gz;cd debian;sh install.sh

安装 http://llsmp.org/

帮助文件 http://38.73.83.45/ 或者 http://www.xreacn.com/linux/cp/llsmp/index.html

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

Bootstraping Low End VPS with Pre-built Scripts

# wget -q http://www.lowendbox.com/scripts/lowend-debian.sh 

或者wget -q http://www.xreacn.com/linux/scripts/lowend-debian.sh

帮助 http://www.lowendbox.com/blog/bootstraping-low-end-vps-with-pre-built-scripts/

http://www.lowendbox.com/blog/yes-you-can-run-18-static-sites-on-a-64mb-link-1-vps/

http://www.lowendbox.com/blog/wordpress-cheap-vps-lowendscript/
# bash ./lowend-debian.sh

超省资源的debian桌面环境

ssh管理debian好处很多,但还是有各种不得已的原因,需要debian的桌面环境,并不需要多华丽,只是需要一个简单的图形界面。

我在网上找到一个桌面环境,非常省资源,内存占用很小,和大家分享下。

apt-get update
apt-get -q -y --force-yes install jwm vnc4server xterm
vncserver

这个时候会提示你输入密码。输入后,就启动了桌面了。

然后用vncview软件,输入你的vps ip,端口是5901。

比如你的ip是1.1.1.1,打开vncview之后,输入1.1.1.1:5901

然后输入密码,就可以进入一个简单的,只有终端控制器的桌面了。

vncview是RealVNC提供的远程桌面软件,相信一般用windows vps的一般都有的,不知道的,请搜索下载RealVNC。

如果你还想装一个浏览器,很遗憾,debian软件库没有firefox,不过有一个替代的——iceweasel,大部分firefox的插件,这个都能用,还是不错的。

apt-get install iceweasel

在桌面的终端控制器里面输入:

iceweasel &

就可以打开浏览器啦。

如果不打开浏览器,在buyvm 128m的vps下,还在跑nginx,内存只用了18m左右。

在vps 输入 :

vncconfig -nowin &

即可激活粘贴板,可以在vnc桌面环境下,vps和本机自由粘贴复制。

转自:挨个搞

debian下安装opera浏览器

debian安装了桌面,官方软件库包含了iceweasel,这个是firefox内核的,不过内存占用有点大。换了chrome,这个内存占用更猛,最后试了opera,相对来说还好点。桌面运行opera的时候内存占用200多m,buyvm 年付15刀的vps也能应付了。

这里记录下opera的安装过程。很简单:

cat >>/etc/apt/sources.list<<END
deb http://deb.opera.com/opera/ stable non-free #Opera Browser (final releases)
END
wget -O - http://deb.opera.com/archive.key | apt-key add -
apt-get update
apt-get -y --force-yes install opera

然后在桌面运行:
opera &

就可以启动opera。

转自:挨个搞

修改SSH和禁止root

 一、修改SSH端口

vi /etc/ssh/sshd_config

 找到其中的#Port 22(第13行),去掉#,修改成Port 3333

 使用如下命令,重启SSH服务,注:以后用新端口登陆。

service sshd restart

 二、禁止ROOT登陆

 先添加一个新帐号xreacn,可以自定义:

useradd xreacn

 给xreacn帐号设置密码:

passwd xreacn

 仍旧是修改/etc/ssh/sshd_config文件,第39行:#PermitRootLogin yes,去掉前面的#,并把yes改成no,然后,重启SSH服务。以后,先使用xreacn登陆,再su root即可得到ROOT管理权限。

login as: xreacn
xreacn@ip password:*****
Last login: Tue Nov 22 14:39:58 2010 from 1.2.3.4
su root
Password:*********** #注这里输入ROOT的密码

Linux VPS上配置Nginx反向代理

Nginx是一款高性能的HTTP和反向代理服务器。VPS侦探以前已经多次介绍过Nginx的HTTP应用,比如lnmp一键安装包。下面要说的是Nginx的反向代理功能。

反向代理是什么?

反向代理指以代理服务器来接受Internet上的连接请求,然后将请求转发给内部(或其他)网络上的服务器,并将从服务器上得到的结果返回给Internet上请求连接的客户端。

实现方法:

比如我想在VPS上建一个t.vpser.net的域名用来反向代理访问twitter,首先在域名注册商那里的域名管理上为域名t.vpser.net添加A记录到VPS的IP上,再在VPS上修改Nginx的配置文件,添加如下:

server
 {
     listen          80;
     server_name     t.vpser.net;

     location / {
         proxy_pass              http://twitter.com/;
         proxy_redirect          off;
         proxy_set_header        X-Real-IP       $remote_addr;
         proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
         }
 }
添加好后,先执行:/usr/local/nginx/sbin/nginx -t 检查配置是否正常,如果显示:the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok      configuration file /usr/local/nginx/conf/nginx.conf test is successful 则正常,否则按错误提示修改配置。

再执行 kill -HUP `cat /usr/local/nginx/logs/nginx.pid` 使配置生效,域名解析生效后就可以通过t.vpser.net 访问twitter了。

>>转载请注明出处:VPS侦探 本文链接地址:http://www.vpser.net/manage/linux-vps-nginx-reverse-proxy.html

Nginx用作反向代理服务器

  Nginx ("engine x") 是一个高性能的 HTTP 和反向代理服务器,也是一个 IMAP/POP3/SMTP 代理服务器。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的,它已经在该站点运行超过三年了。Igor 将源代码以类BSD许可证的形式发布。Nginx 超越 Apache 的高性能和稳定性,使得国内使用 Nginx 作为 Web 服务器的网站也越来越多,大部分门户网站都把它作为首选WEB前端。

      下面讲讲如何利用Nginx的反向代理功能做一台反向代理服务器。

      一、安装步骤:

           (系统要求:Linux 2.6+ 内核,本文中的Linux操作系统为RedHat AS4为例)

         1、获取相关源程序

             wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.01.tar.gz

             wget http://sysoev.ru/nginx/nginx-0.8.36.tar.gz

         2、创建相关目录和用户

             /usr/sbin/groupadd apache
            /usr/sbin/useradd -g apache apache

            /usr/sbin/usermod -s /sbin/nologin apache

            chage -I -1 -M 99999 apache

            mkdir -p /data/mp3 
            chmod +w /data/mp3

            chown -R apache:apache /data/mp3

         3、安装Nginx所需的pcre库

            tar zxvf pcre-8.01.tar.gz
     cd pcre-8.01/
    ./configure
            make && make install
            cd ../

         4、安装Nginx

           tar zxvf nginx-0.8.36.tar.gz
    cd nginx-0.8.36/
    ./configure --user=apache --group=apache --prefix=/usr/local/nginx --with-http_stub_status_module
    make && make install
    cd ../

         5、创建Nginx配置文件

            rm -f /usr/local/nginx/conf/nginx.conf
            vi /usr/local/nginx/conf/nginx.conf 

            输入以下内容:

           user  apache apache;
           worker_processes  8;

           error_log  /dev/null  crit;
           pid logs/nginx.pid;

           events {
                        use epoll;
                        worker_connections  512000;
                     }

           http {
                   include       mime.types;
                   default_type  application/octet-stream;

                   log_format  main  '$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_mp3.log  main;

                   sendfile       on;
                   tcp_nopush     on;
                   tcp_nodelay    on;

                   keepalive_timeout  650;
                   server {
                             listen       80;
                             server_name  xxx.xxx.xxx;   #前端域名或IP
                             location ~ .*\.(mp3|mid|amr)$
                            {
                                  expires 15d;
                                  root /data/mp3;
                                  proxy_store on;
                                  proxy_store_access user:rw group:rw all:rw;
                                  proxy_temp_path /data/mp3;
                                  proxy_redirect          off;
                                  proxy_set_header        Host xxx.xxx.xxx ; #访问域名或ip
                                  proxy_set_header        X-Real-IP $remote_addr;
                                  proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
                                  client_max_body_size    10m;
                                  client_body_buffer_size 1280k;
                                  proxy_connect_timeout   900;
                                  proxy_send_timeout      900;
                                  proxy_read_timeout      900;
                                  proxy_buffer_size       40k;
                                  proxy_buffers           40 320k;
                                  proxy_busy_buffers_size 640k;
                                  proxy_temp_file_write_size 640k;
                                  if ( !-e $request_filename)
                                 {
                                         proxy_pass  http://xxx.xxx.xxx.xx/; #后端服务器ip地址
                                 }
                            }
                       }
                  }
        6、启动Nginx

            ulimit -SHn 51200

            /usr/local/nginx/sbin/nginx -t    #测试配置脚本是否正确

           /usr/local/nginx/sbin/nginx


      二、优化Linux内核参数

          vi /etc/sysctl.conf

          在末尾增加以下内容:  

    # Add
    net.ipv4.tcp_max_syn_backlog = 65536
    net.core.netdev_max_backlog =  32768
    net.core.somaxconn = 32768

    net.core.wmem_default = 8388608
    net.core.rmem_default = 8388608
    net.core.rmem_max = 16777216
    net.core.wmem_max = 16777216

    net.ipv4.tcp_timestamps = 0
    net.ipv4.tcp_synack_retries = 2
    net.ipv4.tcp_syn_retries = 2

    net.ipv4.tcp_tw_recycle = 1
    net.ipv4.tcp_tw_reuse = 1

    net.ipv4.tcp_mem = 94500000 915000000 927000000
    net.ipv4.tcp_max_orphans = 3276800

    net.ipv4.ip_local_port_range = 1024  65535
    net.ipv4.ip_conntrack_max = 6553600
    net.ipv4.netfilter.ip_conntrack_tcp_timeout_established = 180
    net.ipv4.tcp_window_scaling = 1

      

           使配置立即生效:

 

           /sbin/sysctl -p

 

      三、配置开机自动启动Nginx

          vi /etc/rc.local

          在末尾增加以下内容:

          ulimit -SHn 51200
          /usr/local/nginx/sbin/nginx

      

      另外根据需要还需设置IP地址、开放访问端口、以及访问日志的定时切割等。(全文完)     

 

贴几个日本的VPS

DH 9.24$ coupon

Save over $110 on web hosting and receive unlimited disk space and bandwidth!
Sign up today for a risk-free trial of a one-year hosting plan using the promotional code "777bday11" and you'll get an entire year of web hosting (including a domain registration) for just $9.24! That's 92% off our normal pricing!

注册地址 www.dreamhost.com

图片附件(缩略图):
大小: 111.73 K
尺寸: 500 x 322
浏览: 0 次
点击打开新窗口浏览全图

Records:501234567