{"id":5280,"date":"2016-09-05T11:49:32","date_gmt":"2016-09-05T03:49:32","guid":{"rendered":"https:\/\/sdeno.com\/?p=5280"},"modified":"2017-08-15T16:42:22","modified_gmt":"2017-08-15T08:42:22","slug":"ubuntu%e5%ae%89%e8%a3%85%e9%85%8d%e7%bd%aeapache","status":"publish","type":"post","link":"https:\/\/sdeno.com\/?p=5280","title":{"rendered":"ubuntu\u5b89\u88c5\u914d\u7f6eapache"},"content":{"rendered":"<p>\u63a8\u8350\u5b89\u88c5\u987a\u5e8f<\/p>\n<p>\u624b\u52a8\u5b89\u88c5\u987a\u5e8f\uff1a<br \/>\n1. \u5b89\u88c5Apache \u53c2\u8003\uff1a\u300a<a href=\"https:\/\/sdeno.com\/?p=5280\" target=\"_blank\" rel=\"noopener\">ubuntu\u5b89\u88c5\u914d\u7f6eapache<\/a>\u300b<br \/>\n2. \u5b89\u88c5MySQL \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u300a<a href=\"https:\/\/sdeno.com\/?p=5262\" target=\"_blank\" rel=\"noopener\">ubuntu\u5b89\u88c5mysql<\/a>\u300b<br \/>\n3. \u5b89\u88c5PHP \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u300a<a href=\"https:\/\/sdeno.com\/?p=5313\" target=\"_blank\" rel=\"noopener\">ubuntu\u5b89\u88c5php 7.0<\/a>\u300b<br \/>\n4.\u5b89\u88c5phpmyadmin \u00a0 \u00a0\u300a<a href=\"https:\/\/sdeno.com\/?p=5346\" target=\"_blank\" rel=\"noopener\">ubuntu\u5b89\u88c5\u914d\u7f6ephpmyadmin<\/a>\u300b<br \/>\n5. \u914d\u7f6eApache\u3001PHP<br \/>\n\u662f\u4e3a\u4e86\u9020\u6210\u4e00\u4e9b\u4e0d\u5fc5\u8981\u7684\u9ebb\u70e6<\/p>\n<p>\u5b89\u88c5\uff1a<\/p>\n<pre>sudo apt-get install apache2<\/pre>\n<p>&nbsp;<\/p>\n<p>\u91cd\u542f\uff1a<\/p>\n<pre>sudo \/etc\/init.d\/apache2 restart<\/pre>\n<p>&nbsp;<\/p>\n<p>\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u8f93\u5165127.0.0.1\u6216\u7740localhost\uff0c\u5982\u56fe\u6240\u89c6\u51fa\u73b0apache2\u6b64\u9875\u9762\u8bf4\u660e\u60a8\u5df2\u7ecf\u5b89\u88c5\u6210\u529f\uff0c\u670d\u52a1\u5668\u4e5f\u5df2\u7ecf\u6b63\u5e38\u542f\u52a8\u3002<\/p>\n<a href=\"https:\/\/sdeno.com\/wp-content\/uploads\/2016\/09\/ubuntu_apache1.jpg\"><figure class=\"mdx-lazyload-container\" style=\"max-width:835px\"><div style=\"padding-top:18.562874251497%\"><\/div><div class=\"mdx-img-loading-sp mdui-valign\"><div><div class=\"mdui-spinner\"><\/div><\/div><\/div><img width=\"835\" height=\"155\" class=\"alignnone size-full wp-image-5282 lazyload\" title=\"ubuntu_apache1\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" data-src=\"https:\/\/sdeno.com\/wp-content\/uploads\/2016\/09\/ubuntu_apache1.jpg\" alt=\"ubuntu_apache1\" data-srcset=\"https:\/\/sdeno.com\/wp-content\/uploads\/2016\/09\/ubuntu_apache1.jpg 835w, https:\/\/sdeno.com\/wp-content\/uploads\/2016\/09\/ubuntu_apache1-300x55.jpg 300w\" sizes=\"auto, (max-width: 835px) 100vw, 835px\"><\/figure><\/a>\n<p>\u6ce8\u610f\uff1a\u914d\u7f6e\u6587\u4ef6\u4ecehttpd.conf\u53d8\u6210\u4e86apache2.conf<\/p>\n<p>\u7ed9\u9ed8\u8ba4www\u76ee\u5f55\u6743\u9650<\/p>\n<pre>chmod -R 777 \/var\/www\/html<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\">\u4fee\u6539apache2\u9ed8\u8ba4\u4e3b\u9875<\/span><\/p>\n<p>\u672c\u4eba\u7cfb\u7edf\u662fubuntu 16.04 \u00a0 \u00a0 \u00a0apache\u7248\u672c\u662f Apache\/2.4.18<\/p>\n<pre>\u4fee\u6539\/etc\/apache2\/mods-available\/dir.conf<\/pre>\n<p>\u9ed8\u8ba4\u662f\uff1a<\/p>\n<pre>&lt;IfModule mod_dir.c&gt;\r\n    DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm \r\n&lt;\/IfModule&gt;<\/pre>\n<p>\u5c06php\u683c\u5f0f\u7684\u653e\u5728\u6700\u524d\u9762<\/p>\n<pre>&lt;IfModule mod_dir.c&gt;\r\n    DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm \r\n&lt;\/IfModule&gt;<\/pre>\n<p>&nbsp;<\/p>\n<p>\u91cd\u542fapache<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\">\u68c0\u67e5apache\u662f\u5426\u52a0\u8f7d\u5230php\u6a21\u5757<\/span><br \/>\n\u5f53apache\u8981\u548cphp\u914d\u5408\u4f7f\u7528\u65f6\uff0capache\u5fc5\u987b\u8981\u52a0\u8f7dphp\u7684\u6a21\u5757\u624d\u80fd\u6307\u6325php\u5de5\u4f5c\uff0c\u8fd9\u91cc\u9700\u8981\u5230libphp7.0.so\u7684\u6a21\u5757,<br \/>\n\u7248\u672c\u53f7\u6839\u636e\u5b89\u88c5php\u7684\u4e3a\u51c6\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5apache\u662f\u5426\u52a0\u8f7d\u4e86php\u6a21\u5757<br \/>\ncat \/etc\/apache2\/mods-enabled\/php7.0.load<br \/>\n\u5982\u679c\u8fd4\u56de\u6709 &#8220;LoadModule php7_module \/usr\/lib\/apache2\/modules\/libphp7.0.so&#8221;<br \/>\n\u7c7b\u4f3c\u7684\u5b57\u6837\u8bf4\u660e\u5df2\u7ecf\u5b89\u88c5\u6210\u529f\u4e86<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>\u5982\u679c\u5b89\u88c5\u4e86 phpmyadmin \u9700\u8981\u5bfc\u5165\u6570\u636e\u5e93\u53ef\u80fd\u4f1a\u88ab\u9650\u5236\u5927\u5c0f\u8fd9\u65f6\u5019\u9700\u8981\u4fee\u6539<\/p>\n<pre>\/etc\/php\/7.0\/apache2\/php.ini<\/pre>\n<p>upload_max_filesiz\u548cpost_max_size \u628a\u6570\u503c\u6539\u5927\u4e9b<\/p>\n<p>\u300a<a href=\"https:\/\/sdeno.com\/?p=2128\" target=\"_blank\" rel=\"noopener\">\u89e3\u51b3\u201c\u60a8\u53ef\u80fd\u6b63\u5728\u4e0a\u4f20\u5f88\u5927\u7684\u6587\u4ef6\uff0c\u8bf7\u53c2\u8003\u6587\u6863\u6765\u5bfb\u627e\u89e3\u51b3\u65b9\u6cd5\u3002\u201d<\/a>\u300b<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\">\u5f00\u653e\u7aef\u53e3<\/span><\/p>\n<p>\u5982\u679c\u4f60\u9700\u8981\u4e00\u4e2aapache\u591a\u5f00\u51e0\u4e2a\u7f51\u7ad9\uff0c\u90a3\u4e48\u4e5f\u9700\u8981\u5f00\u653e\u51fa\u591a\u51e0\u4e2a\u7aef\u53e3<\/p>\n<p>\u4fee\u6539\u6587\u4ef6\uff1a<\/p>\n<pre>\/etc\/apache2\/ports.conf<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\">\u914d\u7f6e\u6587\u4ef6\u53ca\u76ee\u5f55\u4ecb\u7ecd<\/span><\/p>\n<p>\u914d\u7f6e\u6587\u4ef6\u4e00\u822c\u5728 \/etc\/apache2\/<\/p>\n<p>apache2.conf \u662f\u4e3b\u5165\u53e3\uff0c\u5176\u4e2d\u4e5f\u5305\u542b\u4e86\u4ee5\u4e0b4\u4e2a\u91cd\u8981\u76ee\u5f55<br \/>\nmods-available\/ apache\u4e2d\u7684\u5b58\u653e\u6240\u6709\u6a21\u5757\u7684\u76ee\u5f55<br \/>\nmods-enabled\/ apache\u5df2\u7ecf\u52a0\u8f7d\u6a21\u5757\u7684\u76ee\u5f55 \uff0c\u52a0\u8f7d\u65b9\u5f0f\u4f7f\u7528\u8f6f\u94fe\u63a5\u65b9\u6cd5\u8c03\u7528<br \/>\n\uff0c\u4f8b\u5982sudo ln -s \/mods-available\/php7.0.load \/mods-enabled\/php7.0.load<\/p>\n<p>sites-available\/ \u865a\u62df\u4e3b\u673a<br \/>\nsites-enabled\/<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\">\u57df\u540d\u7ed1\u5b9a<\/span><br \/>\n\u60c5\u666f\uff0c\u6709\u4e24\u4e2a\u57df\u540d\u4e00\u4e2a\u662f jquery.xgllseo.com avalon.xgllseo.com<br \/>\n\u76ee\u5f55\u5206\u522b\u662f \/var\/wwwroot\/jquery \/var\/wwwroot\/avalon<br \/>\n1\uff0c\u8fdb\u5165\u5230\/etc\/apache2\/sites-available\/\u76ee\u5f55\u4e2d\u3002<br \/>\n2\uff0c\u5c06default\u590d\u5236\u5206\u522b\u547d\u540d\u4e3a jquery avalon<br \/>\n3\uff0c\u7f16\u8f91jquery avalon\u8fd9\u4e24\u4e2a\u6587\u4ef6\uff0c\u5206\u522b\u6dfb\u52a0ServerName jquery.xgllseo.com\u548c\u4fee\u6539\u76ee\u5f55\/var\/wwwroot\/jquery<br \/>\n4\uff0c\u8fdb\u5165\u5230 sites-enabled\/\u76ee\u5f55\u521b\u5efa\u8f6f\u94fe\u63a5\uff0csudo ln -s ..\/sites-available\/jquery.conf\u00a0jquery.conf<br \/>\n\u610f\u601d\u5c31\u662f\u5728sites-enabled\/\u76ee\u5f55\u4e2d\u521b\u5efa\u4e86\u4e00\u4e2a\u8f6f\u94fe\u63a5\u4e3ajquery_ok<br \/>\n5\uff0c\u91cd\u542fapache\u3002 sudo service apache2 restart<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/www.linuxidc.com\/Linux\/2015-07\/120724.htm\" target=\"_blank\" rel=\"noopener\">http:\/\/www.linuxidc.com\/Linux\/2015-07\/120724.htm<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a8\u8350\u5b89\u88c5\u987a\u5e8f \u624b\u52a8\u5b89\u88c5\u987a\u5e8f\uff1a 1. \u5b89\u88c5Apache \u53c2\u8003\uff1a\u300aubuntu\u5b89\u88c5\u914d\u7f6eapache\u300b 2. \u5b89\u88c5M [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[39],"tags":[],"class_list":["post-5280","post","type-post","status-publish","format-standard","hentry","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/5280","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5280"}],"version-history":[{"count":0,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/5280\/revisions"}],"wp:attachment":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}