之前整过CentOS,整了Ubuntu才发现,Ubuntu简单多了~~不知道性能相比又如何。
以Ubtuntu 14.04为例,记录一下搭建流程。
一、SSH服务器
第一件事当然是ssh,默认安装后vi /etc/ssh/sshd_config,修改配置文件。
修改/etc/hosts.allow
sshd: 192.168.1. , 192.168.0. : allow
修改/etc/hosts.deny
sshd : ALL
二、系统更新
先更新源,用以Trusty Tahr (14.04)为例,其他版本看配置生成器
deb http://mirrors.ustc.edu.cn/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse
再更新apt-get
sudo apt-get update
sudo apt-get upgrade
然后更新系统
sudo apt-get install update
三、Samba网上邻居安装
1. 安装 apt-get install samba
2.为samba创建ubuntu系统已经存在的用户somebody:
smbpasswd -a somebody
然后会提示你输入密码,这是访问网上邻居文件夹的密码。
3.修改配置文件:
cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
vi /etc/samba/smb.conf
在其后增加共享目录:
[share]
path = /home/somebody/samba_share
available = yes
browseable = yes
public = no
writable = yes
4. 重启samba就可以像windows一样访问
/etc/init.d/samba restart
四、安装apache2
sudo apt-get install apache2
装好后访问http://localhost就可以看到“It Works!”
apache2配置文件在/etc/apache2/apache2.conf,web目录在/var/www/html
默认用户是www-data,定义在./envvars文件中
其他配置文件在:./sites-enabled/*.conf