{"id":212,"date":"2019-07-10T17:57:29","date_gmt":"2019-07-10T09:57:29","guid":{"rendered":"http:\/\/www.mustenaka.cn\/?p=212"},"modified":"2019-07-14T19:27:15","modified_gmt":"2019-07-14T11:27:15","slug":"ubuntusysteminstallappache2","status":"publish","type":"post","link":"https:\/\/www.mustenaka.cn\/index.php\/2019\/07\/10\/ubuntusysteminstallappache2\/","title":{"rendered":"ubuntu\u7cfb\u5217\u7cfb\u7edf\u5b89\u88c5apache\u5e76\u7981\u6b62\u5176\u5f00\u673a\u542f\u52a8"},"content":{"rendered":"<p>\u672c\u6587\u5206\u4e3a\u4e24\u4e2a\u5185\u5bb9\uff0c\u5b89\u88c5appache\u670d\u52a1\u548c\u9759\u6b62\u5176\u5f00\u673a\u542f\u52a8<\/p>\n<p><!--more--><\/p>\n<h1>1.\u5b89\u88c5apache\u670d\u52a1\uff1a<\/h1>\n<pre class=\"pure-highlightjs\"><code class=\"\" bash=\"\">sudo apt-get install apache2<\/code><\/pre>\n<p>\u76f4\u63a5\u8f93\u5165apt\u5b89\u88c5\u7684\u547d\u4ee4\u4e0b\u8f7d\u5e76\u81ea\u52a8\u5b89\u88c5apache2\u670d\u52a1<\/p>\n<p>\u7136\u540e\u542f\u52a8apache2\u670d\u52a1\uff0cstart\uff0c\u76f8\u5173\u547d\u4ee4\u5982\u4e0b\u3010\u6ce8\u610f\uff0c\u90e8\u5206linux\u53d1\u884c\u7248\u4e5f\u5199\u4f5chttpd\u3011\uff1a<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\" bash=\"\">sudo service apache2 start   #\u542f\u52a8\u670d\u52a1\r\nsudo service apache2 restart  #\u91cd\u542f\u670d\u52a1\r\nsudo service apache2 status   #\u67e5\u770b\u670d\u52a1\u72b6\u6001\r\nsudo service apache2 stop    #\u5173\u95ed\u670d\u52a1<\/code><\/pre>\n<h1>2.\u9759\u6b62apache2\u5f00\u673a\u542f\u52a8<\/h1>\n<p>\u7531\u4e8e\u81ea\u5df1\u7684ubuntu\u7cfb\u7edf\u662f\u5f00\u53d1\u673a\u5668\uff0c\u5e76\u4e0d\u9700\u8981\u957f\u671f\u6253\u5f00apache\uff0c\u56e0\u6b64\u6211\u4eec\u9700\u8981\u7981\u6b62\u5176\u5f00\u673a\u542f\u52a8\u3002<\/p>\n<p>\u4e3a\u4e86\u9759\u6b62\u5176\u5f00\u673a\u542f\u52a8\uff0c\u6211\u4eec\u9700\u8981\u5b89\u88c5\u4e00\u6b3e\u5728\u7ec8\u7aef\u8fd0\u884c\u7684\u5f00\u673a\u542f\u52a8\u9879\u7ba1\u7406\u5668sysv-rc-conf<\/p>\n<p>\u5148\u5c1d\u8bd5\u76f4\u63a5\u5b89\u88c5<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\" bash=\"\">sudo apt-get install sysv-rc-conf<\/code><\/pre>\n<p>\u5931\u8d25\u4e86\uff0c\u539f\u56e0\u662f\u6ca1\u6709\u6dfb\u52a0\u76f8\u5173\u8f6f\u4ef6\u6e90\uff0c\u56e0\u6b64\u6dfb\u52a0\u8f6f\u4ef6\u6e90\uff1a<\/p>\n<p>\u4f7f\u7528vim\u8fdb\u884c\u6587\u4ef6\u7f16\u8f91\uff1a<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\" bash=\"\">sudo vim \/etc\/apt\/sources.list<\/code><\/pre>\n<p>\u5728\u6587\u4ef6\u672b\u5c3e\u6dfb\u52a0\uff1a<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\" bash=\"\">#add mirror ---- sysv-rc-conf\r\ndeb http:\/\/archive.ubuntu.com\/ubuntu\/ trusty main universe restricted multiverse<\/code><\/pre>\n<p>\u4e4b\u540e\u66f4\u65b0\u518d\u5b89\u88c5\u5373\u53ef\uff1a<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\" bash=\"\">sudo apt update\r\nsudo install sysv-rc-conf<\/code><\/pre>\n<p>\u76f4\u63a5\u4f7f\u7528<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\" null=\"\">sudo sysv-rc-conf #\u67e5\u770b\u670d\u52a1\u5f00\u673a\u542f\u52a8\u72b6\u6001<\/code><\/pre>\n<p>\u8fd0\u884c\u7ea7\u522b\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>runlevel<\/th>\n<th>target<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>0<\/td>\n<td>\u5173\u673a<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>\u5355\u7528\u6237<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>\u591a\u7528\u6237\u6a21\u5f0f\uff0c\u6ca1\u6709NFS\u7f51\u7edc\u652f\u6301<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>\u5b8c\u6574\u7684\u591a\u7528\u6237\u6587\u672c\u6a21\u5f0f\uff0c\u6709NFS\uff0c\u767b\u5f55\u540e\u8fdb\u5165\u63a7\u5236\u53f0\u547d\u4ee4\u884c\u6a21\u5f0f<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>\u4fdd\u7559<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>\u542b\u6709\u56fe\u5f62\u754c\u9762\u6a21\u5f0f<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>\u91cd\u542f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>\u63a5\u7740\u6211\u4eec\u53ef\u4ee5\u5c1d\u8bd5\u8f93\u5165\u963b\u6b62\u5176\u542f\u52a8\u65f6\u5b50\u542f\u52a8<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\" bash=\"\">sudo systemctl disable apache2   #\u963b\u6b62\u5f00\u673a\u542f\u52a8\r\nsudo systemctl enable apache2    #\u5141\u8bb8\u5f00\u673a\u542f\u52a8<\/code><\/pre>\n<p>\u6b64\u5916\u8fd8\u53ef\u4ee5\u8f93\u5165\uff1a<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\" bash=\"\">sudo update-rc.d apache2 disable   #\u963b\u6b62\u5f00\u673a\u542f\u52a8\r\nsudo update-rc.d apache2 enable    #\u5141\u8bb8\u5f00\u673a\u542f\u52a8\r\n<\/code><\/pre>\n<p>\u53c2\u8003\u6587\u7ae0\uff1a<a href=\"https:\/\/www.helplib.com\/ubuntu\/article_158200\">https:\/\/www.helplib.com\/ubuntu\/article_158200<\/a><\/p>\n<p>\u4ee5\u540e\u5728\u6211\u4eec\u9700\u8981\u542f\u52a8\u670d\u52a1\u8fdb\u884c\u8f6f\u4ef6\u6d4b\u8bd5\u7684\u65f6\u5019\u76f4\u63a5\u5728\u7ec8\u7aef\u8f93\u5165\uff1a<\/p>\n<p><code class=\"\" bash=\"\">sudo service apache2 start<\/code><\/p>\n<p>\u5373\u53ef<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u5206\u4e3a\u4e24\u4e2a\u5185\u5bb9\uff0c\u5b89\u88c5appache\u670d\u52a1\u548c\u9759\u6b62\u5176\u5f00\u673a\u542f\u52a8<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3],"tags":[7,2],"class_list":["post-212","post","type-post","status-publish","format-standard","hentry","category-linux","category-buildblog","tag-linux","tag-build_blog"],"views":2093,"_links":{"self":[{"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/posts\/212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/comments?post=212"}],"version-history":[{"count":2,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/posts\/212\/revisions"}],"predecessor-version":[{"id":222,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/posts\/212\/revisions\/222"}],"wp:attachment":[{"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/media?parent=212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/categories?post=212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/tags?post=212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}