虚拟机配置

安装注意的地方

retrieving files 检索文件的步骤可以直接取消了

安装Ubuntu后的一些配置

  1. ifconfig查看虚拟机的ip 192.168.172.168
  2. 设置一下本机VM8的ip地址 192.168.172.1 255.255.255.0
  3. sudo apt-get install openssh-server 安装ssh服务
  4. sudo ufw disable 关闭防火墙 netstat -nat | grep 22
  5. 安装mysql后,bind-address = 127.0.0.1 改为 bind-address = 0.0.0.0 用户远程连接
  6. 设置一下允许远程连接的账号
  7. grant all privileges on . to ‘root‘@’%’ identified by ‘youpassword’ with grant option;
    flush privileges;
  8. 关闭iptables
    1
    2
    3
    4
    5
    6
    7
    8
    grant all privileges on *.*  to  'root'@'%'  identified by 'root'  with grant option;  
    flush privileges;
    iptables -L -n //查看现有的
    iptables -L -n --line-numbers
    iptables -D INPUT 8 //删除


    service iptables save;

允许远程直接用root链接

允许root登录
vi /etc/ssh/sshd_config
将PermitRootLogin值改yes
允许不输入密码登录
将PermitEmptyPasswords yes前面的#号去掉
重启服务:service sshd restart(/etc/initd.d/sshd restart)

设置一下vm

  1. 在vm中设置网络 虚拟机->安装vm tools,进入后解压文件后安装文件 //安装vm tools
  2. 编辑->虚拟网络编辑器 修改vm8的网络映射 用户设置本机访问

rz 选择文件上传本地文件

sz 服务器下载文件 在会话中设置上传和下载文件

netstat -ant //查看端口使用情况
netstat -antp //查看端口使用情况
kill -9 pid //杀掉进程

设置允许远程root登录

编辑vim /etc/ssh/sshd_config文件,将 PermitRootLogin 的值改为yes
PermitEmptyPasswords为 no
service ssh restart

./configure –prefix=/usr/local/fastphp –with-mysql=mysqlnd –enable-mysqlnd –with-gd –enable-gd-native-ttf –enable-gd-jis-conv –enable-fpm

修改hosts

1
sudo vim /etc/hosts

修改163源操作

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
nginx php-fpm 

sudo gedit /etc/apt/sources.list //查看现有源
su root
cd /etc/apt
wget http://mirrors.163.com/.help/sources.list.lucid
mv sources.list sources.list.backup
mv sources.list.lucid sources.list
apt-get update
apt-get dist-upgrade

ifconfig -a
yum install openssh-server
yum install lrzsz
vim /etc/hosts

nginx listen 80 default_server; 创建新的网站 去掉default_server

vim添加行号

1
2
vim   /etc/vimrc	
在vimrc文件的最后添加 set nu 即可
文章目录
  1. 1. 安装注意的地方
  2. 2. 安装Ubuntu后的一些配置
  3. 3. 允许远程直接用root链接
  4. 4. 设置一下vm
  5. 5. 设置允许远程root登录
  6. 6. vim添加行号
|