本教程不僅限于衡天主機,也適用于其他LINUX VPS
許多朋友在拿到VPS的ip和root密碼之后不知道下一步該怎么做。
其實首先需要明確一個目的“你買VPS是要做什么?為什么買VPS?”
有了這個目的就好辦了。有的朋友說“我要放網站”
那么,你要放什么程序?不同的程序所需求的環境是不一樣的,例如?WordPress?和?Typecho?需要?PHP+Mysql,GHost?需要?Nodejs?。
而且不同的程序需要的軟件版本也不一樣,例如許多軟件要求PHP版本為5.2,有一些則要求PHP版本為5.3 。
都需要根據軟件的需求來安裝合適版本的軟件。
有位朋友要安裝?PHPCMS,我查了一下,是需要?PHP5.2,在?PHP5.3?下運行問題比較多。
那么就開始部署吧。
我個人比較推薦使用一鍵包或者使用面板。
AMH?http://www.amysql.com/AMH.htm
virtualmin?http://www.virtualmin.com/
WDCP?http://www.wdlinux.cn/wdcp/
LNMP?http://lnmp.org/
DirectAdmin?http://www.directadmin.com/
新手朋友比較推薦付費的DirectAdmin和免費的AMH。
因為?PHPCMS?需要?PHP5.2?版本,并且這位朋友也是新手,所以就安裝?DirectAdmin?了。
首先,鏈接SSH客戶端,推薦使用?Putty?和?Xshell。
鏈接后使用?cat /etc/redhat-release?命令查看當前服務器版本。
[root@vps ~]# cat /etc/redhat-release
CentOS release 6.5 (Final)
查看32或者64bits
[root@vps ~]# uname -a
Linux vps.xxx.com 2.6.32-431.el6.i686 #1 SMP Fri Nov 22 00:26:36 UTC 2013 i686 i686 i386 GNU/Linux
開始部署
安裝依賴
yum -y install unzip zip lftp tar quota nano mutt gcc gcc-c++ flex make perl gd bison openssl-devel bind patch libaio screen
建立screen會話【一定要建立screen會話,不然SSH斷開就壞了】
screen -S DA
下載安裝腳本
wget http://www.directadmin.com/setup.sh
chmod 755 setup.sh
執行安裝腳本
./setup.sh
然后會要求輸入授權ID和客戶ID (這個可以到官方網站購買)
Please enter your Client ID : 0000 #這里輸入Client ID
Please enter your License ID : 0000 #這里輸入License ID
Please enter your hostname \(server.domain.com\)
It must be a Fully Qualified Domain Name
Do *not* use a domain you plan on using for the hostname:
eg. don't use domain.com. Use server.domain.com instead.
Do not enter http:// or www
Enter your hostname (FQDN) : vps.123.com ##這里輸入hostname,不建議使用自己的域名,可以隨便寫個
Client ID: 0000
License ID: 0000
Hostname: vps.shebao12333.com
Is this correct? (y,n) : y #確認以上信息是否有誤,沒有錯誤輸入y
Is eth0 your network adaptor with the license IP (103.000.00.000)? (y,n) : y #確認IP是否有誤,無誤輸入y
Is 103.000.00.000 the IP in your license? (y,n) : y #確認該IP是否為授權IP,無誤輸入y
Is this correct? (y,n) : y #再次確認是否正確,正確輸入y
......
You now have 4 options for your apache/php setup.
1: customapache: end-of-life software. Apache 1.3, php 4, frontpage. Do not use. No support.
2: custombuild 1.1: older software. Apache 2.x, php 4, 5, or both in cli and/or suphp. Defaults to php 5.2
3: custombuild 1.2: * Recommended. simlar to 1.1, newer default versions. Apache 2.x, php 5, 6, or both in cli and/or suphp. Defaults to php 5.3
4: custombuild 2.0 ALPHA: Not yet recommended, still in testing. Apache 2.4, mod_ruid2, php 5.4. Can be set to use php-FPM. Experts only. Requires pre-release binaries.
Post any issues with custombuild to the forum: http://www.directadmin.com/forum/forumdisplay.php?f=61
Enter your choice (1, 2, 3 or 4): 2 #根據需求選擇你的軟件版本
You have chosen custombuild 1.1.
--2014-06-19 10:10:40-- http://files.directadmin.com/services/custombuild/1.1/custombuild/build
Resolving files.directadmin.com... 69.30.193.202, 216.144.254.90
Connecting to files.directadmin.com|69.30.193.202|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 320299 (313K) [text/plain]
Saving to: `/usr/local/directadmin/custombuild/build'
100%[=======================================================================================================================================================================================>] 320,299 222K/s in 1.4s
2014-06-19 10:10:43 (222 KB/s) - `/usr/local/directadmin/custombuild/build' saved [320299/320299]
Would you like the default settings of apache 2.2 and php 5.2 cli? (y/n): n
You have chosen to customize the custombuild options. Please wait while options configurator is downloaded...
Cannot find /usr/local/directadmin/custombuild/options.conf, writing defaults.
Downloading versions.txt...
--2014-06-19 10:10:49-- http://files.directadmin.com/services/custombuild/versions.txt
Resolving files.directadmin.com... 69.30.193.202, 216.144.254.90
Connecting to files.directadmin.com|69.30.193.202|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8471 (8.3K) [text/plain]
Saving to: `/usr/local/directadmin/custombuild/versions.txt'
100%[=======================================================================================================================================================================================>] 8,471 22.0K/s in 0.4s
2014-06-19 10:10:49 (22.0 KB/s) - `/usr/local/directadmin/custombuild/versions.txt' saved [8471/8471]
#以下內容根據需求選擇即可
Would you like to backup the current options.conf? (yes/no): yes
Backup created: /usr/local/directadmin/custombuild/options.conf.20140619101106.backup
Would you like to have PHP4 or PHP5 as default? (4/5): 5
Would you like to have PHP5? (yes/no): yes
Would you like to have PHP5 as CLI or CGI? (cli/cgi): cgi
Would you like to have PHP4? (yes/no): no
Would you like to have ionCube? (yes/no): yes
Would you like to have Zend Optimizer? (yes/no): yes
Would you like to have an ability to update/instal MySQL using CustomBuild? (yes/no): yes
Which version of MySQL you would like to have? (5.0/5.1/5.5/5.6): 5.5
Which version of Apache you would like to have? (1.3/2.0/2.2/2.4): 2.2
Would you like to prevent htaccess files from using Options FollowSymLinks? More secure, but may break scripts. (yes/no): yes
Would you like to have an ability to update/instal Exim using CustomBuild? (yes/no): no
Would you like to have an ability to install Dovecot? (yes/no): no
Would you like to have an ability to install/update phpMyAdmin using CustomBuild? (yes/no): yes
Would you like to have an ability to install/update SquirrelMail webmail using CustomBuild? (yes/no): no
Would you like to have an ability to install/update RoundCube webmail using CustomBuild? (yes/no): no
Would you like to have an ability to install/update UebiMiau webmail using CustomBuild (not recommended)? (yes/no): no
Would you like to have an ability to install/update Atmail Open webmail using CustomBuild? (yes/no): no
Would you like to search for the fastest download mirror? (y/n): y #開始測速,并開始編譯。
好了,關掉SSH,休息一會。
過上1個小時,回來用?screen -r?打開看安裝完成的密碼。
安裝好之后參考?http://hengtian.biz/191.shtml?來建站。
喜歡看
分享圖片
博文不錯的
江南seo路過留個小腳印
seo培訓blog.sina.com.cn/seozhanwang
@seo培訓 ?
買不起啊
看一下就會了
這個很好用,我看一邊就會了
@seo論壇 嘿嘿
@顧建偉 謝謝