linux常用软件安装,常用命令
jdk
[root@localhost]# tar -zxvf jdk-8u144-linux-x64.tar.gz
[root@localhost]# vi /etc/profile
在profile文件中添加下述内容
#set java environment
JAVA_HOME=/usr/java/jdk1.8.0_144
JRE_HOME=/usr/java/jdk1.8.0_144/jre
CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME JRE_HOME CLASS_PATH PATH
[root@localhost]# source /etc/profile
[root@localhost]# java -version
tomcat
[root@localhost]# tar -zxvf apache-tomcat-9.0.0.M22.tar.gz
[root@localhost]# /tomcat path/bin/startup.sh ---之后访问http://host:8080/,显示Tom猫
[root@localhost]# vi /tomcat path/conf/server.xml
查找8080,找到如下两处地方
<<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
将port="8080"改成port="80"
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
这样做的目的是通过浏览器url访问时不用输入端口号,因为浏览器自动填充80
---重启之后访问http://host 显示Tom先生
[root@localhost]# vi /tomcat path/conf/tomcat-users.xml
拷贝下面代码
<role rolename="manager"/>
<role rolename="admin"/>
<role rolename="admin-gui"/>
<role rolename="manager-gui"/>
<user username="xxx" password="***" roles="admin-gui,manager-gui"/>
---重启访问http://host/manager,弹出窗口,输入用户名密码,在本地部署服务器项目
下面是修改Tomcat默认加载的root项目和index.html的方法,假设我要改成home项目下的first.html
[root@localhost]# vi /tomcat path/conf/server.xml
找到下面这段
<Engine name="Catalina" defaultHost="localhost">
<host name="localhost" appBase="webapps"
unpackWARs="true"
xmlValidation="false" xmlNamespaceAware="false">
.......
<host>
在host标签里面添加
<Context path="" docBase="home" debug="0" reloadable="true" />
[root@localhost]# vi /tomcat path/conf/web.xml
找到下述标签
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
改为
<welcome-file-list>
<welcome-file>first.html</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
---重启访问http://host Tom女士不见了,显示webapps/home/first.html
mysql
--使用 yum install mysql安装msyql后mysql启动不了
--是因为上述命令默认安装的是mariadb
--下载yum库
[root@localhost]# wget http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
--安装yum库
[root@localhost]# yum localinstall mysql57-community-release-el7-11.noarch.rpm
--安装mysql server
[root@localhost]#yum install mysql-community-server
--启动mysql server
[root@localhost]# service mysqld start
--查看mysql当前状态
[root@localhost]# service mysqld status
--获得临时密码
[root@localhost]# grep 'temporary password' /var/log/mysqld.log
--重置临时密码
[root@localhost]# mysql_secure_installation
--连接数据库
[root@localhost]# mysql -u root -p
--修改字符集
[root@localhost]# show varibles like '%char%';
[root@localhost]# exit
[root@localhost]# whereis my.cnf
[root@localhost]# vi /etc/my.cnf
[client]
default-character-set=utf8
在[mysqld]下添加
character-set-server=utf8
redis
[root@localhost]tar -zvxf redis-4.0.2.tar.gz
[root@localhost]mv redis-4.0.2 /usr/local/redis
[root@localhost]make MALLOC=libc
[root@localhost]make install
[root@localhost]vim redis.conf
修改bind 127.0.0.1(允许访问的ip) 和 daemonize yes(是否允许后台运行) requirepass 040209(访问密码)
[root@localhost]redis-server ./redis.conf
[root@localhost]ps -ef | grep redis-server
[root@localhost]./utils/install_server.sh
[root@localhost]systemctl start redis_6379
rabbitmq
- openssl
[root@localhost]tar -zvxf openssl-1.0.1s.tar.gz
[root@localhost]cd openssl-1.0.1s
[root@localhost]./config --prefix=/usr/local/openssl
[root@localhost]vi Makefile
将原来的:CFLAG= -DOPENSSL_THREADS
修改为: CFLAG= -fPIC -DOPENSSL_THREADS
[root@localhost]make && make install
- erlang:
[root@localhost]yum install ncurses-devel
[root@localhost]tar xf otp_src_20.1.tar.gz
[root@localhost]cd otp_src_20.1
[root@localhost]./configure --prefix=/usr/local/erlang20 --without-javac
[root@localhost]make
[root@localhost]make install
[root@localhost]/usr/local/erlang20/bin/erl - RabbitMQ
[root@localhost]xz -d rabbitmq-server-generic-unix-3.7.2.tar.xz
[root@localhost]tar xf rabbitmq-server-generic-unix-3.7.2.tar
[root@localhost]yum install python -y
[root@localhost]yum install xmlto -y
[root@localhost]yum install python-simplejson -y
[root@localhost]mv rabbitmq_server-3.7.2/ /usr/local/rabbitmq - 导入环境变量
[root@localhost]vim /etc/profile
添加如下命令:
PATH=$PATH:/usr/local/erlang20/bin:/usr/local/rabbitmq/sbin
[root@localhost]export PATH
[root@localhost]source /etc/profile
[root@localhost]rabbitmqctl start_app
nginx
[root@localhost]tar -zvxf nginx
[root@localhost]./configure --prefix=/usr/local/nginx --conf-path=/usr/local/nginx/nginx.conf
[root@localhost]yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
[root@localhost]make && make install
[root@localhost]./sbin/nginx
[root@localhost]./sbin/nginx -s reload
常用命令
df
df -lh 查看磁盘的使用情况以及文件系统被挂载的位置mount
mount /dev/vda1 /mnt/d 将分区vda1挂载到mnt下的d目录上vi编辑器
复制 : yy(当前行) , nyy(复制n行)
粘贴 : p
删除 : dd(当前行)
查找 : /+查找的内容,之后再按n匹配下一个find
删除满足条件的文件 find / -name mysql -exec rm -rf {} ;
find dir/dir1 -ctime -num 查找在dir/dir1目录下num*24小时内被修改的文件
find dir/dir1 -perm 777 查找在dir/dir1目录下访问权限为777的文件
find dir/dir1 -name x1 查找在dir/dir1目录下名为x1的文件或者是目录
find dir/dir1 -size x 查找在dir/dir1目录下大小为x的目录whereis
whereis my.cnfls
ls -l xx.xx:
显示该目录下的所有文件的详细信息,文件权限:
-rw-rw-r--
一共有10位数
其中: 最前面那个 - 代表的是类型
中间那三个 rw- 代表的是所有者(user)
然后那三个 rw- 代表的是组群(group)
最后那三个 r-- 代表的是其他人(oth老师er)
改变文件权限:
r= 4 表示可读
w=2表示可写
x=1表示可执行cat
cat xx 查看xx内容
cat -n xx对xx内容进行编号
cat x1 x2 >x3 合并x1和x2的内容并且输出到x3中,如果x3有数据则覆盖
cat x1 x2 >>x3 合并x1和x2的内容后加在x3后面chmod
chmod 775 xx 将xx文件的权限改为-rwxrwxr-xchown
chown manager xx 将xx文件的拥有者变为manager
chown manager:other 将xx文件拥有者变为manager,用户组变为other
chown manager: xx 将xx文件的拥有者变为manager,用户组变为manager的
chown :other 将xx文件的用户组变为othercmp
cmp x1 x2 比较x1文件和x2文件
可能输出 : x1 x2 differ: byte 1, line 1 ,表示x1文件与x2文件在第一行第一个字节就不同cp
cp x1 dir/dir1 复制x1文件到dir/dir1的目录下,重名会报错
cp x1 dir/dir1 x2 复制x1文件到dir/dir1的目录下,并且重命名为x2
cp -fr dir/dir1 dir2/dir3 复制dir下的dir1文件夹到dir2/dir3目录下diff
diff x1 x2 比较x1与x2文件的不同,显示不同的内容
diff -c x1 x2 分别显示x1与x2文件内容,把不同的标识了出来file
file x1 显示x1文件类型
file * 显示当前文件夹下所有文件类型gzip
gzip x1 将文件x1压缩,形成x1.gz并代替原来的文件
gzip * 将当前目录下的文件都压缩
gzip -d x1.gz 对文件进行解压缩 注:gunzip x1.gz也可以进行解压缩less长文本阅读
less x1显示x1文本内容并显示一页ln
ln x1 x2 建立x1的硬链接x2
ln -s x1 x3 建立x1的软链接x3
软硬区别:x1和x2具有相同的inode号,指向同一个内容而x3通过指向x1指向具体内容locate
locate x1 查找符合x1文件名样式的文件和目录more
more x1显示x1内容
more x1 x2首先显示x1内容,空格键后显示x2内容mv
mv x1 x2将文件x1重命名为x2
mv x1 dir/dir1将文件x1移动到dir/dir1目录下tac
tac x1 反序输出x1tar
tar -c x1 x2 >x3.tar 将文件x1和x2压缩后建立x3文件
tar -cf x3.tar x1 x2 同上
tar -xzvf x1.tar.gz 解压缩x1.tar.gz文件tee
tee x1 通过标准输入到文件x1(覆盖x1内容),ctrl+D退出
tee -a x1 同上 append到x1后,不是覆盖
cat x1|tee x2 将x1内容输入到x2中
linux常用软件安装,常用命令的更多相关文章
- 《前端运维》一、Linux基础--09常用软件安装
一.软件包管理 RPM是RedHat Package Manager(RedHat软件包管理工具)类似Windows里面的"添加/删除程序".软件包有几种类型,我们一起来看下: 源 ...
- Ubuntu 18.04 安装和常用软件安装
Ubuntu 18.04 安装 下载 Ubuntu 制作 U 盘启动盘 设置电脑为 U 盘启动 插入 U 盘,重启电脑 按照提示安装 Ubuntu 更新 NVIDIA 显卡和 Broadcom 无线网 ...
- Ubuntu 16.04 主题美化及常用软件安装
一.主题美化 系统清理 系统更新: 安装完系统之后,需要更新一些补丁.Ctrl+Alt+T调出终端,执行一下代码: sudo apt-get update sudo apt-get upgrade 卸 ...
- CentOS7 系统服务器初始化配置、安全加固、内核升级优化常用软件安装的Shell脚本分享
转载自:https://www.bilibili.com/read/cv13875630?spm_id_from=333.999.0.0 描述: 适用于企业内部 CentOS7 系列操作服务器初始化. ...
- Ubuntu16.04系统美化、常用软件安装等,长期更新
Ubuntu16.04系统美化.常用软件安装等,长期更新 IT之家啊 18-09-0915:00 因为我个人偏向于玩VPS.服务器之类的东西,所以一般我都是用CentOS.不过对于桌面版的Linux, ...
- Fedora 28 系统基础配置以及常用软件安装方式
实验说明: 很多人说Linux很难用,很难上手,其实不然,倘若不玩游戏,其实很多发行版Linux都可以成为主力系统,就比如本章要讲的 Fedora 28.本章会从镜像来源.系统安装.基础配置和常用软件 ...
- (大数据工程师学习路径)第一步 Linux 基础入门----Linux 下软件安装
介绍 介绍 Ubuntu 下软件安装的几种方式,及 apt,dpkg 工具的使用. 一.Linux 上的软件安装 通常 Linux 上的软件安装主要有三种方式: 在线安装 从磁盘安装deb软件包 从二 ...
- Linux 下软件安装
Linux 下软件安装 一.Linux 上的软件安装 通常 Linux 上的软件安装主要有三种方式: 在线安装 从磁盘安装deb软件包 从二进制软件包安装 从源代码编译安装 这几种安装方式各有优劣,而 ...
- linux下软件的更新命令
linux下软件的更新命令 在ubuntu服务器下安装包的时候,经常会用到sudo apt-get install 包名 或 sudo pip install 包名,那么两者有什么区别呢? 1.区 ...
随机推荐
- JS中的offsetWidth、offsetHeight、clientWidth、clientHeight等等的详细介绍
javascript中offsetWidth.clientWidth.width.scrollWidth.clientX.screenX.offsetX.pageX 原文:https://www.cn ...
- Linux记录-筛选日志sed、find、tail,du,awk命令
1.查看某一段时间的日志 #cat hdfs-audit.log | sed -n '/2018-04-11 10:00:00/,/2018-04-11 10:01:00/ p' | more - ...
- C#多线程和异步(三)——一些异步编程模式
一.任务并行库 任务并行库(Task Parallel Library)是BCL中的一个类库,极大地简化了并行编程,Parallel常用的方法有For/ForEach/Invoke三个静态方法.在C# ...
- Mabatis三剑客分别是:mybatis-generator、mybatis-plugin、mybatis-pagehelper
本文用的是maven,idea15 Mabatis三剑客分别是:mybatis-generator.mybatis-plugin.mybatis-pagehelper 一.mybatis-genera ...
- java中常量文件的配置与读取
java中常量文件的配置与读取: package com.floor.shop.user.util; import java.io.InputStream; import java.io.InputS ...
- div锚点链接跳转
a标签href可跳转到知道dom节点(通过id) 代码 <!DOCTYPE html> <html> <head> <meta name="view ...
- centos文件与权限
切换目录 cd:切换目录. 当我们需要进入到别的目录的时候,就需要使用到cd这个命令. ‘ cd这个命令主要有以下几种使用方式; cd [~]:进入当前用户的家目录,比如我是fuwh这个用户登陆的,则 ...
- u-boot移植(十二)---代码修改---支持DM9000网卡
一.准备工作 1.1 原理图 CONFIG_DM9000_BASE 片选信号是接在nGCS4引脚,若要确定网卡的基地址,则要根据片选信号的接口去确定. 在三星2440的DATASHEET中memory ...
- L1比L2更稀疏
1. 简单列子: 一个损失函数L与参数x的关系表示为: 则 加上L2正则化,新的损失函数L为:(蓝线) 最优点在黄点处,x的绝对值减少了,但依然非零. 如果加上L1正则化,新的损失函数L为:(粉线) ...
- 近几年杭电OJ大型比赛题目合集【更新到2017年11月初】
2017年: 区域赛网络赛 6194~6205 6206~6216 区域赛网络赛 6217~6229 2016年: 区域赛网络赛 5868~5877 5878~5891 5 ...