LAMP 2007 10 29 1 LAMP LAMP Web L:Linux( ) A:Apache(Web ) M:MySQL( ) P:PHP(Hypertext Preprocessor) OS Windows WAMP Mac OS MAMP Vine Linux OS root yum Red Hat Linux 2 Apache Apache http://httpd.apache.org/download.cgi Apache HTTP Server 2.0.59 is also available (2.0.59 10 29 2.0.61 ) httpd-2.0.59.tar.gz GNOME 1
# mv httpd-2.0.59.tar.gz /usr/local/src /usr/local/src # tar zxvf httpd-2.0.59.tar.gz make #./configure # make # make install Apache # /usr/local/apache2/bin/apachectl start Web http://localhost/ Apache 2
http://localhost Apache.bashrc alias starta= /usr/local/apache2/bin/apachectl start.bashrc GNOME starta Apache root 3 MySQL Apache Web http://dev.mysql.com/downloads/ 3
MySQL Community Server Current Release (Recommended): Source downloads Compressed GNU TAR archive (tar.gz) Pick a mirror No thanks, just take me to the downloads! Japan [JMPA] HTTP GNOME # mv mysql-5.0.41.tar.gz /usr/local/src /usr/local/src # tar zxvf mysql-5.0.41.tar.gz MySQL MySQL # groupadd mysql # useradd -g mysql mysql # passwd mysql make 3 mysql MySQL mysql 4
#./configure \ with-charset=ujis \ with-extra-charsets=all \ with-mysqld-user=mysql \ prefix=/usr/local/mysql tsuduki #./configure \ with-charset=ujis \ with-extra-charsets=all \ with-mysqld-user=tsuduki \ prefix=/usr/local/mysql (Pentium3 450MHz 30 ) # make! # make install mysql MySQL # /usr/local/mysql/bin/mysql install db user=mysql MySQL 2,3 mysql MySQL 5
# chown -R root /usr/local/mysql # chown -R mysql /usr/local/mysql/var # chgrp -R mysql /usr/local/mysql MySQL root MySQL # /usr/local/mysql/bin/mysql -u root abcdef mysql> set password for root@localhost=password( abcdef ); MySQL MySQL mysql> \q mysql> exit MySQL -p 6
MySQL # /usr/local/mysql/bin/mysql -u root -p MySQL MySQL /etc/my.cnf my.cnf /usr/local/mysql/share/mysql my-huge.cnf,my-large.cnf,my-medium.cnf,my-small.cnf /etc/ my.cnf my-large.cnf,my-medium.cnf 7
/usr/local/mysql/share/mysql my.cnf e- Moodle Moodle EUC-JP ujis Moodle UTF-8 utf8 UTF-8 [client] [ ] client [client] client [mysql] 8
[client] (1 ) default-character-set=utf8 [mysql] (1 ) default-character-set=utf8 [mysqld] (3 ) old passwords=1 default-character-set=utf8 skip-character-set-client-handshake MySQL # /usr/local/mysql/share/mysql/mysql.server restart MySQL Apache Apache root.bashrc startd alias startd= /usr/local/mysql/bin/mysqld safe user=mysql & MySQL GNOME 2 Apache MySQL # starta # startd MySQL /etc/profile if fi PATH=$PATH:/usr/local/mysql/bin MySQL 9
mysql # mysql -u root -p MySQL EUC-JP UTF-8 GNOME (T) (C) Unicode LAMP P PHP 4 PHP PHP apt 2 update 2 # apt-get update # apt-get install libxml2-devel # apt-get install libpng-devel PHP Web http://www.php.net/downloads.php PHP 5.2.4 (tar.gz) (2007 9 2 ) jp.php.net GNOME # mv php-5.2.4.tar.gz /usr/local/src /usr/local/src 10
# tar zxvf php-5.2.4.tar.gz Moodle GD MySQL Ctrl c with-gd GD #./configure \ with-apxs2=/usr/local/apache2/bin/apxs \ enable-mbstring \ with-mysql=/usr/local/mysql \ with-gd \ # make # make install PHP Apache php Apache /usr/local/apache2/conf httpd.conf 292 #ServerName www.example.com:80 ServerName localhost:80 PHP php 2 838 AddType application/x-httpd-php.php 839 AddType application/x-httpd-php-source.phps php php.ini 11
# cd /usr/local/src/php-5.2.4 # cp php.ini-dist /usr/local/lib/php.ini /usr/local/lib php.ini PHP EUC-JP Moodle UTF-8 UTF-8 Moodle UTF-8 EUC-JP PHP 2 1 Web 115 ;output handler = output handler = mb output handler 448 ;default charset = iso-8859-1 default charset = UTF-8 1179 ;mbstring.language = Japanese 1184 ;mbstring.internal encoding = mbstring.internal encoding = UTF- EUC-JP 8 1187 ;mbstring.http input = auto 1191 ;mbstring.http output = SJIS mbstring.http output = UTF-8 1198 ;mbstring.encoding translation = Off mbstring.encoding translation = On 1202 ;mbstring.detect order = auto 1206 ;mbstring.substitute character = none; Apache PHP PHP /usr/local/apache2/htdocs/ UTF-8 (EUC-JP EUC-JP ) htdocs Web http://www.localhost/.php LAMP PHP MySQL PHP,MySQL 12
Web 13