ubuntu一些常用的命令

时间:2023-03-09 23:59:51
ubuntu一些常用的命令

1.docker里的ubuntu不知道密码,更新密码

sudo passwd

ubuntu一些常用的命令

2.解压zip文件

unzip xx.zip

3.安装LAMP

(1)sudo apt-get install apache2

(2)apt-get install php libapache2-mod-php

(3)apt-get install mysql-server

上面安装好后,运行owncloud提示:没有安装数据库驱动 (SQLite、MySQL 或 PostgreSQL);PHP zip 模块未安装;PHP dom 模块未安装;PHP XMLWriter 模块未安装;PHP XMLReader 模块未安装;PHP libxml 模块未安装;PHP mb multibyte 模块未安装;PHP GD 模块未安装;PHP SimpleXML 模块未安装;PHP cURL 模块未安装。

解决:

(1)我们使用php5-fpm来作为我们的php解析。

sudo apt-get install php7.0-fpm

(2)apt-get install php7.0-mysql

(3)apt-get install php7.0-zip

(4)apt-get install php7.0-GD

(5)apt-get install php7.0-cURL

(6) apt-get install php7.0-mbstring

就是缺什么就装什么。

4.重启网卡:

  /etc/init.d/networking restart

5.虚拟机双网上(一台内网,一台外网)断网后本地电脑能用

  vi /etc/network/interfaces 

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto ens33
iface ens33 inet static
address 172.16.231.128
netmask 255.255.255.0
iface ens38 inet static
address 192.168.14.6
netmask 255.255.255.0
gateway 192.168.31.1

ifup ens38

6.重启之后,ping不通外网

vi /etc/resolv.conf

nameserver 192.168.31.1
nameserver 8.8.8.8
nameserver 127.0.1.1
search lan

保存后就能正常上网了。

7.更新数据库密码

ubuntu一些常用的命令

grant all privileges  on *.* to root@'localhost' identified by "root";

ubuntu一些常用的命令