{"id":57,"date":"2015-11-27T21:48:18","date_gmt":"2015-11-27T13:48:18","guid":{"rendered":"https:\/\/tygtw.ddns.net\/?p=57"},"modified":"2015-11-27T21:48:18","modified_gmt":"2015-11-27T13:48:18","slug":"%e5%ae%89%e8%a3%9dfedora-23apachephp","status":"publish","type":"post","link":"https:\/\/tygtw.ddns.net\/wordpress\/?p=57","title":{"rendered":"\u5b89\u88ddFedora 23+Apache+PHP&#8230;"},"content":{"rendered":"<p>\u5b89\u88ddFedora 23<\/p>\n<p>1.\u4e0b\u8f09\u6700\u65b0\u7248Fedora 23 ISO \u4e26\u71d2\u6210\u958b\u6a5f\u5149\u789f<\/p>\n<p>\u4e0b\u8f09\u4f4d\u5740\uff1ahttps:\/\/getfedora.org\/zh_TW\/server\/download\/<\/p>\n<p>2.\u958b\u59cb\u5b89\u88ddFedora Server<\/p>\n<p>Install Guide\u8acb\u53c3\u95b1http:\/\/www.if-not-true-then-false.com\/2015\/fedora-23-install-guide\/<\/p>\n<p>3.\u5b89\u88dd<\/p>\n<p>a.Apache HTTP Server<\/p>\n<p>b.MySQL\/MariaDB database<\/p>\n<p>c. PHP<\/p>\n<p>d.Perl or Python<\/p>\n<p>\u8acb\u53c3\u95b1http:\/\/www.unixmen.com\/how-to-install-lamp-stack-in-fedora-23\/<\/p>\n<p>\u91cd\u9ede\u6574\u7406\u5982\u4e0b\uff1a<\/p>\n<p>install Apache:<\/p>\n<p>dnf install httpd -y<\/p>\n<p>Enable the httpd service to start automatically on every reboot:<\/p>\n<p>systemctl enable httpd<\/p>\n<p>Start httpd service using the following command:<\/p>\n<p>systemctl start httpd<\/p>\n<p>And adjust the firewall to allow the httpd service to access it from remote clients.<\/p>\n<p>firewall-cmd &#8211;permanent &#8211;add-service=http<\/p>\n<p>firewall-cmd &#8211;permanent &#8211;add-service=https<\/p>\n<p>Restart firewalld service:<\/p>\n<p>firewall-cmd &#8211;reload<\/p>\n<p>Install MariaDB<\/p>\n<p>dnf install mariadb mariadb-server -y<\/p>\n<p>Enable mariadb service at boot time with following command:<\/p>\n<p>systemctl enable mariadb<\/p>\n<p>And start mariadb service using command:<\/p>\n<p>systemctl start mariadb<\/p>\n<p>Set MariaDB root password:<\/p>\n<p>mysql_secure_installation<\/p>\n<p>Install PHP<\/p>\n<p>dnf install php -y<\/p>\n<p>Test PHP:<br \/>\nCreate a sample \u201ctestphp.php\u201d file in Apache document root folder and append the lines as shown below:<br \/>\nvi \/var\/www\/html\/testphp.php<br \/>\nAdd the following lines:<\/p>\n<p>phpinfo();<br \/>\n?&gt;<\/p>\n<p>Restart httpd service:<br \/>\nsystemctl restart httpd<\/p>\n<p>\u5b89\u88ddsamba<br \/>\ndnf -y install samba samba-client<\/p>\n<p>firewall-cmd &#8211;zone=public &#8211;add-port=445\/tcp &#8211;permanent<br \/>\nfirewall-cmd &#8211;zone=public &#8211;add-port=139\/tcp &#8211;permanent<br \/>\nfirewall-cmd &#8211;reload<\/p>\n<p>firewall-cmd &#8211;zone=public &#8211;add-port=10000\/tcp &#8211;permanent<\/p>\n<p>or firewall-cmd &#8211;add-port=10001\/tcp &#8211;permanent<br \/>\nfirewall-cmd &#8211;reload<\/p>\n<p>yum install vsftpd<br \/>\n\/sbin\/service vsftpd start<\/p>\n<p>\u4fee\u6539httpd.conf<\/p>\n<p>vi \/etc\/httpd\/conf\/httpd.conf<\/p>\n<p>Options Indexes FollowSymLinks<br \/>\n\u522a\u9664Indexes\uff0c\u518d\u91cd\u65b0\u555f\u52d5Apache\uff0c\u907f\u514dApache\u5217\u51fa\u76ee\u9304\u6a94\u6848<\/p>\n<p>chcon -R -t httpd_sys_rw_content_t \/var\/www\/html\/<\/p>\n<p>chgrp -R apache \/var\/www\/html\/\u7279\u5b9a\u76ee\u9304\/<\/p>\n<p>chown -R apache:apache \/var\/www\/html\/\u7279\u5b9a\u76ee\u9304\/<\/p>\n<p>\u8a2d\u5b9a\u53ef\u5beb\u5165\u6b0a\u9650<br \/>\nchmod 777 -R \/var\/www\/html\/\u8981\u958b\u653e\u5beb\u5165\u7684\u76ee\u9304\/<\/p>\n<p>\u79fb\u9664webmin<\/p>\n<p>\/etc\/webmin\/uninstall.sh<\/p>\n<p>======================<\/p>\n<p>Fedora 23\u5b89\u88dd\u5b8c\u5f8c\u7684\u57fa\u672c\u74b0\u5883\u8cc7\u8a0a<\/p>\n<p>Apache\/2.4.16 (Fedora)<br \/>\nOpenSSL\/1.0.2d-fips<br \/>\nPHP\/5.6.14<br \/>\nmod_wsgi\/4.4.8<br \/>\nPython\/2.7.10<br \/>\nmod_perl\/2.0.9<br \/>\nPerl\/v5.22.0<br \/>\nmysqlnd 5.0.11<\/p>\n<p>=========================<\/p>\n<p>\u9019\u662f\u4ee5\u6700\u65b0\u7248Fedora23\u67b6\u8a2d\u7684Ntpc OpenID\u5b78\u751f\u6a94\u6848\u7cfb\u7d71\u3002<\/p>\n<p>http:\/\/mta.sjps.ntpc.edu.tw\/stc\/<\/p>\n<p>\u4e0a\u50b3\u6a21\u7d44\u63a1\u7528\u6700\u65b02015.11.02\u91cb\u51fa\u7684\u7248\u672c CKFinder-3.1-for-PHP-Released\uff0c\u91cb\u51fa\u4e0d\u52301\u500b\u6708\u3002<\/p>\n<p>3.1\u7248\u65b0\u589e\u8207\u4fee\u6b63\u5167\u5bb9\uff1ahttps:\/\/cksource.com\/blog\/CKFinder-3.1-for-PHP-Released<\/p>\n<p>\u7b46\u8005\u65b0\u8a2d\u8a08\u7684\u7cfb\u7d71\uff0c\u4e0a\u50b3\u6a94\u6848\u6ce8\u610f\u4e8b\u9805\uff1a<\/p>\n<p>1.\u5b50\u76ee\u9304\u4e0b\uff0c\u4e0a\u50b3\u6a94\u6848\u6578\u91cf\u9650\u5236\uff1a1000\u500b\u3002<br \/>\n2.\u5982\u679c\u6a94\u540d\u76f8\u540c\u6642\u6703\u8986\u84cb\u5df2\u4e0a\u50b3\u7684\u6a94\u6848\u3002<br \/>\n3.\u6bcf\u500b\u5b78\u751f\u96f2\u7aef\u5bb9\u91cf\u8abf\u9ad8\u70ba2GB\u3002<br \/>\n4.\u55ae\u4e00\u6a94\u6848\u4e0a\u50b3\u9650\u52361GB\u3002<br \/>\n5.\u53ea\u80fd\u522a\u9664\u81ea\u5efa\u7684\u5b50\u76ee\u9304\uff0c\u4e0d\u80fd\u522a\u9664\u6839\u76ee\u9304\u6a94\u6848\u3002<\/p>\n<p>\u6bcf\u500b\u5b78\u751f\u4f7f\u7528Ntpc OpenID\u767b\u5165\u5f8c\uff0c\u6703\u81ea\u52d5\u5efa\u7acb\u4e00\u500b\u5c08\u5c6c\u7684\u96f2\u7aef\u7a7a\u9593\uff0c\u540c\u6642\u4e5f\u5efa\u7f6e\u500b\u4eba\u7db2\u9801\u7a7a\u9593\u3002\u514d\u7533\u8acb\u3001\u514d\u7ba1\u7406\u5e33\u865f\uff0c\u76f8\u7576\u4fbf\u5229\uff01<br \/>\n\u500b\u4eba\u7db2\u9801\u7db2\u5740\u70ba\uff1a http:\/\/mta.sjps.ntpc.edu.tw\/web104\/\u5b78\u751f\u5b78\u865f<\/p>\n<p>\u652f\u63f4\u62d6\u66f3\u65b9\u5f0f\u4e0a\u50b3\u6a94\u6848\uff0c\u5716\u7247\u6216\u7167\u7247\u985e\u578b\u6703\u81ea\u52d5\u88fd\u4f5c\u7e2e\u5716\uff0c\u53ef\u7dda\u4e0a\u700f\u89bd\u6216\u76f4\u63a5\u4e0b\u8f09\u81f3\u672c\u5730\u3002<\/p>\n<p>=====================<\/p>\n<p>vi \/etc\/vsftpd\/vsftpd.conf<\/p>\n<p># chroot)<br \/>\nchroot_local_user=YES<br \/>\nchroot_list_enable=YES<br \/>\n# (default follows)<br \/>\nchroot_list_file=\/etc\/vsftpd\/chroot_list<\/p>\n<p>pam_service_name=vsftpd<br \/>\nuserlist_enable=YES<br \/>\ntcp_wrappers=YES<br \/>\npasv_enable=YES<\/p>\n<p>\u8b93root\u5e33\u865f\u53ef\u4ee5ftp\u767b\u5165<br \/>\nvi \/etc\/vsftpd\/chroot_list<\/p>\n<p>\u52a0\u5165 root<\/p>\n<p>===============<\/p>\n<p>wordpress \u5347\u7d1a\u5931\u6557<br \/>\n\u4f7f\u7528\u8005\u540d\u7a31\u8207\u5bc6\u78bc\u90fd\u6b63\u78ba\uff0c\u9084\u662f\u51fa\u73fe\u932f\u8aa4\u3002<\/p>\n<p>\u932f\u8aa4\u8a0a\u606f\u5982\u4e0b\uff1a<br \/>\n\u9023\u7dda FTP \u4f3a\u670d\u5668 stb.sjps.ntpc.edu.tw:21 \u5931\u6557<\/p>\n<p>\u539f\u56e0\u662fSELinux\u8a2d\u5b9a\u7684\u95dc\u4fc2\uff0c\u89e3\u6c7a\u65b9\u5f0f\u6307\u4ee4\uff1a<br \/>\n# setsebool -P httpd_can_network_connect on<\/p>\n<p>==========<br \/>\nApache log \u8def\u5f91 \/etc\/httpd\/logs\/<br \/>\nVsftpd ftp<br \/>\n\u7981\u6b62sshd \u90e8\u5206\u4f7f\u7528\u8005\u9023\u7dda<br \/>\nvi \/etc\/ssh\/sshd_config<br \/>\n\u65b0\u589e\u4ee5\u4e0b\u5169\u884c<br \/>\nDenyUsers \u4f7f\u7528\u8005\u540d\u7a31<br \/>\nDenyGroups users<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b89\u88ddFedora 23 1.\u4e0b\u8f09\u6700\u65b0\u7248Fedora&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"h5ap_radio_sources":[],"footnotes":""},"categories":[4],"tags":[],"class_list":["post-57","post","type-post","status-publish","format-standard","hentry","category-4","wpcat-4-id"],"_links":{"self":[{"href":"https:\/\/tygtw.ddns.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/57","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tygtw.ddns.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tygtw.ddns.net\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tygtw.ddns.net\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tygtw.ddns.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=57"}],"version-history":[{"count":0,"href":"https:\/\/tygtw.ddns.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/57\/revisions"}],"wp:attachment":[{"href":"https:\/\/tygtw.ddns.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=57"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tygtw.ddns.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=57"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tygtw.ddns.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=57"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}