{"id":542,"date":"2009-02-03T16:59:00","date_gmt":"2009-02-03T07:59:00","guid":{"rendered":"http:\/\/ur.edu-connect.net\/archives\/542"},"modified":"2024-02-04T00:28:21","modified_gmt":"2024-02-03T15:28:21","slug":"ubuntu%ef%bc%8blamp%ef%bc%88%e5%90%8d%e5%89%8d%e3%83%99%e3%83%bc%e3%82%b9%e3%83%90%e3%83%bc%e3%83%81%e3%83%a3%e3%83%ab%e3%83%9b%e3%82%b9%e3%83%88%ef%bc%89%e3%81%ae%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88","status":"publish","type":"post","link":"https:\/\/ur.edu-connect.net\/archives\/542","title":{"rendered":"Ubuntu\uff0bLAMP\uff08\u540d\u524d\u30d9\u30fc\u30b9\u30d0\u30fc\u30c1\u30e3\u30eb\u30db\u30b9\u30c8\uff09\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},"content":{"rendered":"\n
Ubuntu\u306eLAMP\u74b0\u5883\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30e1\u30e2<\/span><\/p>\n\n\n\n \u4ee5\u4e0b\u306f\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u7248Ubuntu\uff08Hardy Heron 8.04LTS\uff09\u306e\u8a71\u3067\u3059\uff0e<\/p>\n\n\n\n Ubuntu\u672c\u4f53\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\uff0c\u6700\u65b0\u7248\u306eUbuntu\u3092DL\u3057\u3066\uff0c \u8d77\u52d5\u3057\u305f\u3089\uff0c\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u30de\u30cd\u30fc\u30b8\u30e3\u3092\u8d77\u52d5\u3057\u3066\uff0c LAMP\u74b0\u5883\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/span>\uff08\u3044\u307e\u3055\u3089\u66f8\u304f\u307b\u3069\u306e\u3053\u3068\u3082\u306a\u3044\u3051\u308c\u3069\u3082\u30fb\u30fb\u30fb\uff09<\/p>\n\n\n\n Apache2.2\u306e\u8a2d\u5b9a<\/span>\uff08\u4ee5\u4e0b\u306f\u597d\u307f\u306b\u3088\u3063\u3066\u3044\u308d\u3044\u308d\u30fb\u30fb\u30fb\uff09 DirectoryIndex\u7b49\u306e\u8a2d\u5b9a\u306f\/etc\/apache2\/mods-available\/\u306e\u4e0b\u306e*.conf\u306b\u6563\u3089\u3070\u3063\u3066\u3044\u308b\u306e\u3067\uff0c\u307e\u3068\u3081\u3066\u4e0a\u66f8\u304d\u3057\u3066\u3057\u307e\u3046\u3088\u3046\u306b\u3057\u307e\u3057\u305f\uff0e \u540d\u524d\u30d9\u30fc\u30b9\u306e\u30d0\u30fc\u30c1\u30e3\u30eb\u30db\u30b9\u30c8\u306e\u8a2d\u5b9a<\/span><\/p>\n\n\n\n \u306e\u3088\u3046\u306a\u611f\u3058\u3067\uff0cwww2\u3082\u4f5c\u308a\uff0c2\u3064\u306e\u30b5\u30a4\u30c8\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u305d\u308c\u305e\u308c\uff0c\/etc\/apache2\/sites-available\/\u306e\u4e0b\u306b\u7f6e\u304d\u307e\u3059\uff0e<\/p>\n\n\n\n \u30b5\u30a4\u30c8\u306e\u6709\u52b9\u5316<\/span><\/p>\n\n\n\n default\u3092\u7121\u52b9\u306b\u3057\u3066\u65b0\u3057\u3044\u30b5\u30a4\u30c8\u3092\u6709\u52b9\u306b\u3057\u307e\u3059\uff0e<\/p>\n\n\n\n \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u4f5c\u6210\uff0c\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u306e\u8a2d\u5b9a<\/span><\/p>\n\n\n\n \u8a2d\u5b9a\u3057\u305f\u305d\u308c\u305e\u308c\u306e\u30b5\u30a4\u30c8\u306ewww\u306e\u30eb\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u7528\u610f\u3057\uff0c\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u5909\u66f4\u3057\u307e\u3059\uff0e<\/p>\n\n\n\n \/etc\/hosts\u3092\u4fee\u6b63<\/span><\/p>\n\n\n\n \u521d\u671f\u72b6\u614b\u3067\u306f\u4e0a\u8a18\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u304c\uff0c127.0.1.1\u306e\u884c\u306f\u30d0\u30b0\u3067\u3059\uff0e \u4f8b\u3048\u3070\uff0c \u3068\u3044\u3046\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\uff0e Apache2\u306ePHP\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u6709\u52b9\u306b\u3059\u308b<\/span><\/p>\n\n\n\n \u8a2d\u5b9a\u3092\u78ba\u8a8d\u3057\u3066\u518d\u8d77\u52d5<\/span><\/p>\n\n\n\n MySQL\u306e\u8a2d\u5b9a<\/span> MySQL\u3092\u518d\u8d77\u52d5<\/span><\/p>\n\n\n\n PHP\u306e\u8a2d\u5b9a<\/span><\/p>\n\n\n\n \u30d5\u30a1\u30a4\u30eb\u3092\u4e0a\u304b\u3089\u898b\u3066\u3044\u3063\u3066\uff0c\u4e0b\u8a18\u306e\u3088\u3046\u306b\u4fee\u6b63\u3057\u307e\u3059\uff0e\u304a\u3082\u306b\u6587\u5b57\u30b3\u30fc\u30c9\u95a2\u4fc2\u3067\u3059\uff0e<\/p>\n\n\n\n \u6b21\u306fXoops\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3078\u9032\u307f\u307e\u3059\uff0e<\/p>\n","protected":false},"excerpt":{"rendered":" Ubuntu\u306eLAMP\u74b0\u5883\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30e1\u30e2 \u4ee5\u4e0b\u306f\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u7248Ubuntu\uff08Hardy Heron 8.04LTS\uff09\u306e\u8a71\u3067\u3059\uff0e Ubuntu\u672c\u4f53\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\uff0c\u6700\u65b0\u7248\u306eUbuntu\u3092DL\u3057\u3066\uff0c\u3044\u304f\u3064\u304b\u306e\u7c21\u5358\u306a\u8cea\u554f\u306b\u7b54\u3048\u308b\u3060\u3051\u3067\u3059\uff0e \u8d77\u52d5\u3057\u305f\u3089\uff0c\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u30de\u30cd\u30fc\u30b8\u30e3\u3092\u8d77\u52d5\u3057\u3066\uff0c\u3068\u308a\u3042\u3048\u305a\u3059\u3079\u3066\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3057\u307e\u3059\uff0e LAMP\u74b0\u5883\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff08\u3044\u307e\u3055\u3089\u66f8\u304f\u307b\u3069\u306e\u3053\u3068\u3082\u306a\u3044\u3051\u308c\u3069\u3082\u30fb\u30fb\u30fb\uff09 Apache2.2\u306e\u8a2d\u5b9a\uff08\u4ee5\u4e0b\u306f\u597d\u307f\u306b\u3088\u3063\u3066\u3044 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[28,27],"class_list":["post-542","post","type-post","status-publish","format-standard","hentry","category-misc","tag-lamp","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/ur.edu-connect.net\/wp-json\/wp\/v2\/posts\/542"}],"collection":[{"href":"https:\/\/ur.edu-connect.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ur.edu-connect.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ur.edu-connect.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ur.edu-connect.net\/wp-json\/wp\/v2\/comments?post=542"}],"version-history":[{"count":8,"href":"https:\/\/ur.edu-connect.net\/wp-json\/wp\/v2\/posts\/542\/revisions"}],"predecessor-version":[{"id":29773,"href":"https:\/\/ur.edu-connect.net\/wp-json\/wp\/v2\/posts\/542\/revisions\/29773"}],"wp:attachment":[{"href":"https:\/\/ur.edu-connect.net\/wp-json\/wp\/v2\/media?parent=542"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ur.edu-connect.net\/wp-json\/wp\/v2\/categories?post=542"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ur.edu-connect.net\/wp-json\/wp\/v2\/tags?post=542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
\u3044\u304f\u3064\u304b\u306e\u7c21\u5358\u306a\u8cea\u554f\u306b\u7b54\u3048\u308b\u3060\u3051\u3067\u3059\uff0e<\/p>\n\n\n\n
\u3068\u308a\u3042\u3048\u305a\u3059\u3079\u3066\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3057\u307e\u3059\uff0e<\/p>\n\n\n\n\u30b3\u30f3\u30bd\u30fc\u30eb\u304b\u3089\uff0c
# sudo apt-get install apache2
# sudo apt-get install php5 libapache2-mod-php5
# sudo apt-get install mysql-server
\uff08\u9014\u4e2d\u3067\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u8a2d\u5b9a\uff09
# sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
(\u3064\u3044\u3067\u306bphpmyadmin\u3082\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb)
\u3053\u3053\u3089\u8fba\u306f\uff0c# sudo tasksel\u3000\u3067\u4e00\u767a\u3067\u3067\u304d\u308b\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\uff0e<\/code><\/pre>\n\n\n\n
apache2.conf\u306e\u8a2d\u5b9a\u306f\u3044\u3058\u3089\u305a\uff0c\u4e0a\u66f8\u304d\u3067\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\uff0e
\u307e\u305a\uff0c\u5171\u901a\u306e\u8a2d\u5b9a\u3092\u65b0\u898f\u306b\u4f5c\u6210\u3057\u307e\u3059\uff0e<\/p>\n\n\n\n# sudo vi \/etc\/apache2\/conf.d\/common_settings
---
ServerTokens ProductOnly
ServerSignature Off
HostnameLookups On
DirectoryIndex index.php index.html index.htm index.cgi
LanguagePriority ja en ca cs da de el eo es et fr he hr it ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
AddHandler cgi-script .cgi .pl
AddDefaultCharset UTF-8
<directory>
Order Allow,Deny
Deny from all
Options None
AllowOverride None
<\/directory>
<directory \/var\/www\/public_html\/>
Options +ExecCGI -Indexes -MultiViews +SymLinksIfOwnerMatch
AllowOverride All
<\/directory>
---<\/code><\/pre>\n\n\n\n
\u5f93\u3063\u3066\uff0c\u4ed6\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306f\u4e00\u5207\u89e6\u3063\u3066\u3044\u307e\u305b\u3093\uff0e<\/p>\n\n\n\n# sudo cp \/etc\/apache2\/sites-available\/default \/etc\/apache2\/sites-available\/www1
# sudo cp \/etc\/apache2\/sites-available\/default \/etc\/apache2\/sites-available\/www2
# sudo vi \/etc\/apache2\/sites-available\/www1
---
<virtualhost *:80>
ServerAdmin example@www1.example.com
DocumentRoot \/var\/www\/public_html\/www1
ServerName www1.example.com
ErrorLog \/var\/log\/apache2\/error-www1.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog \/var\/log\/apache2\/access-www1.log combined
<\/virtualhost>
---
<\/code><\/pre>\n\n\n\n# sudo a2dissite default
# sudo a2ensite www1
# sudo a2ensite www2<\/code><\/pre>\n\n\n\n# sudo mkdir \/var\/www\/public_html
# sudo mkdir \/var\/www\/public_html\/www1
# sudo mkdir \/var\/www\/public_html\/www2
# sudo chown -R www-data:www-data \/var\/www\/public_html<\/code><\/pre>\n\n\n\n# sudo vi \/etc\/hosts\n\n127.0.0.1 localhost\n127.0.1.1 \u30db\u30b9\u30c8\u540d<\/code><\/pre>\n\n\n\n
\uff08\u76f4\u3057\u3066\u304a\u304b\u306a\u3044\u3068sudo\u306e\u5ea6\u306b\u30a8\u30e9\u30fc\u304c\u51fa\u307e\u3059\uff09
\u3067\uff0c\u524a\u9664\u3057\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8ffd\u8a18\u3057\u307e\u3059\uff0e<\/p>\n\n\n\n127.0.0.1 \u30e1\u30a4\u30f3\u30b5\u30a4\u30c8\u306eFQDN localhost \u30db\u30b9\u30c8\u540d<\/code><\/pre>\n\n\n\n
127.0.0.1 www1.example.com localhost foo
\u3068\u3044\u3046\u611f\u3058\u3067\u3059\uff0e
www1.example.com\u3092\u66f8\u304b\u306a\u3044\u3068\uff0c<\/p>\n\n\n\napache2: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName<\/code><\/pre>\n\n\n\n
\u30e1\u30a4\u30f3\u30b5\u30a4\u30c8\u306f\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066default\u306b\u306a\u3063\u3066\u308b\u307b\u3046\u3067\u3059\uff0e<\/p>\n\n\n\n# sudo apache2ctl -S<\/code><\/pre>\n\n\n\n
# sudo a2enmod php5<\/code><\/pre>\n\n\n\n
# sudo apache2ctl configtest
# sudo \/etc\/init.d\/apache2 restart<\/code><\/pre>\n\n\n\n
\u6587\u5b57\u30b3\u30fc\u30c9\u3092UTF-8\u306b\u7d71\u4e00\u3057\u307e\u3059\uff0e<\/p>\n\n\n\n# sudo \/etc\/mysql\/my.cnf
[client]
default-character-set=utf8
[mysqld]
skip-character-set-client-handshake
default-character-set=utf8
[mysqldump]
default-character-set=utf8<\/code><\/pre>\n\n\n\n# sudo \/etc\/init.d\/mysql restart<\/code><\/pre>\n\n\n\n
# sudo vi \/etc\/php5\/apache2\/php.ini<\/code><\/pre>\n\n\n\n
magic_quotes_gpc = Off\ndefault_charset = UTF-8\nmbstring.language = Japanese\nmbstring.internal_encoding = UTF-8\nmbstring.http_input = pass\nmbstring.http_output = pass\nmbstring.encoding_translation = Off\nmbstring.detect_order = UTF-8,SJIS,EUC-JP,JIS,ASCII\nmbstring.substitute_charactor = none<\/code><\/pre>\n\n\n\n