Ubuntu Server安全Webserver搭建流程
2016-03-10 17:51
489 查看
之前整过CentOS。整了Ubuntu才发现,Ubuntu简单多了~~不知道性能相比又怎样。
以Ubtuntu 14.04为例。记录一下搭建流程。
一、SSHserver
第一件事当然是ssh,默认安装后vi /etc/ssh/sshd_config。改动配置文件。
改动/etc/hosts.allow
改动/etc/hosts.deny
二、系统更新
先更新源,用以Trusty Tahr (14.04)为例,其它版本号看配置生成器
再更新apt-get
三、Samba网上邻居安装
1. 安装 apt-get install samba
2.为samba创建ubuntu系统已经存在的用户somebody:
3.改动配置文件:
四、安装apache2
装好后訪问http://localhost就能够看到“It Works!”
apache2配置文件在/etc/apache2/apache2.conf,web文件夹在/var/www/html
默认用户是www-data。定义在./envvars文件里
其它配置文件在:./sites-enabled/*.conf
以Ubtuntu 14.04为例。记录一下搭建流程。
一、SSHserver
第一件事当然是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然后会提示你输入password,这是訪问网上邻居目录的password。
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 = yes4. 重新启动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
相关文章推荐
- 实现快餐配送页面jq
- shell编程-数组
- hbase
- Java编程思想学习(一) 一切都是对象
- java笔记1→认识java与配置环境变量
- android activiy判断当前activiy是不是前台显示的。
- gulp基本入门
- ViewPager加RadioGroup构建底部导航
- screen 配置
- Android 登陆界面
- HDU1890 Robotic Sort(Splay)
- 利用redrat模拟遥控器
- linux修改用户打开文件数量的限制
- 如何判断微信内置浏览器
- Codeforces Round #344 (Div. 2) A. Interview
- 网页自动跳转/定时跳转代码
- Spark的39个机器学习库-英文
- leetcode(198)(213) HouseRobber HouseRobber-II
- 利用ViewPager实现引导界面+底部小圆点
- java 正则表达式