{"id":25,"date":"2006-11-18T17:11:39","date_gmt":"2006-11-18T09:11:39","guid":{"rendered":"http:\/\/140.123.23.69\/blog\/?p=25"},"modified":"2006-11-18T17:11:39","modified_gmt":"2006-11-18T09:11:39","slug":"freebsd-61-%e5%ae%89%e8%a3%9d-apachemysqlphp","status":"publish","type":"post","link":"https:\/\/blog.smallken.site\/?p=25","title":{"rendered":"FreeBSD 6.1 \u5b89\u88dd Apache+MySQL+PHP"},"content":{"rendered":"<p>FreeBSD 6.1 \u5b89\u88dd Apache+MySQL+PHP<\/p>\n<p>\/\/ \u5b89\u88dd mysql5<\/p>\n<p># cd \/usr\/ports\/databases\/mysql50-server<br \/>\n# make install clean<br \/>\n\u6216\u60f3\u4f7f\u7528 big \u7de8\u78bc<br \/>\n# make WITH_CHARSET=big5 WITH_XCHARSET=all install clean<\/p>\n<p>\/\/ \u63a5\u4e0b\u4f86\u8acb\u4fee\u6539<br \/>\n# vi \/etc\/rc.conf<br \/>\n\/\/ \u4e26\u52a0\u5165\u4e0b\u5217\u9019\u4e00\u884c\uff0c\u4ee5\u8b93\u958b\u6a5f\u6642\u555f\u52d5 MySQL,\u82e5\u4e0d\u52a0\u5165\u7684\u8a71,\u9023\u6b63\u5e38\u555f\u52d5\u90fd\u4e0d\u884c<br \/>\nmysql_enable=&#8221;yes&#8221;<\/p>\n<p>\/\/ \u555f\u52d5 MySQL Server<br \/>\n# \/usr\/local\/etc\/rc.d\/mysql-server start<br \/>\nStarting mysql.<br \/>\n\u6216\u8005<br \/>\n# \/usr\/local\/share\/mysql\/mysql.server start<br \/>\nStarting MySQL SUCCESS!<\/p>\n<p>\/\/ \u95dc\u9589 MySQL Server<br \/>\n# \/usr\/local\/etc\/rc.d\/mysql-server stop<br \/>\n\u6216\u8005<br \/>\n# \/usr\/local\/share\/mysql\/mysql.server stop<\/p>\n<p>\/\/ \u6e2c\u8a66 mysql<br \/>\n# \/usr\/local\/bin\/mysql mysql<br \/>\n\u82e5\u5b89\u88dd\u6210\u529f\uff0c\u4f60\u5c07\u770b\u5230\u4ee5\u4e0b\u756b\u9762\uff1a<\/p>\n<p>Reading table information for completion of table and column names<br \/>\nYou can turn off this feature to get a quicker startup with -A<\/p>\n<p>Welcome to the MySQL monitor.  Commands end with ; or g.<br \/>\nYour MySQL connection id is 14 to server version: 4.1.13<\/p>\n<p>Type &#8216;help;&#8217; or &#8216;h&#8217; for help. Type &#8216;c&#8217; to clear the buffer.<br \/>\nmysql><br \/>\n\/\/ \u5efa\u7acb mysql \u7684 root \u5bc6\u78bc<\/p>\n<p>\u65b9\u6cd5\u4e00\uff1a<\/p>\n<p>   # \/usr\/local\/bin\/mysqladmin -u root password &#8220;123456&#8221;<br \/>\n\u6216 # \/usr\/local\/bin\/mysqladmin -u root -h freebsd.com password &#8220;123456&#8221;<\/p>\n<p>   # \/usr\/local\/bin\/mysql -u root -p   \/\/ \u767b\u5165\u65b9\u6cd5<\/p>\n<p>\u65b9\u6cd5\u4e8c\uff1a<\/p>\n<p>\u65b9\u6cd5\u4e00\u76f4\u63a5\u5728shell\u4e2d\u8f38\u5165\u5bc6\u78bc\uff0c\u6307\u4ee4\u6703\u88ab\u7cfb\u7d71\u8a18\u9304\u4e0b\u4f86\uff0c\u6bd4\u8f03\u4e0d\u5b89\u5168\uff0c\u5b89\u5168\u7684\u65b9\u6cd5<\/p>\n<p># \/usr\/local\/bin\/mysql<\/p>\n<p>mysql>use mysql<br \/>\nmysql>update user set password=password(&#8220;\u65b0\u5bc6\u78bc&#8221;) where user=&#8221;root&#8221;;<br \/>\nQuery OK, 2 rows affected (0.01 sec)<br \/>\nRows matched: 2  Changed: 2  Warnings: 0<\/p>\n<p>mysql> flush privileges;<br \/>\nQuery OK, 0 rows affected, 1 warning (0.00 sec)<br \/>\nmysql> quit<br \/>\nBye<\/p>\n<p>\/\/ \u5b89\u88dd\u5b8c\u6210\u5f8c\u9810\u8a2d\u8cc7\u6599\u5eab\u7684data\u653e\u5728 \/var\/db\/mysql,\u82e5\u8981\u5099\u4efd\u5c31\u662f\u5099\u4efd\u9019\u500b\u8cc7\u6599\u593e<\/p>\n<p>\/\/ \u5b89\u88dd Apache Web Server<\/p>\n<p># cd \/usr\/ports\/www\/apache22<br \/>\n# make install clean<\/p>\n<p>\/\/ \u7de8\u8f2f rc.conf,\u52a0\u5165 apache22_enable=&#8221;YES&#8221;<br \/>\n# vi \/etc\/rc.conf<br \/>\napache22_enable=&#8221;YES&#8221;<\/p>\n<p>\/\/ \u555f\u52d5 apache22<br \/>\n# \/usr\/local\/etc\/rc.d\/apache22 start<br \/>\n\/\/ \u95dc\u9589 apache22<br \/>\n# \/usr\/local\/etc\/rc.d\/apache22 stop<\/p>\n<p>\/\/\u5b89\u88dd PHP5<br \/>\n# cd \/usr\/ports\/lang\/php5<br \/>\n# make install clean<br \/>\n\u5fc5\u9078 [X] APACHE     Build Apache module<\/p>\n<p>\/\/ \u5b89\u88dd PHP5-Extensions<br \/>\n# cd \/usr\/ports\/lang\/php5-extensions<br \/>\n\/\/ \u9078\u64c7\u6240\u9700\u8981\u7684\u5ef6\u4f38\u5957\u4ef6<br \/>\n# make config<br \/>\n[X] BZ2 bzip2 library support<br \/>\n[X] CTYPE ctype functions<br \/>\n[X] DOM DOM support<br \/>\n[X] GD GD library support<br \/>\n[X] GETTEXT gettext library support<br \/>\n[X] HASH HASH Message Digest Framework<br \/>\n[X] ICONV iconv support<br \/>\n[X] MBSTRING multibyte string support<br \/>\n[X] MCRYPT Encryption support<br \/>\n[X] MYSQL MySQL database support<br \/>\n[X] ODBC unixODBC support<br \/>\n[X] PCRE Perl Compatible Regular Expression support<br \/>\n[X] PDO PHP Data Objects Interface (PDO)<br \/>\n[X] POSIX POSIX-like functions<br \/>\n[X] SESSION session support<br \/>\n[X] SIMPLEXML simplexml support<br \/>\n[X] SQLITE sqlite support<br \/>\n[X] TOKENIZER tokenizer support<br \/>\n[X] XML XML support<br \/>\n[X] XMLREADER XMLReader support<br \/>\n[X] XMLWRITER XMLWriter support<br \/>\n[X] ZLIB ZLIB support<\/p>\n<p>\/\/ \u958b\u59cb\u5b89\u88dd<br \/>\n# make install clean<\/p>\n<p>\/\/ \u4fee\u6539 httpd.conf \u8a2d\u5b9a\u6a94<br \/>\n# vi \/usr\/local\/etc\/apache22\/httpd.conf<br \/>\nServerAdmin <a href=\"mailto:smallken@test.edu.tw\">smallken@test.edu.tw<\/a><br \/>\nServerName test.edu.tw:80<br \/>\nAddType application\/x-httpd-php .php<br \/>\nAddType application\/x-httpd-php-source .phps<br \/>\nDirectoryIndex index.php index.htm index.html index.pl index.cgi<\/p>\n<p>\/\/ \u8907\u88fd php.ini-dist \u6210\u70ba php.ini<br \/>\n# cp \/usr\/local\/etc\/php.ini-dist \/usr\/local\/etc\/php.ini<\/p>\n<p>\/\/ \u78ba\u5b9a\u4e00\u4e0b\u6709\u8a2d\u5b9a\u958b\u6a5f\u6642\u555f\u52d5<br \/>\n# vi \/etc\/rc.conf<br \/>\nmysql_enable=&#8221;YES&#8221;<br \/>\napache22_enable=&#8221;YES&#8221;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>FreeBSD 6.1 \u5b89\u88dd Apache+MySQL+PHP \/\/ \u5b89\u88dd mysql5 # cd \/usr\/&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-25","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/blog.smallken.site\/index.php?rest_route=\/wp\/v2\/posts\/25","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.smallken.site\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.smallken.site\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.smallken.site\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.smallken.site\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=25"}],"version-history":[{"count":0,"href":"https:\/\/blog.smallken.site\/index.php?rest_route=\/wp\/v2\/posts\/25\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.smallken.site\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=25"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.smallken.site\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=25"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.smallken.site\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=25"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}