VirtualBox设置
- VirtualBox网络设置选NAT并配置端口转发:2222->22
- 安装时开启以太网并配置自动连接,或以后:vi /etc/sysconfig/network-scripts/ifcfg-enp0s3的ONBOOT改成yes,然后 systemctl restart network。
- 设置密码:xxxxxx
基本设置
- yum -y install epel-release vim,然后:yum update
- 设置防火墙:firewall-cmd --permanent --zone=public --add-port=22/tcp、firewall-cmd --reload
- 查看IP:ip addr,查看端口:ss -antp
- 安装OpenJDK:yum -y install java-1.8.0-openjdk 或下载并安装Oracle JDK:rpm -ivh jdk-8u101-linux-x64.rpm
安装Nginx
- vim /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1 - 安装:yum -y --enablerepo=nginx install nginx
- 启动:systemctl start nginx、设置开机自启:systemctl enable nginx
- SSL配置:https://mozilla.github.io/server-side-tls/ssl-config-generator/
安装MariaDB
- 安装:yum install mariadb-server mariadb
- 启动:systemctl start mariadb、设置开机自启:systemctl enable mariadb
- 初始化:/usr/bin/mysql_secure_installation
- 登录:mysql -u root -p
- 创建:CREATE DATABASE xxx CHARACTER SET utf8 COLLATE utf8_bin;
- 授权:GRANT ALL PRIVILEGES ON xxx.* TO 'xxx'@'localhost' IDENTIFIED BY 'xxxxxx';
- 刷新权限:FLUSH PRIVILEGES;
安装Memcached
- yum install memcached
- vi /etc/sysconfig/memcached 其中:MAXCONN=”1024″ 同时最大连接数、CACHESIZE=”64″ 使用的内存大小
- 启动:systemctl start memcached、设置开机自启:systemctl enable memcached
- 查看memcache状态:memcached-tool 127.0.0.1:11211 stats