VirtualBox設(shè)置
- VirtualBox網(wǎng)絡(luò)設(shè)置選NAT并配置端口轉(zhuǎn)發(fā):2222->22
- 安裝時開啟以太網(wǎng)并配置自動連接般眉,或以后:vi /etc/sysconfig/network-scripts/ifcfg-enp0s3的ONBOOT改成yes搂誉,然后 systemctl restart network髓削。
- 設(shè)置密碼:xxxxxx
基本設(shè)置
- yum -y install epel-release vim铣缠,然后:yum update
- 設(shè)置防火墻: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蝎困、設(shè)置開機自啟:systemctl enable nginx
- SSL配置:https://mozilla.github.io/server-side-tls/ssl-config-generator/
安裝MariaDB
- 安裝:yum install mariadb-server mariadb
- 啟動:systemctl start mariadb、設(shè)置開機自啟:systemctl enable mariadb
- 初始化:/usr/bin/mysql_secure_installation
- 登錄:mysql -u root -p
- 創(chuàng)建:CREATE DATABASE xxx CHARACTER SET utf8 COLLATE utf8_bin;
- 授權(quán):GRANT ALL PRIVILEGES ON xxx.* TO 'xxx'@'localhost' IDENTIFIED BY 'xxxxxx';
- 刷新權(quán)限:FLUSH PRIVILEGES;
安裝Memcached
- yum install memcached
- vi /etc/sysconfig/memcached 其中:MAXCONN=”1024″ 同時最大連接數(shù)庄拇、CACHESIZE=”64″ 使用的內(nèi)存大小
- 啟動:systemctl start memcached注服、設(shè)置開機自啟:systemctl enable memcached
- 查看memcache狀態(tài):memcached-tool 127.0.0.1:11211 stats