Tumblelog by Soup.io
Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

December 01 2011

02:47

Linode Apache2 Passenger 优化

这几天发现VPS老是出现内存爆掉的状况,就仔细看了一下。

看到Passenger部分:

passenger-memory-stats
passenger-stats

发现passenger默认开了6个进程,修改为最大2个进程。

将PassengerMaxPoolSize 2 加入 apache的配置文件中。

Related posts:

  1. Phusion Passenger(mod_rails)
  2. Debian Linux PPTP VPN安装设置(Linode VPS)
  3. links for 2006-08-06
  4. links for 2006-07-11
  5. links for 2006-07-21


© David for 空想枫, 2011. | Permalink | No comment | Add to del.icio.us
Post tags: apache2, linode, passenger, vps


October 11 2011

12:48

Linode VPS Tokyo迁回

在Linode发布Tokyo 数据中心后,就将本服务器的VPS签到了日本。
国内部分链路访问速度快了很多,但是还是有不少链路发现速度很慢,或者像杭州华数一样,完全无法访问。

因此,今天将Linode迁回Fremont 。访问虽然慢一点,但是最起码比日本的线路稳定一点。

Related posts:

  1. Debian Linux PPTP VPN安装设置(Linode VPS)
  2. Lighttpd WordPress Rewrite(Linode Debian VPS)
  3. Lighttpd 压缩及过期设置(Linode Debian VPS)


© David for 空想枫, 2011. | Permalink | No comment | Add to del.icio.us
Post tags: fremont, linode, tokyo, vps


May 30 2010

02:29

Lighttpd 压缩及过期设置(Linode Debian VPS)

我在Linode Debian VPS上使用的compress和expire设置。

1.Lighttpd的compress设置

实现对网站相关元素在网站传输前的压缩,节约传输流量,并加快用户的访问速度。

compress.cache-dir = "/home/lighttpd/compress/"
compress.filetype= ("text/plain", "text/html", "application/x-javascript","application/javascript","text/css","text/javascript","image/gif", "image/png","image/jpg","image/jpeg")

2.Lighttpd的expire设置

实现对网站不常变化相关元素的客户端浏览器缓存(我设置的是两个月),减少每次和网站之间的传输流量,提高用户的访问速度。

$HTTP["url"] =~ "\.(gif|png|jpg|ico|css|js)(\?(.*))?$" {
   expire.url = ( "" => "access 2 months" )
   }

Related posts:

  1. Lighttpd WordPress Rewrite(Linode Debian VPS)
  2. Debian Linux PPTP VPN安装设置(Linode VPS)
  3. Debian lenny(5.0) apt sources.list
  4. 试用Lighttpd
  5. 优化网站的载入速度


© David for 空想枫, 2010. | Permalink | No comment | Add to del.icio.us
Post tags: compress, debian, expire, lighttpd, linode, vps


02:17

Lighttpd WordPress Rewrite(Linode Debian VPS)

在配置Linode Debian VPS中使用到的WordPress网页地址重写规则。

1.lighttpd的wordpress mu的子域名方式地址重写

$HTTP["host"] =~ "it580\.com" {
    simple-vhost.default-host = "it580.com"
    server.error-handler-404 = "/index.php"
    url.rewrite-once = (
         "^/(.*/)?files/$" => "/index.php",
         "^/(.*/)?files/(.*)" => "/wp-content/blogs.php?file=$2",
         "^(/wp-admin/.*)" => "$1",
         "^/([_0-9a-zA-Z-]+/)?(wp-.*)" => "/$2",
         "^/([_0-9a-zA-Z-]+/)?(.*\.php)$" => "/$2",
         )

     }

2.lighttpd的wordpress的地址重写

$HTTP["host"] == "cindywm.com" {
       server.name = "cindywm.com"
       url.rewrite-final = (
            "^/(wp-admin|wp-includes|wp-content|gallery2)/(.*)" => "$0", 
            "^/(.*.php)" => "$0",
            "^/(.*)$" => "/index.php/$1"
            )
         }

Related posts:

  1. Debian Linux PPTP VPN安装设置(Linode VPS)
  2. WordPress 2.6 Beta 1发布
  3. wordpress在nginx下的rewrite设置
  4. 站点新闻
  5. Wordpress 2.6(Tyner) 发布


© David for 空想枫, 2010. | Permalink | No comment | Add to del.icio.us
Post tags: lighttpd, linode, rewrite, vps


May 13 2010

14:32

Debian Linux PPTP VPN安装设置(Linode VPS)

最近买了Linode的VPS,自然不能浪费。除了用来放网站,也顺便用来做VPN Server。


1.安装PPTP VPN

apt-get update
apt-get upgrade
apt-get install pptpd

2.配置PPTP VPN

使用你喜欢的编辑器,编辑/etc/pptpd.conf 。修改localip,remoteip的ip地址段,例如修改为:

localip 10.10.10.1
remoteip 10.10.10.100-200

编辑/etc/ppp/pptpd-options,修改ms-dns 的dns地址,例如可以修改为:

ms-dns 208.67.222.222
ms-dns 208.67.220.220

编辑/etc/ppp/chap-secrets,设置用户名密码,格式如下:

user1 pptpd password1 *
user2 pptpd password2 10.10.10.102

格式一为不限定分配ip地址,格式二为限定分配ip地址。

编辑/etc/sysctl.conf,修改#net.ipv4.ip_forward=1为net.ipv4.ip_forward=1。执行如下命令:

sysctl -p

3.iptables防火墙设置

iptables -A INPUT -p gre -j ACCEPT
iptables -A OUTPUT -p gre -j ACCEPT
iptables -A INPUT -p tcp –sport 1723 -j ACCEPT
iptables -A OUTPUT -p tcp –dport 1723 -j ACCEPT
iptables -t nat -A POSTROUTING -s 10.10.10.0/24 -o eth0 -j MASQUERADE

Debian默认防火墙是全通的,因此前四行可以选择不执行。建议将第五行加入到/etc/rc.local。

4.Linode 设置

由于Linode VPS下没有ppp设备,需要执行如下命令:

mknod /dev/ppp c 108 0

5.启动PPTP 服务

执行如下命令,启动PPTP服务:

/etc/init.d/pptpd restart


Older posts are this way If this message doesn't go away, click anywhere on the page to continue loading posts.
Could not load more posts
Maybe Soup is currently being updated? I'll try again automatically in a few seconds...
Just a second, loading more posts...
You've reached the end.