以下均是在ubuntu16环境下操作的。
一、jdk9安装
二、mysql5.6安装
$ sudo apt-get install software-properties-common
$ sudo add-apt-repository -y ppa:ondrej/mysql-5.6
$ sudo apt-get update
$ sudo apt-get install mysql-server-5.6
开启远程连接
打开文件/etc/mysql/mysql.conf.d/mysqld.cnf
找到:bind-address = 127.0.0.1将其注释掉(在前面加#即可)
授权用户允许远程访问
mysql>use mysql;
mysql> GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "rootpassword"; //为root添加远程连接的能力
mysql> flush privileges;
注:
安装过程中会提示设置root密码,请记住此密码
若找不到bind-address内容可使用以下命令搜索
sudo find /etc -name "*" | xargs grep -in "bind-address"
sudo apt-get update时可能会失败,ubuntu16默认的软件源是us.archive.ubuntu.com(英国) 的,所以很慢。
为了提高下载速度,将源改为国内的 cn.archive.ubuntu.com
1、为安全起见先备份原来的源文件
$ sudo mv /etc/apt/sources.list sources.list_backup
2、然后重新新建一个sources.list文件
$ sudo vi /etc/apt/sources.list
文件内容如下
deb http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
deb http://cn.archive.ubuntu.com/ubuntu/ xenial universe
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates universe
deb http://cn.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
最后重新执行sudo apt-get update
三、nginx安装
sudo apt-get install nginx
安装好的文件位置:/usr/sbin/nginx:主程序
/etc/nginx:存放配置文件
/usr/share/nginx:存放静态文件
/var/log/nginx:存放日志
其实从上面的根目录文件夹可以知道,Linux系统的配置文件一般放在/etc,日志一般放在/var/log,运行的程序一般放在/usr/sbin或者/usr/bin。
当然,如果要更清楚nginx的配置项放在什么地方,可以打开/etc/nginx/nginx.conf
nginx如果指定默认加载/etc/nginx/nginx.conf的配置文件。如果要查看加载的是哪个配置文件,可以用这个命令sudo nginx -t或者ps -ef | grep nginx