2012年5月31日木曜日

WEBサーバの利用

1.public_htmlへ移動
# cd public_html
2.index.htmlを作成
# vi index.html

<html>
<head>
<link rel="stylesheet" href="base.css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>テスト</title>
<body>
テスト
</body>
</html>
3.base.cssを作成
body {
 font: normal normal 14px Arial, Tahoma, Helvetica, FreeSans, sans-serif;
 color: #000000;
 background: #aabbaa none no-repeat scroll center center;
 font-family:'ヒラギノ角ゴ Pro W3','Hiragino Kaku Gothic Pro','メイリオ',Meiryo,'MS Pゴシック',sans-serif;
}

html body .region-inner {
 min-width: 0;
 max-width: 100%;
 width: auto;
}

.content-outer {
 font-size: 90%;
}

a:link {
 text-decoration:none;
 color: #445566;
}
a:visited {
 text-decoration:none;
 color: #000000;
}
a:hover {
 text-decoration:underline;
 color: #1455ff;
}
4.phpinfo.phpを作成
# vi phpinfo.php

<?php
  phpinfo();
?>

#chmod 755 phpinfo.php
4.Hello, World!
# vi hello.php

<?php
echo "Hello World!";
?>

# chmod 755 hello.php
5.文字列表示・結合
# vi test.php

<?php
$str1 = "Hello";
$str2 = "World";

print<<<EOF
<html>
<head>
<link rel="stylesheet" href="base.css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>テスト2</title>
<body>
テスト2
<br>
EOF;

echo $str1.",".$str2;

print<<<EOF
</body>
</html>
EOF;
?>

# chmod 755 test.php
6.外部APIの利用(twitter)
# vi twitter.php

<?php
 $word = "横浜";
 $url = "http://search.twitter.com/search.rss?q=".$word;

 $rss = simplexml_load_file($url);

 $title = $rss->channel->item->title;
 $link = $rss->channel->item->link;
 $description = $rss->channel->item->description;
 $pubDate = $rss->channel->item->pubDate;
 $author = $rss->channel->item->author;

print<<<EOF
 <html>
 <head>
 <link rel="stylesheet" href="base.css" />
 <title>twitter sample</title>
 </head>
 <body>
EOF;

 print "title : ".$title."<br />";
 print "link : ".$link."<br />";
 print "description : ".$description."<br />";
 print "pubDate : ".$pubDate."<br />";
 print "author : ".$author."<br />";
 print "image_link : ".$iage_link."<br />";

print<<<EOF
 </body>
 </html>
EOF;
?>

#chmod 755 twitter.php

2012年5月11日金曜日

Flash課題完成イメージ

上下左右キーで操作できるキャラクタがマップ上を移動するFlashを作成する.


20120511.swf

ダウンロード

※ステージのサイズは320x240です.characterのサイズは,64x64を48x48に縮小して表示しています.



mc_character.swf

ダウンロード

2012年5月10日木曜日

授業用仮想環境の構築

以下の記事を参考に,授業用の仮想環境を構築

仮想環境構築手順(サーバ編)
http://mgrsato.blogspot.jp/2011/11/blog-post_8056.html

仮想環境構築手順(クライアント編)
http://mgrsato.blogspot.jp/2011/11/blog-post_2844.html

[SA-3-2] サーバーへのユーザー追加
http://mgrsato.blogspot.jp/2010/09/sa-23.html

初期設定~WEBサーバ構築
http://mgrsato.blogspot.jp/2011/12/web.html

[SA-3-10] httpd設定
http://mgrsato.blogspot.jp/2010/10/sa-3-httpd.html