投稿

ラベル(ubuntu)が付いた投稿を表示しています

symfony on ubuntu

php を見せられるようにするにはここで一発。 http://dqn.sakusakutto.jp/2008/08/ubuntuphp5.html % sudo aptitude install apache2 libapache2-mod-php5 みたいな感じ。 % sudo vim /var/www/testphp.php <?php phpinfo(); ?> vagrant でやるなら下記の二行を追加しておくと 192.168.33.10/testphp.php でアクセスできる。 config.vm.network "forwarded_port", guest: 80, host: 8080 config.vm.network "private_network", ip: "192.168.33.10"

ansible による pyramid 環境構築

ansible を使ってみたいということで。 Chef とかといったような構成管理ツールです。Python 製ですが Python の知識はいらず、yaml 形式のシンプルにかけるものです。 チュートリアル http://yteraoka.github.io/ansible-tutorial/ を上から自分の環境に合わせて実行してみました。Ubuntu なので yum でなく apt モジュールになります。 インストールされている前提。pip からインストールできたはずです。 疎通確認 ansible で接続するには、host 名が書かれた hosts ファイルが必要です。 カレントディレクトリを優先して読んでくれるので、そこに作成。 .ssh/config に設定してある Host も使用可能。 echo hostname > hosts 下記のコマンドで、今作った hosts ファイルを指定してちゃんと相手に接続できるか確認します。 % ansible -i hosts hostname -m ping devops | success >> { "changed": false, "ping": "pong" } 接続成功。 コマンドを実行してみる。 ansible -i hosts hostname -a 'uname -r' devops | success | rc=0 >> 3.2.0-29-generic できた。 試しに vim を install してみます。 % ansible -i hosts devops -m apt -s -a name=vim devops | success >> { "changed": false } install 済みなので失敗。 Playbook playbook を書いてみます。言語に依存しないシンプルなファイルらしい。 まずインベントリファイルでグループを定義。 % cat hosts [pyramid] hostname playbook の作成。 --- - hosts:...

vagrant tutorial

今流行り?の Vagrant の公式サイト から。 いろいろ説明が抜けているところもありますが、サクッとチュートリアル。 環境 Mac OS X 10.8.5 Virtual Box 4.2.18 Vagrant 1.3.3 index ・uninstall ・virtual box で Ubuntu12.04 LTS 32-bit が動き出す ・vagrant で起動したマシンへ ssh ・VM を止める ・Vagrantfile の作成 ・Vagrantfile へ、add box ・add box した box を使用できるよう名前変更 ・host と guest の共有ディレクトリ ・shell の実行 ・suspending uninstall rm /Applications/Vagrant rm /usr/bin/vagrant rm ~/.vagrant.d virtual box で Ubuntu12.04 LTS 32-bit が動き出す 初期化と、sample の Ubuntu をダウンロードするところから。 % vagrant init precise32 http://files.vagrantup.com/precise32.box A `Vagrantfile` has been placed in this directory. You are now ready to `vagrant up` your first virtual environment! Please read the comments in the Vagrantfile as well as documentation on `vagrantup.com` for more information on using Vagrant. そしてダウンロードしてきた Ubuntu を起動する。 % vagrant up Bringing machine 'default' up with 'virtualbox' provider... [default] Box 'precise32' was not found. Fetching box fr...

Ubuntu 12.04 for python 3

Ubuntu 12.04 で Python3.2 使いたいと思ったけれど、Ubuntu で Python 3.2 を探してもソースコードからコンパイルしか無い……って悩んでいたが、普通にありました。 sudo apt-get install python3 でインストールできます。 % python3.2 Python 3.2.3 (default, May 3 2012, 15:51:42) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> 参考 http://askubuntu.com/questions/134747/how-do-i-run-python-3-2-3

マルチブート

Ubuntu と Windows 7 のマルチブートしてたんだけど、親も使うということなので Windows 7 のみにしようとして行った作業。 MiniTool Partition Wizard Home Edition を使って Ubuntu のパーティションを削除して、はいさようなら。 というわけには行きませんでした。 再起動すると、 grub rescue > なんてものが。 なんだろう、と思ってとりあえず Google さんにお尋ね。 ここを参考にすると、 <http://blog.livedoor.jp/braahmana/archives/1590075.html> するとどうやら、boot loader を Ubuntu の grub が乗っ取ってるっぽい。 一応、 grub rescue > ls で見たあと、 grub rescue > (root partition)/boot/grub とかで選べるっぽいが、Ubuntu のパーティション限定。 自分は Ubuntu のパーティション消したから手遅れ。 なので別の手はないかな、と調べてみたら、 <http://anond.hatelabo.jp/20091031011858> に行き着いた。なるほど。 という訳で、 言われたとおりに ・Windows 7 のインストールディスク投入 ・言語、時間、キーボード ・左下の修復ツール ・完了を押す ・「コマンドプロンプト」を選択 そして開いたコマンドプロンプトに、 bootsect /nt60 ALL /mbr といれると成功。