桜ヶ丘日記

技術メモとかとか

さくらVPS借りてみた。

プランは1G
OSはデフォルトのCentOS

# uname -a
Linux www19312ue.sakura.ne.jp 2.6.32-279.1.1.el6.x86_64 #1 SMP Tue Jul 10 13:47:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
# ls -a
.  ..  .bash_logout  .bash_profile  .bashrc  .cshrc  .tcshrc
# cat /etc/redhat-release
CentOS release 6.4 (Final)

ふむ。

# echo "bash --version" >> ~/.bashrc
# cat >> ~/.bash_profile
export LANG=ja_JP.UTF-8
export LC_ALL=en_US.UTF-8
^D
# . .bash_profile
GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

よし。

# wget localhost
うんたらかんたら
Connecting to localhost|127.0.0.1|:80... failed: Connection refused.

あれ。

# ls /etc/init.d/
abrt-ccpp  crond       kdump         netfs      rdisc        smartd
abrtd      functions   killall       network    restorecond  sshd
abrt-oops  haldaemon   lvm2-lvmetad  ntpd       rngd         svnserve
acpid      halt        lvm2-monitor  ntpdate    rsyslog      sysstat
atd        ip6tables   mdmonitor     postfix    sandbox      udev-post
auditd     iptables    messagebus    psacct     saslauthd    yum-updateonboot
cpuspeed   irqbalance  netconsole    quota_nld  single

無いんだぁ。

# yum -y install httpd
うんたらかんたら
Complete!

ふむ

# wget -O - localhost
うんたらかんたら
Connecting to localhost|127.0.0.1|:80... failed: Connection refused.

ああそうかCentてインストールしても自動で起動しないんだ。
Debianとかだとインストールすれば勝手に上がる)

# service httpd start
Starting httpd:                                            [  OK  ]
# rpm -qa httpd
httpd-2.2.15-15.el6.centos.1.x86_64

ほう

# wget -O - localhost
うんたらかんたら
ERROR 403: Forbidden.

ああ。index.htmlないんだ?

# grep ^DocumentRoot /etc/httpd/conf/httpd.conf
DocumentRoot "/var/www/html"
# echo 'it works!' > /var/www/html/index.html
# wget -O - localhost
うんたらかんたら
 0% [                                       ] 0           --.-K/s              it works!
100%[======================================>] 10          --.-K/s   in 0s

よしよし。

とりあえずまた触る。