visualbox 安装 ubuntu 18.04 后续操作:设置ip、换源、安装LAMP、phpmyadmin
20181210 visualbox 安装 ubuntu 18.04 后续操作:设置ip、换源、安装LAMP、phpmyadmin
下载地址
http://releases.ubuntu.com/18.10/
找到 ubuntu-18.10-live-server-amd64.iso ,也就是下面的 连接地址
http://119.90.25.13/releases.ubuntu.com/18.10/ubuntu-18.10-live-server-amd64.iso
或者直接去掉前面的 ip (为什么会加上119.90.25.13 ?我也没有搞明白!)
http://releases.ubuntu.com/18.10/ubuntu-18.10-live-server-amd64.iso
官网太慢,改用 阿里云镜像
http://mirrors.aliyun.com/ubuntu-releases/18.10/ubuntu-18.10-live-server-amd64.iso
顺便纪录一下 16.04 的镜像
wget http://mirrors.aliyun.com/ubuntu-releases/16.04/ubuntu-16.04.5-server-amd64.iso
官网文档
https://help.ubuntu.com/lts/serverguide/serverguide.pdf
首先设置网络方式为 桥接
ip a如果发现和物理机不在同一个网段,说明连接方式是 NAT虚拟机菜单: Network —Network setting —Bridget adapter
再次 ip a这次和物理机在同一个网段
然后就可以 ssh 操作了!
ssh dhbm@192.168.1.194
检查系统
uname -aLinux ubuntu1804194 4.15.0-43-generic #46-Ubuntu SMP Thu Dec 6 14:45:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linuxcat /etc/issueUbuntu 18.04.1 LTS \n \l
1、设置静态ip
cd /etc/netplan
ls50-cloud-init.yamlsudo sudo vim 50-cloud-init.yaml
*** 按照以下内容修改,注意 yaml 语法network:ethernets:enp0s3:addresses: [192.168.1.194/24]gateway4:192.168.1.1dhcp4: falsenameservers:addresses: [223.5.5.5,114.114.114.114]version: 2应用新网址sudo netplan apply
再次确认ip a ** 如果是本地操作,无需重新启动服务器** 如果是 ssh 链接 ,最好重新连接新地址之后再继续** 如果 dhcp4 : true ,可能会看到 新旧 2 个 ip都是有效的
2、 换国内源
备份cp /etc/apt/sources.list /etc/apt/sources.list.bak
添加阿里源sudo vim /etc/apt/sources.list使用 vim 替换命令:s/cn.archive.ubuntu.com/mirrors.aliyun.com/g 或者删除全部后(vim 删除全部命令 :%d),粘贴以下内容#添加阿里源deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse更新、升级sudo apt updatesudo apt upgrade顺便纪录一下 ubuntu 16.04 阿里云源# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricteddeb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-propertiesdeb http://mirrors.aliyun.com/ubuntu/ xenial main restricteddeb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-propertiesdeb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricteddeb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-propertiesdeb http://mirrors.aliyun.com/ubuntu/ xenial universedeb http://mirrors.aliyun.com/ubuntu/ xenial-updates universedeb http://mirrors.aliyun.com/ubuntu/ xenial multiversedeb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiversedeb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-propertiesdeb http://archive.canonical.com/ubuntu xenial partnerdeb-src http://archive.canonical.com/ubuntu xenial partnerdeb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricteddeb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-propertiesdeb http://mirrors.aliyun.com/ubuntu/ xenial-security universedeb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
3、安装 LAMP
安装 taskselsudo apt install tasksel
安装 lamp-serversudo tasksel install lamp-server
测试结果:curl 127.0.0.1或者: 浏览器打开 192.168.1.194
4、中文乱码处理
sudo vim /etc/apache2/conf-available/charset.conf
把AddDefaultCharset UTF-8前面的#去掉
5、安装 phpadmin
sudo apt install phpmyadmin
设置 configsudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf sudo a2enconf phpmyadmin.conf
重启 apachesudo systemctl reload apache2.
测试结果http://192.168.1.194/phpmyadmin/index.php
这个时候,mysql 的 root 密码不知道是什么了!
重复一次,确认安装过成功没有 mysql 密码设置,只有一次 phpmyadmin 密码设置(干嘛用的?)
6、重设 mysql 初始密码
检查 mysql 是否安装运行sudo netstat -tap | grep mysql
或者sudo netstat -ano |grep 3306查看版本mysql --versionmysql Ver 14.14 Distrib 5.7.24, for Linux (x86_64) using EditLine wrapper
或者 mysql -V参考https://blog.csdn.net/ZT0518/article/details/82709573https://blog.csdn.net/weixin_43217860/article/details/82735095使用超级权限直接进入MySQLsudo mysql
在 mysql 状态下show database;use mysql;查询plugin字段值select plugin from user where user = 'root';
返回结果:+-------------+| plugin |+-------------+| auth_socket |+-------------+1 row in set (0.00 sec)更新 plugin 字段为 mysql 默认值update user set plugin="mysql_native_password";
返回结果:Query OK, 1 row affected (0.01 sec)Rows matched: 5 Changed: 1 Warnings: 0开始更改密码:update user set authentication_string=password('123456') where user='root' and host='localhost';
返回结果:Query OK, 1 row affected, 1 warning (0.05 sec)Rows matched: 1 Changed: 1 Warnings: 1
刷新权限:flush privileges;
退出quit重启 mysqlsudo systemctl restart mysql.service
** 或者使用过去的方式停止 mysqlsudo /etc/init.d/mysql stop启动 mysqlsudo /etc/init.d/mysql start测试 mysqlmysql -u root -p123456再次登陆 phpadmin 确认http://192.168.1.195/phpmyadmin/index.php
7、 修改主机名称
ubuntu 18.04 不能直接修改/etc/hostname中主机名称,重启后又恢复到安装时设置的主机名称
sudo vim /etc/cloud/cloud.cfg
将 preserve_hostname: false
改为 preserve_hostname: ture然后按照以前的方法修改 hostname
sudo vim /etc/hostnameubuntu 18.04 的 hosts 中没有 127.0.0.1 对应主机名这一行了,也就不用修改了
现在只有以下这一行
127.0.0.1 localhost.localdomain localhost修改完主机名,只能 reboot ,好像没有找到 systemctl 哪个命令可以直接生效查看当前的主机名称 (3 种名称!不知道都有什么作用?)
8、使用 hostnamectl 修改主机名称
hostnamectl --static
hostnamectl --transient
hostnamectl --pretty重设主机名称
sudo hostnamectl set-hostname ubuntu1804-76
sudo hostnamectl set-hostname ubuntu1804-76 --transient
sudo hostnamectl set-hostname ubuntu1804-76 --pretty修改 hosts
vim /etc/hosts# 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
# ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.1 ubuntu1804-76
::1 ubuntu1804-76直接查看名称已经改变
sudo reboot 才能看到显示改变了?疑问:127.0.0.1 localhost... 需要注释掉吗?会不会不认识 localhost?待处理
9 、 重设时区
安装的英文版,没有注意时区选择,时间总是相差 8 小时!在这里重设一下
记住命令 timedatectl 就可以了,help 一下就都找到了!timedatectl --helptimedatectl list-timezones |grep Asia
找到 Asia/Shanghaitimedatectl set-timezone "Asia/Shanghai"
10、翻墙安装 IPFS (待处理)
首先 http://ping.chinaz.com/ 多个地址 ping 域名 dist.ipfs.io ,找到其中比较快的一个修改之前wget https://dist.ipfs.io/go-ipfs/v0.4.13/go-ipfs_v0.4.13_linux-amd64.tar.gz
返回结果:
--2018-12-12 06:10:51-- https://dist.ipfs.io/go-ipfs/v0.4.13/go-ipfs_v0.4.13_linux-amd64.tar.gz
Resolving dist.ipfs.io (dist.ipfs.io)... 31.13.66.23
Connecting to dist.ipfs.io (dist.ipfs.io)|31.13.66.23|:443... ^C
等不到结果直接 ctrl C 中断sudo vim /etc/hosts 加入一行 域名映射到找到的这个 ip# add by wzh 20181211 for IPFS209.94.90.1 dist.ipfs.i重启 apachect2
sudo systemctl restart apache2修改之后sudo wget https://dist.ipfs.io/go-ipfs/v0.4.13/go-ipfs_v0.4.13_linux-amd64.tar.gz
返回结果: (可以看到目标 ip 地址变化了)2018-12-12 06:13:18-- https://dist.ipfs.io/go-ipfs/v0.4.13/go-ipfs_v0.4.13_linux-amd64.tar.gzResolving dist.ipfs.io (dist.ipfs.io)... 209.94.90.1Connecting to dist.ipfs.io (dist.ipfs.io)|209.94.90.1|:443... connected.HTTP request sent, awaiting response... 200 OKLength: 12635297 (12M) [application/gzip]Saving to: ‘go-ipfs_v0.4.13_linux-amd64.tar.gz’.4.13_linux-amd64.t 55%[==========> ] 6.69M 21.1KB/s eta 4m 27sipfs init
返回结果:initializing IPFS node at /home/dhbm/.ipfsgenerating 2048-bit RSA keypair...donepeer identity: QmeTpmUPu6iFg2dxgJAhxTWfFYM1eS9otBrgmqwrEDRLr9to get started, enter:ipfs cat /ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv/readmedhbm@dhbm1804:~/go-ipfs$ ipfs initinitializing IPFS node at /home/dhbm/.ipfsgenerating 2048-bit RSA keypair...donepeer identity: QmX7i3TxTSwPeLLAzDJA34RnMP5fc7wKNMAz3ssrbzyKSsto get started, enter:ipfs cat /ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv/readme
visualbox 安装 ubuntu 18.04 后续操作:设置ip、换源、安装LAMP、phpmyadmin相关推荐
- Ubuntu 18.04 配置 国内 apt-get 换源
文章目录 Ubuntu 18.04 配置 国内 apt-get 换源 1 备份文件 2 用vim进入并编辑文件 3 进入网站 https://mirrors.tuna.tsinghua.edu.cn/ ...
- Ubuntu 18.04 更改静态IP
2018年4月26日,ubuntu 18.04发行,第一时间下载安装了SERVER版本.使用VM14版本的虚拟机,开始使用DHCP获得IP地址,没有意外,可以直接上网.然而在更改VM的网络模式为桥接模 ...
- 安装Ubuntu 18.04后的一些操作
安装Ubuntu 18.04后的一些操作 1.设置root密码 sudo passwd 2.登陆root(输入密码后看到井号就是切换成为root账户) su 3.删除预装 apt-get remove ...
- Ubuntu 18.04及几款应用的安装
Ubuntu 18.04及几款应用的安装 1.Ubuntu 18.04的安装 ① VMware虚拟机自行下载即可: ② 在Ubuntu官网下载镜像,此处使用的Ubuntu 18.04版本: ③ 配置过 ...
- eclipse theia_如何在Ubuntu 18.04上设置Eclipse Theia Cloud IDE平台[快速入门]
eclipse theia 介绍 (Introduction) Eclipse Theia is an extensible cloud IDE running on a remote server ...
- WSL下安装ubuntu 18.04 +meep进行FDTD仿真计算
WSL下安装ubuntu 18.04 +meep进行FDTD仿真计算 前言 WSL 安装过程 打开虚拟环境 下载Ubuntu并修改安装路径 更改软件源 Meep VScode远程访问 测试程序 前言 ...
- eclipse theia_如何在Ubuntu 18.04上设置Eclipse Theia Cloud IDE平台
eclipse theia 介绍 (Introduction) With developer tools moving to the cloud, adoption of cloud IDE (Int ...
- ROS知识[14]:安装ubuntu 18.04和eclipse+CDT(installer)
一.说明 网上eclipse+CDT安装文章都很旧,参考意义有限:本人尝试自己安装了若干遍,凝练出一套比较规范的安装次序,较为简洁,如图所示: 二.安装 c++ 环境 首先启动终端ctrl + alt ...
- 在双GPU(核显+NVIDIA)计算机中正确安装Ubuntu 18.04下的NVIDIA驱动程序(解决循环登录等问题)
目录 前三次安装:各种坑 第一次安装:CUDA可用,但无法启动Steam 第二次安装:遇到循环登录问题 第三次安装:CUDA可用,可以启动Steam,但3D性能差 第四次安装:CUDA可用,Steam ...
- 苹果系统 macOS Mojave 10.14.4上安装 Ubuntu 18.04 双系统
macOS Mojave 10.14.4 安装Ubuntu 18.04 双系统 0. 准备工作 & 系统情况 1. 制作Ubuntu安装盘(U盘) 2. 硬盘分区 3. 安装Ubuntu 4. ...
最新文章
- docker 安装使用 solr
- jquery-12 折叠面板如何实现(两种方法)
- 给你的数据一个家,一个有DOI的地方 | 生物数据库承建
- py2exe——.py文件转换成exe
- java 中的几种 通用方法“
- 博士申请 | 加拿大麦吉尔大学丁俊老师招收机器学习全奖博士/硕士/实习生
- 微信小程序 - 五星评分(含半分)
- Xpath string()提取多个子节点中的文本
- LVS——DR模式+Keepalived(高可用)
- 毕设项目,系统搭建笔记文档
- python 答题辅助_答题辅助python代码实现
- 最好用的U盘数据恢复软件是哪个,迅龙U盘数据恢复软件
- centos7安装python开发环境(python3,postgresql,sublime,supervisor)
- 电影天堂爬去示例基础2
- 电脑任务栏卡死的解决方法
- 【强化学习】手把手教你实现游戏通关AI(2)——Q-Learning
- 使用Python和Numpy构建神经网络模型
- 关于Impl idiom
- 输入【ionic start myApp tabs】命令创建项目时失败
- IIS写权限漏洞原理利用工具手动版