setenv CLICOLOR yes
set autolist
然后執(zhí)行
sed -i.bak -E s/set prompt/#set prompt/g /root/.cshrc
退出重新登陸即可看到彩色目錄了 。
D、更新軟件包
采用FreeBSD 最好的地方就是安裝軟件方便 , 還可以裝到最新的軟件包 , 這就是強大的posts 系統 。如果你的系統在安裝時沒有選擇posts ,具休如何操作看BSD 的handbook.
CVSUP 的站點很多 , 你可以選擇離你最快的站點去更新posts , 具體查看 freebsd.org /freebsdchina.org.cn
在使用cvsup之前你必須連接到互聯網 , 并需要安裝cvsup 這個軟件
假如你的服務器在內網里 , 并通過DMZ 進行IP映射 , 可以參考下面設置:
sshd_enable="YES"
fsck_y_enable="YES"
hostname="mail.extmail.org"
ifconfig_rl0="inet 192.168.1.1 netmask 255.255.255.0"
defaultrouter="192.168.1.1"
如果你使用的是ADSL 拔號
a、修改/etc/ppp/ppp.conf
default:
set log Phase tun command # you can add more detailed logging if you wish
set ifaddr 10.0.0.1/0 10.0.0.2/0
ADSL:
set device PPPoE:vr0 # 將vr0 改為你拔號的網卡
set authname 你的ADSL 帳號
set authkey 你的ADSL密碼
set dial
set login
add default HISADDR
b、/etc/rc.conf 內容
inetd_enable="YES"
sshd_enable="YES"
fsck_y_enable="YES"
hostname="mail.extmail.org"
ifconfig_rl0="inet 192.168.1.1 netmask 255.255.255.0"
ppp_enable="YES" #YES or NO
ppp_mode="ddial" #"auto", "ddial", "direct" or "dedicated".
ppp_nat="YES" # if you want to enable nat for your local network, otherwise NO
ppp_profile="adsl" #/etc/ppp/ppp.conf
c、安裝cvsup-without-gui
?/usr/ports/net/cvsup-without-gui/
%make install clean
d、更新ports
安裝完cvsup軟件后 , 對ports 進行更新
%/usr/local/bin/cvsup -gL 2 -h cvsup4.FreeBSDchina.org /usr/share/examples/cvsup/ports-supfile
三、安裝數據庫 MySQL
MySQL 版本很多 , 大家可以據自己需要自行選擇喜歡的版本安裝 。
?/usr/ports/databases/mysql41-server/
%make install clean
在/etc/rc.conf 加入
mysql_enable="YES"
復制配置文件(非必需)
cp /usr/local/share/mysql/my-small.cnf /usr/local/etc/my.cnf
在此說明:
1、如果不在/etc/rc.conf 加入以上內容 , 手工是無法啟動MySQL的 。
2、如果你想知道這個軟件應該在/etc/rc.conf加入什么內容 , 打開/usr/local/etc/rc.d 目錄 , 找到此軟件的啟動腳本 。然后打開文件 , 如果有詳細的說明 。
%/usr/local/etc/rc.d/mysql-server.sh start
Starting mysql.
如何去檢查一個服務是否正常啟動:1、通過ps查看進程 , 2、檢查所打開的端口 。
%ps aux|grep mysql
mysql 94899 0.2 0.5 1644 1240 p0 S 3:52PM 0:00.07 /bin/sh /usr/local/bin/mysqld_safe --
mysql 94919 0.0 10.8 55564 27428 p0 S 3:52PM 0:01.54 /usr/local/libexec/mysqld --defaults-
%
%netstat -an|grep 3306
tcp4 0 0 *.3306 *.* LISTEN
MySQL安裝時 , 服務器的密碼為空 , 建議你裝好系統后 , 第一時間去更改密碼 。
%/usr/local/bin/mysqladmin -u root -p passWord 你的新密碼
Enter password:
如果你服務器只供本站內部使用建議在 my.cnf 里加入下面內容,以增加服務器的安全性 。
[mysqld]
bind_address=127.0.0.1
四、安裝Apache
1、安裝apache server
作為網絡的今天apache web服務器已經是街知港聞了 。
?/usr/ports/www/apache22/
%make install clean
在/etc/rc.conf 中加入:
apache22_enable="YES"
如果啟動時出現httpd: Could not reliably determine the server's fully qualifIEd domain name, using mail.sharesky.cn for ServerName 的錯誤 , 在/usr/local/etc/apache22/httpd.conf 約第144行的位置加入下面的內容 。
推薦閱讀
- FreeBSD Apache22 啟動故障
- 快手里為什么總顯示朋友在看
- 省錢快報中賺錢具體操作步驟
- 28 FreeBSD連載:Packages Collection
- 華為nova5z怎么開啟熱點
- 洗手盆發(fā)黃用什么方法清洗
- FreeBSD Port Tree 更新
- FreeBSD軟盤操作
- 老虎身上的條紋有什么作用
- 華為nova5z怎么新建桌面文件夾
