`

linux装软件

 
阅读更多

====权限==============
 
drwxr-xr-x
d:目录
read write execute
 
-rw-r--r-- 文件
 
rwx    r-x        r-x
111   101      101
  7        5         5
用户  用户组  其他组
  g         u        o
 
777 最高权限
 
更改权限的命令:===========
chmod g(u/o)+(-)w 文件
chmod 777 文件名
chmod 777 -R 文件名 递归授权(子目录也获得权限)
 
添加用户和用户组:=============
创建用户组:groupadd 组名
删除用户组:groupdel 组名 (只能删除空的组)
 
创建用户组(指定组id):   
          groupadd -g 701 tomcat  指定tomcat的groupId为701
创建用户(在指定的组下):
         useradd -g 701 tomcat    在指定的groupId下创建tomcat用户
修改用户密码:     passwd tomcat
切换用户 su - tomcat
 
* 切换用户:su - tomcat,
注意加 - ;环境变量使用的tomcat用户定义的环境变量
 
 
===linux下安装软件3种方式:=====
 1 rpm包   相当于windows的exe,属于二进制安装
 2 tar包   直接解压安装
 3 yum安装  (centos的在线安装),在线安装的prm
 
安装rpm的常用命令:
 rpm -i 安装(install)
 rpm -ivh 安装并显示进度
 
=安装JDK======================
 安装之前,先检查一下是否安装过JDK
 OpenJDK 社区版jdk
 
  一;tomcat用户下设置jdk的环境变量即可,不影响其他的用户环境
 
 使用命令: chown 改变文件的所有者
 
 chown tomcat /opt/software/jdk-7u67-linux-x64.rpm
 
 注意:安装软件都要使用root
 安装rpm:
 rpm -ivh /opt/software/jdk-7u67-linux-x64.rpm
 
  二;在tomcat用户下,配置jdk的环境变量(用户级):=====
 1 cd
 2 ls -la (要查看隐藏文件)
 3 vi .bash_profile
   JAVA_HOME=/usr/java/jdk1.7.0_67
   export JAVA_HOME
   PATH=$JAVA_HOME/bin:$PATH:$HOME/bin
 
 4 echo $PATH 回显 (分隔符是:)
 
 5 切换用户(才生效),最终在tomcat用户下 java -version
 
    root用户下配置jdk环境变量(系统级别):=====
 1 vi etc/profile
  
   JAVA_HOME=/usr/java/jdk1.7.0_67
   export JAVA_HOME
   PATH=$JAVA_HOME/bin:$PATH
   export PATH
 
 2 source /etc/profile 让配置文件立即生效
 
=mysql安装:=============
 1 查找是否安装过mysql 的rpm包
   rpm -qa | grep mysql
   rpm -e mysql-libs-5.1.71-1.el6.x86_64 卸载
   若有依赖关系,需要强删:
   rpm -e mysql-libs-5.1.71-1.el6.x86_64 --nodeps

 2 解tar
   tar -xvf tar包 (解压到当前目录)
   tar -xvf tar包 -C   大写C指定目录( man tar)
 
 3 rpm安装顺序(先server 后client)
  
 4 查mysql的进程启动状态
   ps -ef|grep mysql
 
   chkconfig --list 查看所有服务
 
   service msyql start 启动mysql服务 
 
 5 进入mysql
   mysql -u root -p    (初始没有密码)
  
   改初始密码
   先
   退出mysql:exit
   再
   mysqladmin -u root -p password
   Enter password:    //直接Enter,因为初始没有密码
   New password:      //设置新密码
   Confirm new password:
 
 6 修改mysql的字符集--
   show variables like 'chara%'; --查看字符集是否设置为u8

   mysql> show variables like 'chara%';
  +--------------------------+----------------------------+
  | Variable_name            | Value                      |
  +--------------------------+----------------------------+
  | character_set_client     | utf8                       |
  | character_set_connection | utf8                       |
  | character_set_database   | latin1                     |
  | character_set_filesystem | binary                     |
  | character_set_results    | utf8                       |
  | character_set_server     | latin1                     |
  | character_set_system     | utf8                       |
  | character_sets_dir       | /usr/share/mysql/charsets/ |
  +--------------------------+----------------------------+
  8 rows in set (0.00 sec)

 
   
  通过修改配置文件,改字符编码
       配置文件在:/usr/share/mysql/my-small.cnf
       需要把my-small.cnf拷贝到etc目录下作为一个全局配置文件
       

 [tomcat@mylinux mysql]$ cat my-small.cnf 
       # Example MySQL config file for small systems.
       #
       # This is for a system with little memory (<= 64M) where MySQL is only used
       # from time to time and it's important that the mysqld daemon
       # doesn't use much resources.
       #
       # MySQL programs look for option files in a set of
       # locations which depend on the deployment platform.
       # You can copy this option file to one of those
       # locations. For information about these locations, see:
       # http://dev.mysql.com/doc/mysql/en/option-files.html
       #
       # In this file, you can use all long options that a program supports.
       # If you want to know which options a program supports, run the program
       # with the "--help" option.

       # The following options will be passed to all MySQL clients
       [client]
       #password = your_password
       port  = 3306
       socket  = /var/lib/mysql/mysql.sock

       # Here follows entries for some specific programs

       # The MySQL server
       [mysqld]
       port  = 3306
       socket  = /var/lib/mysql/mysql.sock
       skip-external-locking
       key_buffer_size = 16K
       max_allowed_packet = 1M
       table_open_cache = 4
       sort_buffer_size = 64K
       read_buffer_size = 256K
       read_rnd_buffer_size = 256K
       net_buffer_length = 2K
       thread_stack = 128K

       # Don't listen on a TCP/IP port at all. This can be a security enhancement,
       # if all processes that need to connect to mysqld run on the same host.
       # All interaction with mysqld must be made via Unix sockets or named pipes.
       # Note that using this option without enabling named pipes on Windows
       # (using the "enable-named-pipe" option) will render mysqld useless!
       # 
       #skip-networking
       server-id = 1

       # Uncomment the following if you want to log updates
       #log-bin=mysql-bin

       # binary logging format - mixed recommended
       #binlog_format=mixed

       # Causes updates to non-transactional engines using statement format to be
       # written directly to binary log. Before using this option make sure that
       # there are no dependencies between transactional and non-transactional
       # tables such as in the statement INSERT INTO t_myisam SELECT * FROM
       # t_innodb; otherwise, slaves may diverge from the master.
       #binlog_direct_non_transactional_updates=TRUE

       # Uncomment the following if you are using InnoDB tables
       #innodb_data_home_dir = /var/lib/mysql
       #innodb_data_file_path = ibdata1:10M:autoextend
       #innodb_log_group_home_dir = /var/lib/mysql
       # You can set .._buffer_pool_size up to 50 - 80 %
       # of RAM but beware of setting memory usage too high
       #innodb_buffer_pool_size = 16M
       #innodb_additional_mem_pool_size = 2M
       # Set .._log_file_size to 25 % of buffer pool size
       #innodb_log_file_size = 5M
       #innodb_log_buffer_size = 8M
       #innodb_flush_log_at_trx_commit = 1
       #innodb_lock_wait_timeout = 50

       [mysqldump]
       quick
       max_allowed_packet = 16M

       [mysql]
       no-auto-rehash
       # Remove the next comment character if you are not familiar with SQL
       #safe-updates

       [myisamchk]
       key_buffer_size = 8M
       sort_buffer_size = 8M

       [mysqlhotcopy]
       interactive-timeout
       [tomcat@mylinux mysql]$ 

      

  

   查找/etc目录下是否有my.cnf文件;
             ls -l | grep my.cnf (在/etc下查找是否有my.cnf文件存在)
  拷贝my-small.cnf到etc目录下,名my.cnf:
  cp /usr/share/mysql/my-small.cnf /etc/my.cnf
   在[mysqld]下面加上设置:
   character_set_server = utf8
  修改完成之后,重启mysql服务
   service mysql restart
 
 7 关闭防火墙 (service iptables stop) 不可取
   开启端口:
   iptables -I INPUT -p tcp --dport 3306 -j ACCEPT  开放3306端口
   service iptables save             保存配置
 
 8 查看mysql的日志 (看mysql的报错等)
   cd /var/lib/mysql
 
 9 SQLYoung访问,需要授权
 
    登录mysql后(%是全部ip可登陆,也可换成指定ip/也可以把root用户换成别的用户)
 MYSQL-->  grant all privileges on *.* to root@'%'
    identified by 'root用户密码' with grant option;
  
    flush privileges; 刷新mysql的系统权限相关表
   
=tomcat安装==================
 
 1 解压tar包
  tar -xvf tar包 -C 指定目录
  (  解压zip包
      unzip   )
 
 2 放开端口
    iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
   service iptables save 保存配置
 
 3 ./ 执行
   启动tomcat  ./startup.sh
   停止tomcat  ./shutdown.sh
 
 4 查看日志: tail -f log日志文件

分享到:
评论

相关推荐

    linux 安装软件

    在Linux操作系统中,安装软件的过程相对于Windows来说可能会稍显复杂,但通过理解不同的软件包格式和对应的管理工具,可以轻松掌握。Linux中的软件通常以不同的扩展名存在,这些扩展名代表了不同的打包格式,每种...

    linux安装软件各种教程集合

    在Linux操作系统中,安装软件可能对初学者来说显得有些复杂,因为它的机制与Windows或macOS等其他系统有所不同。但了解并掌握Linux软件安装的方法对于深入理解和使用Linux至关重要。以下是一些关于Linux安装软件的...

    linux安装软件和运行可执行程序

    ### Linux安装软件与运行可执行程序详解 在Linux操作系统中,安装软件和运行可执行程序是用户日常操作的重要组成部分。本文将围绕“Linux安装软件和运行可执行程序”这一主题展开,详细介绍各种安装方法及其背后的...

    【你知道怎么在Linux上安装软件吗?教你如何在Linux系统上安装软件 | Linux安装软件 | Linux教程

    【你真的了解Linux系统吗】你知道怎么在Linux上安装软件吗?教你如何在Linux系统上安装软件___Linux安装软件__

    linux安装软件方法.pdf

    linux安装软件方法,pdf格式,介绍了linux系统中软件的安装方法

    Linux下软件安装方法

    在Linux操作系统中,安装软件与Windows等其他操作系统的方式有所不同,特别是对于初学者而言,这个过程可能会显得较为复杂。Linux下的软件通常以源代码或RPM(Red Hat Package Manager)包的形式提供,需要根据不同...

    Linux安装软件

    在Linux操作系统中,安装软件与Windows或MacOS等其他系统有着不同的方式。Linux通常依赖于包管理器来处理软件的安装、更新和卸载。不过,对于某些特定的或者非开源的软件,我们可能需要手动下载源代码或者二进制包...

    Linux安装与软件使用技巧大全

    本文将详述Linux的安装过程以及一系列软件使用技巧,帮助初学者和有经验的用户更好地掌握这一强大的操作系统。 首先,让我们从Linux的安装开始。安装Linux主要有三种常见方式:Live CD/USB、图形化安装器和命令行...

    linux 安装软件tar和rpm命令.docx

    linux 安装软件tar和rpm命令.docx

    【Linux命令行怎么进行文件管理?教你如何在Linux系统进行文件管理 | Linux安装软件 | Linux教程

    【你真的了解Linux系统吗】Linux命令行怎么进行文件管理?教你如何在Linux系统进行文件管理___Linux安装软件__

    Linux安装软件(python脚本)_install_software.zip

    Linux安装软件(python脚本)_install_software

    linux 下安装软件

    Linux 下安装软件 Linux 是一个功能强大且灵活的操作系统,但是对于初学者来说,安装软件可能是一件困难的事情。下面我们将详细讲解 Linux 下安装软件的知识点。 Linux 软件安装方式 Linux 下安装软件可以通过...

    Linux入门及软件安装

    04/ Linux上常用软件安装 30 4.1 Linux系统软件安装方式 30 4.2 JAVA软件安装——JDK安装 30 4.3 JAVA软件安装——Tomcat安装 31 4.4 RPM方式软件安装——MySql数据库安装 31 4.5 YUM方式软件安装 34 4.6 C语言软件...

    Linux下安装软件视频教程

    Linux下安装软件视频教程,文件小但很实用,不信你试试

    【Linux下如何编辑文件?教你如何在Linux系统下对文件进行编辑 | Linux安装软件 | Linux教程 | VI/VIM编辑器教程

    【你真的了解Linux系统吗】Linux下如何编辑文件?教你如何在Linux系统下对文件进行编辑___Linux安装软件___L

    安装Linux应用软件的基本方法

    在 Linux 中安装应用软件是一项必要的技能,然而在 Linux 中安装应用软件却总是被一些不应该的问题所困扰,如怎么安装应用软件、软件安装在什么地方、如何删除不要的应用软件等。下面我们就来认识一下这些方面的知识...

    Linux常用软件安装

    在Linux安装常用软件 jdk mysql tomcat redis在Linux安装常用软件 jdk mysql tomcat redis

    Linux系统管理技术实验8-linux下软件的安装和卸载.doc

    Linux 系统管理技术实验八 Linux ...6. 执行 make install 命令安装软件。 本实验通过学习 RPM 和 Tarball 两种软件安装方式,掌握了 Linux 系统下软件的安装、查询和卸载的命令和过程,为日常工作和学习奠定了基础。

    Linux下安装Comodo Antivirus杀毒软件.docx

    Linux下安装Comodo Antivirus杀毒软件 Linux系统是一个相对安全的操作系统,但并不意味着它完全免疫于病毒和恶意软件的攻击。因此,在Linux系统中安装杀毒软件是一个非常重要的步骤。Comodo Antivirus是由Comodo ...

    linux下股票 软件

    这款应用简单易用,适合不希望安装复杂财务软件的用户。 8. **浏览器扩展:Morningstar** Morningstar提供了一系列浏览器扩展,包括Chrome和Firefox,用户可以在浏览器中直接查看股票信息和分析报告。这些扩展在...

Global site tag (gtag.js) - Google Analytics