{"id":119,"date":"2004-07-08T23:50:00","date_gmt":"2004-07-08T15:50:00","guid":{"rendered":"http:\/\/blog.zhouhonghe.com\/?p=119"},"modified":"2004-07-08T23:50:00","modified_gmt":"2004-07-08T15:50:00","slug":"%e7%94%a8proftpmysqlphp%e5%ae%9e%e7%8e%b0%e9%9d%9e%e7%b3%bb%e7%bb%9f%e7%94%a8%e6%88%b7ftp%e7%99%bb%e9%99%86%e5%92%8c%e5%af%b9ftp%e7%94%a8%e6%88%b7%e7%9a%84web%e7%ae%a1%e7%90%86","status":"publish","type":"post","link":"https:\/\/blog.zhouhonghe.com\/?p=119","title":{"rendered":"\u7528proftp+mysql+php\u5b9e\u73b0\"\u975e\u7cfb\u7edf\"\u7528\u6237ftp\u767b\u9646\u548c\u5bf9ftp\u7528\u6237\u7684web\u7ba1\u7406"},"content":{"rendered":"<p>\u7cfb\u7edf\u4ee5\u53ca\u8f6f\u4ef6\u73af\u5883 redhat7.2 apache+php+mysql proftp-version.tar.gz \u53ef\u80fd\u9700\u8981mod_sql.o phpadmin-version.tar.gz \u5982\u679c\u6ca1\u6709\u8fd9\u4e9b\u8f6f\u4ef6 \u53bbgoogle\u641c\u7d22 <br \/>\u7279\u70b9 \u7531\u4e8e\u4e0d\u9700\u8981\u53bb\u6dfb\u52a0\u7cfb\u7edf\u7528\u6237 \u5b83\u7684\u5b89\u5168\u6027\u5c31\u5927\u5927\u63d0\u9ad8\u4e86 \u800c\u4e14\u901a\u8fc7web\u7ba1\u7406 \u65b9\u4fbf\u7ba1\u7406 <br \/>\u5176\u5b9e \u53ea\u8981\u4f1a\u5199php \u8fd8\u53ef\u4ee5\u81ea\u5df1\u5199\u7a0b\u5e8f\u6765\u5bf9ftp\u7528\u6237\u8fdb\u884c\u7ba1\u7406 \u5c31\u4e0d\u9700\u8981phpadmin\u4e86 \u5475\u5475 \u4e0d\u8fc7phpadmin\u662f\u73b0\u6210\u7684\u4e1c\u897f <\/p>\n<p>\u7b2c\u4e00\u6b65 \u5b89\u88c5apache+php+mysql <br \/>\u8fd9\u4e2a\u6211\u5c31\u4e0d\u8be6\u7ec6\u8bf4\u4e86 \u7f51\u4e0a\u6559\u7a0b\u592a\u591a\u4e86 \u5728\u8fd9\u91cc\u9700\u8981\u6ce8\u610fmysql\u7684\u5b89\u88c5\u8def\u5f84 \u56e0\u4e3a\u540e\u9762proftpd\u5b89\u88c5\u9700\u8981\u627e\u5b83\u7684lib\u548cinclude\u76ee\u5f55 <\/p>\n<p>\u7b2c\u4e8c\u6b65 \u5b89\u88c5proftpd <br \/>tar zxvf proftpd*.tar.gz <br \/>\u8fdb\u5165\u89e3\u538b\u7684\u76ee\u5f55 <br \/>.\/configure --prefix=\/home\/proftpd <br \/>--with-includes=\/mysql\u7684\u8def\u5f84\/include <br \/>--with-libraries=\/mysql\u7684\u8def\u5f84\/lib <br \/>--with-modules=mod_sql:mod_sql_mysql <br \/>\u63a5\u7740\u5c31\u5f00\u59cbmake\u4e86 <br \/>\u8fd9\u6837make\u4f1a\u51fa\u73b0error \u8bf4\u627e\u4e0d\u5230mysql.h \u6ca1\u5173\u7cfb \u5230proftpd\u89e3\u538b\u76ee\u5f55\u7684modules\u4e0b \u4fee\u6539mod_sql_mysql.c <br \/>\u627e <br \/>\u628a\u8fd9\u4e00\u70b9\u6539\u4e3a&lt;.\/mysql.h&gt; <br \/>ok \u91cd\u65b0configure and make\u5982\u679c\u6ca1\u6709\u5176\u4ed6\u95ee\u9898\u7684\u8bdd \u5c31\u53ef\u4ee5\u987a\u5229\u5b8c\u6210\u4e86 <br \/>\u7136\u540emake install\u5b8c\u6210proftpd\u521d\u6b65\u5b89\u88c5 <\/p>\n<p>\u7b2c\u4e09\u6b65 \u7ed9proftpd\u5728mysql\u91cc\u5efaftp\u7528\u6237\u7684\u6570\u636e\u5e93 <br \/>CREATE DATABASE proftpd; <br \/>CREATE TABLE users ( <br \/>userid text NOT NULL, #\u7528\u6237\u540d <br \/>password text NOT NULL, #\u7528\u6237\u5bc6\u7801 <br \/>homedir text NOT NULL, #\u7528\u6237\u76ee\u5f55 <br \/>count int(11) NOT NULL, #\u7528\u6237\u767b\u5f55\u6b21\u6570(\u521d\u59cb\u586b0) <br \/>shell text NOT NULL #\u7528\u6237shell <br \/>); <\/p>\n<p>\u7b2c\u56db\u6b65 \u914d\u7f6e\u4f60\u7684proftpd.conf\u6587\u4ef6 <\/p>\n<p>ServerName \"Ftp.xashow.com\" <br \/>ServerType standalone <br \/>DefaultServer on <br \/>ServerIdent off <br \/>RequireValidShell off <\/p>\n<p>Port 21 <br \/># Umask 022 is a good standard umask to prevent new dirs and files <br \/># from being group and world writable. <br \/>Umask 022 <\/p>\n<p>#MySQL\u7684\u4fe1\u606f <br \/>SQLConnectInfo proftpd@localhost aying 123 #\u8fde\u63a5\u6570\u636e\u5e93\u7684\u4fe1\u606f\u5047\u8bbe\u4e3aaying\/123 <br \/>SQLGroupAuth off #\u8fd9\u91cc\u662f\u5173\u6389\u7ec4\u8ba4\u8bc1 <br \/>SQLAuthTypes Plaintext #\u5bc6\u7801\u4ee5\u660e\u6587\u5f62\u5f0f\u8ba4\u8bc1. <br \/>SQLDoAuth on #\u6253\u5f00sql\u8ba4\u8bc1 <br \/>SQLHomedirOnDemand on #\u5982\u679c\u7528\u6237\u76ee\u5f55\u4e0d\u5b58\u5728,\u5219\u81ea\u52a8\u5efa\u4e86. <br \/>SQLUserTable users #\u5b9a\u4e49\u5b58\u653e\u7528\u6237\u4fe1\u606f\u7684\u8868 <br \/>SQLUsernameField userid #\u5b9a\u4e49\u7528\u6237\u540d\u5b57\u6bb5 <br \/>SQLPasswordField password #\u5b9a\u4e49\u5bc6\u7801 <br \/>SQLHomedirField homedir #\u5b9a\u4e49\u7528\u6237\u76ee\u5f55 <br \/>SQLLoginCountField count #\u5b9a\u4e49\u767b\u5f55\u6b21\u6570 <br \/>SQLShellField shell #\u5b9a\u4e49\u767b\u5f55shell <br \/>SQLAuthoritative off #\u9664\u4e86\u53ef\u4ee5\u8fdb\u884csql\u8ba4\u8bc1,\u7cfb\u7edf\u7528\u6237\u7b49\u522b\u7684\u8ba4\u8bc1\u65b9\u5f0f\u4e5f\u53ef\u4ee5. <\/p>\n<p>MaxInstances 30 #\u9632\u6b62DOS\u653b\u51fb 1\u6b21\u5141\u8bb830\u4e2a\u8fde\u63a5 <\/p>\n<p># Set the user and group that the server normally runs at. <br \/>User nobody <br \/>Group nobody <\/p>\n<p># Normally, we want files to be overwriteable. <\/p>\n<p>AllowOverwrite on <\/p>\n<p>\u7b2c\u56db\u6b65 \u6dfb\u52a0\u7528\u6237\u3001\u4ee5\u53ca\u6d4b\u8bd5proftpd <\/p>\n<p>\u53ef\u4ee5\u624b\u5de5\u5411proftpd\u7684user\u8868\u4e2d\u6dfb\u52a0\u7528\u6237 <br \/>USE proftpd <br \/>INSERT INTO users values( \"aying\", \"123123\", \"\/home\", \"0\", \"\"); <\/p>\n<p>\u7531\u4e8e\u6700\u7ec8\u7684\u76ee\u7684\u662f\u4ee5web\u65b9\u5f0f\u5bf9ftp\u7528\u6237\u8fdb\u884c\u7ba1\u7406 \u6240\u4ee5\u8fd8\u9700\u8981\u5b89\u88c5phpadmin \u5177\u4f53phpadmin\u7684\u5b89\u88c5\u914d\u7f6e\u65b9\u6cd5\u4e5f\u4e0d\u96be \u5728\u8fd9\u91cc\u6211\u5c31\u4e0d\u5728\u591a\u8bf4\u4e86 <\/p>\n<p>\u597d\u4e86 \u5df2\u7ecf\u5b8c\u5de5\u4e86 \u4f60\u53ef\u4ee5\u542f\u52a8\u4f60\u7684proftpd\u4e86 <\/p>\n<p>\u7136\u540e\u6d4b\u8bd5\u4e00\u4e0b <br \/>ftp 0 <br \/>user aying <br \/>password 123123 <br \/>ls \u4e00\u4e0b\u770b\u770b\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002 <\/p>\n<p>\u54c8\u54c8 \u6211\u8fdb\u53bb\u4e86 \u6210\u529f\u7684\u6ecb\u5473\u603b\u662f\u90a3\u4e48\u751c\u871c\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u5728\u8fd9\u91cc\u4e5f\u795d\u5927\u5bb6 <\/p>\n<p>&nbsp;<\/p>\n<p>\u6765\u6e90\uff1a<a href=\"http:\/\/www.9guo.com\/show.php?articleid=2267&amp;&amp;classid=74\">http:\/\/www.9guo.com\/show.php?articleid=2267&amp;&amp;classid=74<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7cfb\u7edf\u4ee5\u53ca\u8f6f\u4ef6\u73af\u5883 redhat7.2 apache+php+mysql proftp-version.tar. [&hellip;]<\/p>... ","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-119","post","type-post","status-publish","format-standard","hentry","category-others"],"_links":{"self":[{"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=\/wp\/v2\/posts\/119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=119"}],"version-history":[{"count":0,"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=\/wp\/v2\/posts\/119\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}