DELL R730 H730P RAID UBUNTU 14.04.3 install

1.系统安装

ubuntu 14.04.3 server amd 64

2.hardware RAID

开机ctrl+R 配置 raid1

系统安装时可见 H730P mini 2T

硬raid管理工具:LSIMegaRAIDSAS
详细:HWraid

由于没有提供14.04的源,12.04凑合用吧

/etc/apt/source.list中添加deb http://hwraid.le-vert.net/ubuntu precise main


执行wget -O - http://hwraid.le-vert.net/debian/hwraid.le-vert.net.gpg.key | sudo apt-key add -sudo apt-get update


安装sudo apt-get install megaraid-status后可执行megaraidsas-statussudo megasasctl查看raid状态。

3.install gnome desktop for XXX

sudo apt-get update; sudo apt-get install gnome-session-fallback

4.network

orginal GAIT configuration

/etc/network/interface

1
2
3
4
5
6
allow-hotplug eth0
iface eth0 inet static
address 192.168.128.32
netmask 255.255.255.0
broadcast 192.168.128.255
gateway 192.168.128.1

newly configured

1
2
3
4
5
6
7
8
9
10
11
12
13
auto lo em1
iface lo inet loopback

# The primary network interface
allow-hotplug em1
iface em1 inet static
address 10.2.7.235
netmask 255.255.255.128
gateway 10.2.7.129
broadcast 10.2.7.255
dns-nameservers 10.2.0.250 10.2.0.251
# This is an autoconfigured IPv6 interface
iface em1 inet6 auto

注意,networkmanager不管理interfaces的配置,如需更改需要修改:

/etc/NetworkManager/NetworkManager.conf中的managed=false

网络重启:

sudo ifdown em1 && sudo ifup -v em1

5.防火墙iptables

允许已经建立的连接接受数据,很重要!,否则禁用所有端口后本地无法对外通信.

1
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

开放80,22端口:

1
2
3

iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT

干掉其他所有端口INPUT流量

1
sudo iptables -A INPUT -j DROP

此时,ping也直接被禁掉了.

开放回环lo,开放后localhost端口不禁

1
iptables -I INPUT 4 -i lo -j ACCEPT

查看详情:

1
iptables -L -v

保存iptable

1
iptables-save > /etc/iptables.up.rules

开机自动加载

1
2
3
auto em1
iface em1 inet dhcp
pre-up iptables-restore < /etc/iptables.up.rules

6.远程桌面VNC

ssh映射vnc端口5901到本地5901:

ssh me@myserver -L 5901/127.0.0.1/5901

xstartup文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &

gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &

7.apache,php,mysql

用户public_html生效:a2enmod userdir
增加监听端口 /etc/apache2/ports.conf

端口控制: port.conf


目录权限控制:apache2.conf


网站配置:site-*

8.gitlab

Install instruction: GitLab

sshkey 只能是id_rsa