使えるねっとのVPSでMaxClientsの値を上げる
10 / 10 / 2009

server reached MaxClients setting, consider raising the MaxClients setting

なんでエラーが出ちゃって大変な事になったので。

SSHでログイン後

$ vi /etc/httpd/conf.d/swtune.conf

を開く。普通は

/etc/httpd/conf/httpd.conf

とかなんだけれども使えるねっとは特殊らしい。初期設定は

StartServers       1
MinSpareServers    1
MaxSpareServers    5
ServerLimit       10
MaxClients        10
MaxRequestsPerChild  4000

こんな感じ。10って明らかに少ないよね…んでもって

StartServers       2
MinSpareServers    2
MaxSpareServers    5
ServerLimit       64
MaxClients        64
MaxRequestsPerChild  4000

こんな感じに変えました。VPSのシルバープランだとMaxClientsは64が限界です。

メモリ使用量は50MBくらい増えました。まぁ大丈夫だろう。

使えるねっとのVPSにAPCをインストール
5 / 19 / 2009

yumがインストールされている。そして、

# pecl install APC

を使ってインストールしたい。

# yum install php-pear
# yum -y install php-devel
# yum -y install automake

インストールしてみると、

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 92160 bytes) in /usr/share/pear/PEAR/PackageFile/v2/Validator.php on line 1831

メモリた足りないと言われたので、/usr/share/pear/pearcmd.phpに@ini_set(‘memory_limit’, ‘16M’); と書く。

configure: error: no acceptable C compiler found in $PATH

今度はCコンパイラが無いと言われる

# yum install gcc gcc-c++

三度目の正直。

Sorry, I was not able to successfully run APXS.  Possible reasons:

1.  Perl is not installed;
2.  Apache was not compiled with DSO support (–enable-module=so);
3.  ‘apxs’ is not in your path.  Try to use –with-apxs=/path/to/apxs
The output of /var/tmp/pear-build-root/APC-3.0.19/?yes follows
/tmp/tmpXvVSb8/APC-3.0.19/configure: line 3232: /var/tmp/pear-build-root/APC-3.0.19/?yes: No such file or directory
configure: error: Aborting
ERROR: `/tmp/tmpXvVSb8/APC-3.0.19/configure –with-apxs=?yes’ failed

んーよくわからない。

# yum -y install httpd-devel
# yum install apr-devel

今度こそ。

Build process completed successfully
Installing ‘/var/tmp/pear-build-root/install-APC-3.0.19//usr/lib64/php/modules/apc.so’
install ok: channel://pecl.php.net/APC-3.0.19
You should add “extension=apc.so” to php.ini

出来た!php.iniにextension=apc.soを追加する。

#  /etc/init.d/httpd restart

Apacheを再起動して、phpinfo()で確認。

無事動いた!

参考にしたサイト:
http://d.hatena.ne.jp/ir9Ex/20081019/1224366629
http://labs.uechoco.com/blog/2008/04/phppecl.html
http://yosiwo.lowtech.ne.jp/item/375
http://plaza.rakuten.co.jp/chibimatsuzaki/diary/200812260000/

使えるねっとで/httpdocs/内のcgiを動かす
2 / 16 / 2009

Pleskサーバーにcgiを設置するには/cgi-bin/の中に設置しなくてはいけない。
というわけではなく、意外と簡単に/httpdocs/内でもcgiを動かす事が出来る。

/httpdocs/内の.htaccessに

Options +ExecCGI
AddHandler cgi-script .cgi
AddHandler cgi-script .pl

と書くだけ。


使えるねっとのVPSプランにSubversionをインストール
1 / 19 / 2009

まずyumとやらをインストールする

[ ~]# cd /usr/local/src
[ src]# mkdir yumrpm
[ src]# cd yumrpm
[ yumrpm]# wget http://ftp.riken.jp/Linux/centos/5.2/os/x86_64/CentOS/yum-3.2.8-9.el5.centos.1.noarch.rpm
[ yumrpm]# wget http://ftp.riken.jp/Linux/centos/5.2/os/x86_64/CentOS/yum-metadata-parser-1.1.2-2.el5.x86_64.rpm
[ yumrpm]# wget http://ftp.riken.jp/Linux/centos/5.2/os/x86_64/CentOS/python-elementtree-1.2.6-5.x86_64.rpm
[ yumrpm]# wget http://ftp.riken.jp/Linux/centos/5.2/os/x86_64/CentOS/python-urlgrabber-3.1.0-2.noarch.rpm
[ yumrpm]# wget http://ftp.riken.jp/Linux/centos/5.2/os/x86_64/CentOS/python-sqlite-1.1.7-1.2.1.x86_64.rpm
[ yumrpm]# wget http://ftp.riken.jp/Linux/centos/5.2/os/x86_64/CentOS/m2crypto-0.16-6.el5.2.x86_64.rpm
[ yumrpm]# wget http://ftp.riken.jp/Linux/centos/5.2/os/x86_64/CentOS/rpm-python-4.4.2-48.el5.x86_64.rpm
[ yumrpm]# wget http://ftp.riken.jp/Linux/centos/5.2/os/x86_64/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm
[ yumrpm]# rpm -ihv *
[ yumrpm]# yum -y install yum-fastestmirror
[ yumrpm]# yum -y update

次にSubversion関連のパッケージをインストールする

# yum -y install mod_dav_svn

# mkdir svn
# cd svn
# svnadmin create プロジェクト名
# cd プロジェクト名
# svn mkdir trunk tags branches -m ‘Create trunk, tags, and branches.’svn: Local, non-commit operations do not take a log message
# svn mkdir file:///var/www/vhosts/onesty.tsukaeru.info/httpdocs/svn/relax-job/trunk file:///var/www/vhosts/onesty.tsukaeru.info/httpdocs/svn/relax-job/tags file:///var/www/vhosts/onesty.tsukaeru.info/httpdocs/svn/relax-job/branches -m ‘Create trunk, tags, and branches.’
Committed revision 1.

Apacheにアクセス権を通す

# chown -R apache:apache /var/www/vhosts/onesty.tsukaeru.info/httpdocs/svn
# chown -R apache:apache /var/www/vhosts/onesty.tsukaeru.info/httpdocs/svn/relax-job

subversion.confを書き換える

#  vi /etc/httpd/conf.d/subversion.conf

<Location /svn>
DAV svn
SVNParentPath /var/svn
</Location>

リスタートする

# service httpd restart

3日くらい前にやったので半分忘れました..

You

are currently browsing the notizbloc blog archives for the tag 使えるねっと