{"id":447,"date":"2015-07-03T11:43:34","date_gmt":"2015-07-03T03:43:34","guid":{"rendered":"http:\/\/lihua.me\/zh\/?p=447"},"modified":"2015-07-03T11:45:27","modified_gmt":"2015-07-03T03:45:27","slug":"ubuntu-server","status":"publish","type":"post","link":"https:\/\/lihua.me\/zh\/ubuntu-server\/","title":{"rendered":"Ubuntu Server"},"content":{"rendered":"<h3>Ubuntu Server \u7684\u5b89\u88c5\u4e0e\u914d\u7f6e<\/h3>\n<p><strong>1.1 Ubuntu Server \u5b89\u88c5<\/strong><\/p>\n<p>\u8be6\u89c1\uff1a<a href=\"http:\/\/www.osyunwei.com\/archives\/3708.html\">\u94fe\u63a5\u4e00<\/a> \uff0c<a href=\"http:\/\/autumncher.pixnet.net\/blog\/post\/376039643-%E3%80%90linux%E3%80%91%E5%A6%82%E4%BD%95%E5%AE%89%E8%A3%9Dubuntu-server-14.04-lts-%28how-to-insta\">\u94fe\u63a5\u4e8c<\/a><\/p>\n<p><strong>1.2 Ubuntu Server \u7684\u76f8\u5173\u914d\u7f6e\uff1a\u5982\u4f55\u8bbe\u7f6e root \u5bc6\u7801<\/strong><\/p>\n<p>Ubuntu \u9ed8\u8ba4\u6bcf\u6b21\u5f00\u673a\u90fd\u6709\u4e00\u4e2a\u65b0\u7684 root \u5bc6\u7801\u3002\u5728\u7ec8\u7aef\u8f93\u5165 sudo passwd\uff0c\u7136\u540e\u8f93\u5165\u5f53\u524d\u7528\u6237\u7684\u5bc6\u7801\uff0c\u7ec8\u7aef\u4f1a\u63d0\u793a\u6211\u4eec\u8f93\u5165\u65b0\u7684\u5bc6\u7801\u5e76\u786e\u8ba4\uff0c\u5373 root \u65b0\u5bc6\u7801\u3002\u4fee\u6539\u6210\u529f\u540e\uff0c\u8f93\u5165\u547d\u4ee4 su root\uff0c\u518d\u8f93\u5165\u65b0\u7684\u5bc6\u7801\u3002\uff08<a href=\"http:\/\/www.cnblogs.com\/xuyingying\/archive\/2008\/10\/16\/1312584.html\">\u6765\u6e90<\/a>\uff09<\/p>\n<p><strong>1.3 Ubuntu Server \u7684\u76f8\u5173\u914d\u7f6e\uff1a\u5982\u4f55\u8bbe\u7f6eIP\u5730\u5740\u3001\u7f51\u5173\u3001DNS<\/strong><\/p>\n<p>1.3.1 \u5982\u679c\u5728\u5b89\u88c5\u65f6\u6ca1\u6709\u8bbe\u7f6e IP \u5730\u5740\uff0c\u5219\u9700\u8981\u8bbe\u7f6e IP \u5730\u5740\uff0c<\/p>\n<p>1.3.1.1 \u67e5\u770b IP \u5730\u5740\u7684\u547d\u4ee4\uff1aifconfig\uff1b<\/p>\n<p>1.3.1.2 \u8bbe\u7f6e\u4e34\u65f6 IP \uff1a<\/p>\n<p>iconfig eth0 192.168.1.99 netmask 255.255.255.0 up<\/p>\n<p>\u91cd\u542f\u4e4b\u540e\uff0c\u8bbe\u7f6e\u7684 IP \u5730\u5740\u4f1a\u88ab\u91cd\u7f6e<\/p>\n<p>2.3.1.3 \u6c38\u4e45\u4fee\u6539 IP \u5730\u5740\uff1a<\/p>\n<p>sudo nano \/etc\/network\/interfaces \/etc\/network\/interfacesbak #\u5907\u4efd\u539f\u6709\u914d\u7f6e\u6587\u4ef6<br \/>\nsudo nano \/etc\/network\/interfaces #\u7f16\u8f91\u7f51\u7f51\u5361\u914d\u7f6e\u6587\u4ef6<br \/>\nauto lo<br \/>\niface lo inet loopback<br \/>\n#\u5f00\u673a\u81ea\u52a8\u8fde\u63a5\u7f51\u7edc<br \/>\niface eth0 inet static #static\u8868\u793a\u4f7f\u7528\u56fa\u5b9aip\uff0cdhcp\u8868\u8ff0\u4f7f\u7528\u52a8\u6001ip<br \/>\naddress 192.168.1.99 #\u8bbe\u7f6eip\u5730\u5740<br \/>\nnetmask 255.255.255.0 #\u8bbe\u7f6e\u5b50\u7f51\u63a9\u7801<br \/>\ngateway 192.168.1.1 #\u8bbe\u7f6e\u7f51\u5173<\/p>\n<p>2.3.1.4 Ubuntu Server \u8bbe\u7f6e DNS<\/p>\n<p>sudo nano \/etc\/resolv.conf #\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6,\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9<br \/>\nnameserver 114.114.114.114 #\u8bbe\u7f6e\u9996\u9009dns<br \/>\nnameserver 8.8.8.8 #\u8bbe\u7f6e\u5907\u7528dns<\/p>\n<p>\u8bbe\u7f6e\u4e4b\u540e\u91cd\u542f\u7f51\u7edc\u751f\u6548<\/p>\n<p>\/etc\/init.d\/networking restart #\u91cd\u542f\u7f51\u7edc<\/p>\n<p>\u81f3\u6b64\uff0cIP\u5730\u5740\u3001\u7f51\u5173\u3001DNS\u914d\u7f6e\u5b8c\u6210\uff0c\u73b0\u5728\u7cfb\u7edf\u5df2\u7ecf\u53ef\u4ee5\u4e0a\u7f51\u4e86\u3002<\/p>\n<p>1.3.2 \u66f4\u6539\u6e90<\/p>\n<p><a href=\"http:\/\/mirrors.163.com\/.help\/ubuntu.html\">http:\/\/mirrors.163.com\/.help\/ubuntu.html<\/a><\/p>\n<p>1.3.3 \u5b89\u88c5 Apache<\/p>\n<p>sudo apt-get update<br \/>\nsudo apt-get install apache2<\/p>\n<p>1.3.4 \u5b89\u88c5 Mysql<\/p>\n<p>sudo apt-get install mysql-server php5-mysql<\/p>\n<p>\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u4f1a\u8981\u6c42\u8f93\u5165 mysql \u7684 root \u5bc6\u7801\uff1b<\/p>\n<p>\u53c2\u8003\uff1a <a href=\"http:\/\/www.cnblogs.com\/shuang\/archive\/2008\/12\/04\/1347883.html%0A\">MySQL \u547d\u4ee4\u884c\u64cd\u4f5c\u8bf4\u660e<\/a>\uff1b<\/p>\n<p>2.3.4 \u5b89\u88c5 PHP \u53ca PHP \u7ec4\u4ef6<\/p>\n<p>2.3.5 \u4e0b\u8f7d OwnCloud \u670d\u52a1\u7aef\u4ee3\u7801\uff0c\u5e76\u90e8\u7f72<\/p>\n<p>2.3.5.1 \u8fdb\u5165\u5230 \/var\/www\/html\uff0c\u4e0b\u8f7d Owncloud \u4ee3\u7801\uff0cwget http:\/\/xxxx<\/p>\n<p>2.3.5.1 \u5220\u9664\u539f\u6765\u7684 html \u6587\u4ef6\u5939\uff0c\u89e3\u538b Owncloud \u538b\u7f29\u5305\uff0c\u5e76\u6539\u540d\u4e3a hmtl\u3002\u76f8\u5173\u547d\u4ee4<\/p>\n<ul>\n<li>\u5220\u9664\u539f\u6765\u7684 html \u6587\u4ef6\u5939\uff1a rm -rf html<\/li>\n<li>\u89e3\u5f00 OwnCloud.zip \u538b\u7f29\u5305\uff1a unzip owncloud.zip<\/li>\n<li>\u6216\u8005\u89e3\u5f00 OwnCloud.tar.bz2 \u538b\u7f29\u5305\uff1a tar -xf owncloud.tar.bz2<\/li>\n<li>\u5c06 owncloud \u6587\u4ef6\u5939\u6539\u540d\u4e3a html: mv owncloud html<\/li>\n<li>\u8bbe\u7f6e html \u6587\u4ef6\u5939\u7684\u8bfb\u5199\u6743\u9650\uff1a chmod 770 html\uff0c \u53c2\u8003\uff1a <a href=\"http:\/\/owncloud.10557.n7.nabble.com\/Can-t-write-into-config-directory-ownCloud-7-CentOS-7-td13165.html\">owncloud \u7684\u6587\u4ef6\u5939\u6743\u9650<\/a><\/li>\n<\/ul>\n<p>2.3.6 \u8bbf\u95ee http:\/\/ip\/\uff0c\u521d\u59cb\u5316 owncloud \u7a0b\u5e8f\uff1b<\/p>\n<p>\u76f8\u5173\u94fe\u63a5\uff1a<\/p>\n<ul>\n<li><a href=\"http:\/\/lihua.me\/zh\/web-hosting-shell-command\/\">Shell \u547d\u4ee4<\/a>\uff1b<\/li>\n<li><a href=\"https:\/\/doc.owncloud.org\/server\/8.0\/admin_manual\/installation\/source_installation.html#example-installation-on-ubuntu-14-04-lts-server\">https:\/\/doc.owncloud.org\/server\/8.0\/admin_manual\/installation\/source_installation.html#example-installation-on-ubuntu-14-04-lts-server<\/a><\/li>\n<li><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu\">https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu<\/a><\/li>\n<li><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-14-04\">https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-14-04<\/a><\/li>\n<\/ul>\n<p>\u5176\u4ed6\u53c2\u8003\u5185\u5bb9\uff1a<\/p>\n<p>\u91cd\u542f\u547d\u4ee4\uff1a<\/p>\n<ol>\n<li>reboot<\/li>\n<li>shutdown -r now \u7acb\u523b\u91cd\u542f(root\u7528\u6237\u4f7f\u7528)<\/li>\n<li>shutdown -r 10 \u8fc710\u5206\u949f\u81ea\u52a8\u91cd\u542f(root\u7528\u6237\u4f7f\u7528)<\/li>\n<li>shutdown -r 20:35 \u5728\u65f6\u95f4\u4e3a20:35\u65f6\u5019\u91cd\u542f(root\u7528\u6237\u4f7f\u7528)<\/li>\n<\/ol>\n<p>\u5982\u679c\u662f\u901a\u8fc7shutdown\u547d\u4ee4\u8bbe\u7f6e\u91cd\u542f\u7684\u8bdd\uff0c\u53ef\u4ee5\u7528shutdown -c\u547d\u4ee4\u53d6\u6d88\u91cd\u542f<\/p>\n<p>\u5173\u673a\u547d\u4ee4\uff1a<\/p>\n<ol>\n<li>halt \u7acb\u523b\u5173\u673a<\/li>\n<li>poweroff \u7acb\u523b\u5173\u673a<\/li>\n<li>shutdown -h now \u7acb\u523b\u5173\u673a(root\u7528\u6237\u4f7f\u7528)<\/li>\n<li>shutdown -h 10 10\u5206\u949f\u540e\u81ea\u52a8\u5173\u673a<\/li>\n<\/ol>\n<p>sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt<br \/>\nsudo apt-get install mariadb-server libapache2-mod-php5<br \/>\napt-get install php5-gd php5-json php5-mysql php5-curl<br \/>\napt-get install php5-intl php5-mcrypt php5-imagick<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu Server \u7684\u5b89\u88c5\u4e0e\u914d\u7f6e 1.1 Ubuntu Server \u5b89\u88c5 \u8be6\u89c1\uff1a\u94fe\u63a5\u4e00 \uff0c\u94fe\u63a5\u4e8c 1 &hellip; <a href=\"https:\/\/lihua.me\/zh\/ubuntu-server\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">Ubuntu Server<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":1,"footnotes":""},"categories":[322],"tags":[],"class_list":["post-447","post","type-post","status-publish","format-standard","hentry","category-pc"],"_links":{"self":[{"href":"https:\/\/lihua.me\/zh\/wp-json\/wp\/v2\/posts\/447","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lihua.me\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lihua.me\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lihua.me\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lihua.me\/zh\/wp-json\/wp\/v2\/comments?post=447"}],"version-history":[{"count":0,"href":"https:\/\/lihua.me\/zh\/wp-json\/wp\/v2\/posts\/447\/revisions"}],"wp:attachment":[{"href":"https:\/\/lihua.me\/zh\/wp-json\/wp\/v2\/media?parent=447"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lihua.me\/zh\/wp-json\/wp\/v2\/categories?post=447"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lihua.me\/zh\/wp-json\/wp\/v2\/tags?post=447"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}