- 安装ubuntu的时候:
1,最好不要直接'简易'安装,容易出错,先建立好虚拟机,再载入iso文件
2,安装过程,有个加密主目录的选项,选择是,选择否的话也可能出错
- 安装好后设置NAT模式:
1,先在vmware的'编辑'--'虚拟网络编辑器'里面设置好IP段
2,1704的版本设置IP参考:以192.168.91字段为例
vim /etc/network/interfaces
加入下面设置
auto ens33
iface ens33 inet static
address 192.168.91.129
netmask 255.255.255.0
gateway 192.168.91.2
dns-nameservers 192.168.91.2
1404版本
vim /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.91.129
netmask 255.255.255.0
gateway 192.168.91.2
dns-nameservers 192.168.91.2
- 修改yum源:
18.04:
vim /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
1704:
vim /etc/apt/sources.list
deb http://mirrors.163.com/ubuntu/ zesty main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ zesty-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ zesty-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ zesty-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ zesty-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ zesty main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ zesty-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ zesty-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ zesty-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ zesty-backports main restricted universe multiverse
1404:
vim /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
- 如果出现关机或者重启的时候报错:
- a stop job of running mysql community server
解决方法: 参考的是:https://askubuntu.com/questions/615129/systemd-mysql-wont-stop
-
Make
/etc/mysql/debian.cnf
readable for themysql
user withsudo chgrp mysql /etc/mysql/debian.cnf; sudo chmod 640 /etc/mysql/debian.cnf
-
Provide a slightly modified
mysql.service
file:sudo cp /lib/systemd/system/mysql.service /etc/systemd/system/ sudo chmod 755 /etc/systemd/system/mysql.service
-
Provide an explicit stop command by opening the copied file in an editor:
sudo nano /etc/systemd/system/mysql.service
and adding the following line under the
[Service]
section:ExecStop=/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf shutdown
In Nano, use Ctrl+O to save (Linux way!), Ctrl+X to exit.
-
Make the new service file known to system:
sudo systemctl daemon-reload
- apt-get xxx 显示Unable to locate package xxx
可以先执行apt-get update
- 安装好后要是安装了项目,比如说magento2.1.7,安装成功后,打开页面显示css.js后台都是404
打开apache的重写机制:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
/var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
改成:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
/var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
然后运行: a2enmod rewrite命令
重启apache: systemctl restart apache2
安装ubuntu的时候,为了让文件夹的名字是英文,选择的语言是英文,可以安装完毕后在setting-region & language里面设置成中文
暂时这样.遇到其他问题再添