|
$B!!(B
linux: Nucleus on Debian - 1.installing MySQL + PHP4
|
$B!!(B
|
%j%s%/(B">
January 22nd, 2004 - 2:26
|
Linux$B%a%b!'(BDebian$B$GF0$+$9(B Nucleus - 1.MySQL + PHP4$B$N%$%s%9%H!<%k(B
Nucleus$B$O(B GNU$B%i%$%;%s%9$GG[I[$5$l$F$$$k(B blog$B%D!<%k$N0l$D$@!#F|K\$G$O%a%8%c!<$J(B Movable Type$B$N%i%$%;%s%9$b!"8D?M$NHs>&MQ$K$D$$$F$OL5NA$GMxMQ2DG=$@$,!"$3$&$$$C$?%i%$%;%s%9$O$$$D2?;~JQ$o$k$+J,$+$i$J$$!#(BGNU$B$3$=(B Debian$B$KAj1~$7$$!#$C$F$3$H$G!"$3$N(B Nucleus$B$r(B Debian$B$G2TF/$5$;$F$_$k!#(B
Nucleus$B$O(B web$B%5!<%P$G$"$k(B Apache$B!"(BDBMS$B$N0l$D$G$"$k(B MySQL$B!"%9%/%j%W%H4D6-$N0l$D$G$"$k(B PHP4$B$,$"$l$P!"$H$j$"$($:2TF/$9$k!#$h$C$F!"$^$:$O(B MySQL$B$H(B PHP4$B$N%$%s%9%H!<%k$r$9$k!J$H$j$"$($:(B Apache$B$,F0$$$F$$$k$3$H$OA0Ds!K!#(B
$B$C$F$3$H$G!"$$$D$b$N$h$&$K(B apt-get$B0lH/!#(B
# apt-get install mysql-server
Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
libdbd-mysql-perl libdbi-perl libmysqlclient10 mysql-client mysql-common
The following NEW packages will be installed:
libdbd-mysql-perl libdbi-perl libmysqlclient10 mysql-client mysql-common mysql-server
0 packages upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 3619kB of archives. After unpacking 9769kB will be used.
Do you want to continue? [Y/n] y
Building Dependency Tree... Done
Preconfiguring packages ...
|
$B$^$:$O%$%s%9%H!<%k;~$NCm0U=q$-!#(B
Configuring Mysql-server
security and update notice
MySQL will only install if you have a NON-NUMERIC hostname that is resolvable via the /etc/hosts file. E.g. if the "hostname" command returns "myhostname" then there must be a line like "127.0.0.1 myhostname".
A new mysql user "debian-sys-maint" will be created. He is used in the start/stop and cron scripts. Don't delete him.
Please remember to set a PASSWORD for the MySQL root user! If you use a /root/.my.cnf, always write the "user" and the "password" lines in there, never only the password! See /usr/share/doc/mysql-server/README.Debian for more information.
Networking is disabled by default for security reasons. You can enable it by commenting out the skip-networking option in /etc/mysql/my.cnf.
I will ensure secure permissions of /var/lib/mysql by replacing GIDs other than root and mysql with mysql.
[Ok]
|
$B%;%-%e%j%F%#>e$NCm0U$H$7$F!"(B1) $B%5!<%P<+BN$NL>A02r7h$,=PMh$k$3$H!"(B2) MySQL$B$K:n@.$5$l$k%f!<%6!"(B"debian-sys-maint" $B$O(B Debian$B$N=hM}$GMxMQ$5$l$k$?$a>C$5$J$$$3$H!"(B3) MySQL$B$N(B "root"$B%f!<%6$K%Q%9%o!<%I$r@_Dj$9$k$3$H!"(B4) $B%;%-%e%j%F%#>e$NM}M3$K$h$j%M%C%H%o!<%/$G$N@\B3$O%G%U%)%k%H$G%*%U$K$J$C$F$$$k$3$H!"(B5) /var/lib/mysql$B$r$$$8$/$k$H0BA4$@$C$F$3$H!"!"!"$J$s$F$3$H$,=q$+$l$F$$$k!#(B
Debian ConfigurationConfiguring Mysql-server
Should I remove everything below /var/lib/mysql when you purge the mysql-server package with the "dpkg --purge mysql-server" command (i.e. remove everything including the configuration) somewhen? (default is not)
Remove all databases after "purging" the mysql-server package?
[Yes] [No]
|
MySQL$B$N%Q%C%1!<%8:o=|;~$K%G!<%?%Y!<%9$b4]$4$H:o=|$9$k$+$I$&$+$N@_Dj!#$b$A$m$s(B "No"$B$G!#(B
Configuring Mysql-server
The MySQL can start on boot time or only if you type '/etc/init.d/mysql start' manually. Select 'yes' here if you want it to start automatically.
Should MySQL start on boot?
[Yes] [No]
|
$B%V!<%H;~$N<+F05/F0$K$D$$$F!#(B"Yes"$B$K$9$l$P(B rc*.d$B$NLLE]$r8+$F$/$l$k!#0l1~!"(B"Yes"$B$G!#(B
$BL$A*Br%Q%C%1!<%8(B mysql-common $B$rA*Br$7$F$$$^$9!#(B
($B%G!<%?%Y!<%9$rFI$_9~$s$G$$$^$9(B... $B8=:_(B 25030 $B8D$N%U%!%$%k$H%G%#%l%/%H%j$,%$%s%9%H!<%k$5$l$F$$$^$9!#(B)
(.../mysql-common_3.23.49-8.5_all.deb $B$+$i(B) mysql-common $B$rE83+$7$F$$$^$9(B...
$BL$A*Br%Q%C%1!<%8(B libmysqlclient10 $B$rA*Br$7$F$$$^$9!#(B
(.../libmysqlclient10_3.23.49-8.5_i386.deb $B$+$i(B) libmysqlclient10 $B$rE83+$7$F$$$^$9(B...
$BL$A*Br%Q%C%1!<%8(B libdbi-perl $B$rA*Br$7$F$$$^$9!#(B
(.../libdbi-perl_1.21-2_i386.deb $B$+$i(B) libdbi-perl $B$rE83+$7$F$$$^$9(B...
$BL$A*Br%Q%C%1!<%8(B libdbd-mysql-perl $B$rA*Br$7$F$$$^$9!#(B
(.../libdbd-mysql-perl_1.2216-2_i386.deb $B$+$i(B) libdbd-mysql-perl $B$rE83+$7$F$$$^$9(B...
$BL$A*Br%Q%C%1!<%8(B mysql-client $B$rA*Br$7$F$$$^$9!#(B
(.../mysql-client_3.23.49-8.5_i386.deb $B$+$i(B) mysql-client $B$rE83+$7$F$$$^$9(B...
$BL$A*Br%Q%C%1!<%8(B mysql-server $B$rA*Br$7$F$$$^$9!#(B
(.../mysql-server_3.23.49-8.5_i386.deb $B$+$i(B) mysql-server $B$rE83+$7$F$$$^$9(B...
mysql-common (3.23.49-8.5) $B$r@_Dj$7$F$$$^$9(B ...
libmysqlclient10 (3.23.49-8.5) $B$r@_Dj$7$F$$$^$9(B ...
libdbi-perl (1.21-2) $B$r@_Dj$7$F$$$^$9(B ...
libdbd-mysql-perl (1.2216-2) $B$r@_Dj$7$F$$$^$9(B ...
mysql-client (3.23.49-8.5) $B$r@_Dj$7$F$$$^$9(B ...
mysql-server (3.23.49-8.5) $B$r@_Dj$7$F$$$^$9(B ...
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld.
# mysql --version
mysql Ver 11.16 Distrib 3.23.49, for pc-linux-gnu (i686)
|
$B$H$j$"$($:!"(BMySQL$B$N%$%s%9%H!<%k$@$1$O=*N;!#G0$N$?$a!"%P!<%8%g%s$b3NG'$7$F$*$3$&!#(B
$B$lF~$l$F$d$kI,MW$,$"$k!#2<$NNc$G$O(B apt-get$B$G#22s$KJ,$1$F$$$k$,!"
$B$C$F$3$H$G!"$^$:$O(B PHP4$BK\BN$N%$%s%9%H!<%k$+$i!#(B
# apt-get install php4
Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
libbz2-1.0 libmm11
The following NEW packages will be installed:
libbz2-1.0 libmm11 php4
0 packages upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 632kB of archives. After unpacking 1621kB will be used.
Do you want to continue? [Y/n] y
Get:1 ftp://ftp.dti.ad.jp stable/main libbz2-1.0 1.0.2-1 [35.4kB]
Get:2 ftp://ftp.dti.ad.jp stable/main libmm11 1.1.3-6.1 [14.1kB]
Get:3 ftp://ftp.dti.ad.jp stable/main php4 4:4.1.2-6woody3 [583kB]
Fetched 632kB in 2s (288kB/s)
$BL$A*Br%Q%C%1!<%8(B libbz2-1.0 $B$rA*Br$7$F$$$^$9!#(B
($B%G!<%?%Y!<%9$rFI$_9~$s$G$$$^$9(B... $B8=:_(B 25296 $B8D$N%U%!%$%k$H%G%#%l%/%H%j$,%$%s%9%H!<%k$5$l$F$$$^$9!#(B)
(.../libbz2-1.0_1.0.2-1_i386.deb $B$+$i(B) libbz2-1.0 $B$rE83+$7$F$$$^$9(B...
$BL$A*Br%Q%C%1!<%8(B libmm11 $B$rA*Br$7$F$$$^$9!#(B
(.../libmm11_1.1.3-6.1_i386.deb $B$+$i(B) libmm11 $B$rE83+$7$F$$$^$9(B...
$BL$A*Br%Q%C%1!<%8(B php4 $B$rA*Br$7$F$$$^$9!#(B
(.../php4_4%3a4.1.2-6woody3_i386.deb $B$+$i(B) php4 $B$rE83+$7$F$$$^$9(B...
libbz2-1.0 (1.0.2-1) $B$r@_Dj$7$F$$$^$9(B ...
libmm11 (1.1.3-6.1) $B$r@_Dj$7$F$$$^$9(B ...
php4 (4.1.2-6woody3) $B$r@_Dj$7$F$$$^$9(B ...
I see you have apache webserver installed and so far you haven't used the apache module version of php4 in your apache. If you want to use it, you should reconfigure the apache webserver and select to load the php module. I can call the apacheconfig script now for you to do it, or you can insert the following line into /etc/apache/httpd.conf manually:
LoadModule php4_module /usr/lib/apache/1.3/libphp4.so
Do you want me to run the apacheconfig script now [y/N] ? n #
|
$B
$B
# apt-get install php4-mysql
Reading Package Lists... Done
Building Dependency Tree... Done
The following NEW packages will be installed:
php4-mysql
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 15.1kB of archives. After unpacking 90.1kB will be used.
Get:1 ftp://ftp.dti.ad.jp stable/main php4-mysql 4:4.1.2-6woody3 [15.1kB]
Fetched 15.1kB in 0s (29.0kB/s)
$BL$A*Br%Q%C%1!<%8(B php4-mysql $B$rA*Br$7$F$$$^$9!#(B
($B%G!<%?%Y!<%9$rFI$_9~$s$G$$$^$9(B... $B8=:_(B 22983 $B8D$N%U%!%$%k$H%G%#%l%/%H%j$,%$%s%9%H!<%k$5$l$F$$$^$9!#(B)
(.../php4-mysql_4%3a4.1.2-6woody3_i386.deb $B$+$i(B) php4-mysql $B$rE83+$7$F$$$^$9(B...
php4-mysql (4.1.2-6woody3) $B$r@_Dj$7$F$$$^$9(B ...
You are installing MySQL support for php4, but it's not enabled in your /etc/php4/apache/php.ini.
To enable it you need to add this line:
extension=mysql.so
Do you want me to add it now [Y/n] ?y
#
|
$B:G8e$N
$BG0$N$?$a!"(Bphp.ini$B$K(B mysql.so $B$,DI2C$5$l$?$+3NG'$9$k!#(B
# cat /etc/php4/apache/php.ini | grep mysql.so
extension=mysql.so
|
PHP$B$N%P!<%8%g%s3NG'$O8e$G%F%9%H$b7s$M$F9T$&$,!"0l1~%Q%C%1!<%8>e$G$N%P!<%8%g%s$b8+$F$*$3$&!#(B
# dpkg -l | grep php4
ii | php4 | 4.1.2-6woody3 | A server-side, HTML-embedded scripting langu |
ii | php4-mysql | 4.1.2-6woody3 | MySQL module for php4 |
|
$B
# emacs /etc/apache/httpd.conf
|
# LoadModule php3_module /usr/lib/apache/1.3/libphp3.so
LoadModule userdir_module /usr/lib/apache/1.3/mod_userdir.so
LoadModule php4_module /usr/lib/apache/1.3/libphp4.so
<IfModule mod_userdir.c>
UserDir public_html
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.phps
</IfModule>
# AddType application/x-httpd-php3 .php3
# AddType application/x-httpd-php3-source .phps
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
|
PHP4$B4XO"$G%3%a%s%H$,30$l$F$$$k$3$H$r3NG'$9$k!#$^$?!"(BPHP3$B$H(B PHP4$B$O%3%s%U%j%/%H$r5/$3$9$?$a!"I,$:(B PHP3$B$,%3%a%s%H%"%&%H$5$l$F$$$k$+$I$&$+!J9T$N@hF,$K(B # $B$,IU$$$F$$$k$+$I$&$+!K$b3NG'$9$k!#$=$l$H!"(Bmod_dir$B$K(B index.php$B$H(B index.phps$B$bDI2C$7$F$*$/!#$3$l$G%G%#%l%/%H%j$N$_$N;XDj$G$"$C$F$b!"!J(Bindex.php, index.phps$B$,$=$N%G%#%l%/%H%j$K$"$l$P!K$=$l$r%V%i%&%6$K<+F0E*$KEO$7$F$/$l$k!#(B
$B:#2s$O%f!<%6%G%#%l%/%H%j$K(B blog$B$rE83+$9$k$?$a!"(Bmod_userdir$B4XO"$b%3%a%s%H$r30$7$?!#(B
$B$C$F$3$H$G!"B3$/!#(B
$B!!7/$,K>$`1J1s(B - soundtrack
|
|