這篇短文記錄了從拿到伺服器的root帳號和密碼後,如何部署伺服器的文章。本篇文章適合給Linux初學者參考。
步驟* 修改root使用者密碼
paddwd root
* 配置多IP地址A 在不重啟的情況下,綁定IP地址
ifconfig eth0:1 x.x.x.x netmask 255.255.255.0
ifconfig eth0:2 x.x.x.x netmask 255.255.255.0
B 儲存配置資訊到檔案
1 拷貝配置資訊
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:1
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:2
2 使用vi命令,修改對應的設定檔
vi /etc/sysconfig/network-scripts/ifcfg-eth0:1
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:1e:90:ee:2c:6f
ONBOOT=yes
NETMASK=255.255.255.0 #這裡填寫服務商提供的子網路遮罩
IPADDR=x.x.x.x #這裡填寫你要分配的IP地址
GATEWAY=x.x.x.x #這裡填寫服務商提供的網關IP
TYPE=Ethernet
service network restart
* 或者儲存 ifconfig 的命令到 /etc/rc.d/rc.local 檔案中
* 安裝Apache,Mysql,PHP
預設CentOS上已經安裝了Apache 2.2,我們只需要安裝Mysql,PHP即可。安裝過程也很簡單,使用yum命令。這裡有一遍具體將如何安裝的文章
CentOS 5.x yum安裝LAMP(Apache+MySQL+PHP)
或者參考這裡:CentOS — 搭建 LAMP 運行環境
配置Apache
cd /etc/httpd/conf/
cd /etc/httpd/conf/extra/
<VirtualHost x.x.x.x:80>
ServerAdmin google@gmail.com
DocumentRoot /home/website/www.google.com
ServerName google.com
ServerAlias www.google.com
ErrorLog logs/dummy-google.com-error_log
CustomLog logs/dummy-google.com-access_log common
</VirtualHost>
* VSFTPD
centos 5 yum安裝與配置vsFTPd FTP伺服器
== VsFtpd ==
今天用root使用者登入vsftpd出現530 Login incorrect錯誤與530 Permission denied錯誤。
530 Permission denied
原因是/etc/vsftpd/vsftpd.conf裡userlist_enable=YES
/etc/vsftpd/user_list 含有root名單
2種解決辦法:
- userlist_enable=NO
- 將root從user_list中去掉 + 將root從/etc/vsftpd/ftpusers中去掉
530 Login incorrect錯誤