ubuntu22.04离线安装jdk、mysql、redis、mongodb、nginx
ubuntu22.04离线安装jdk、mysql、redis、mongodb、nginx)
1 jdk-8u181安装
1.1 安装包列表
序号 | 名称 |
---|
1 | jdk-8u181-linux-x64.tar.gz |
1.2 安装方式
1)上传jdk-8u181-linux-x64.tar.gz安装包2)tar -zxvf jdk-8u181-linux-x64.tar.gz -C /usr/local3)cd ~4)vim .bashrcexport JAVA_HOME=/usr/local/jdk1.8.0_181export JRE_HOME=${JAVA_HOME}/jreexport CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/libexport PATH=${JAVA_HOME}/bin:$PATH5)source ./bashrc6)java -version
2 java依赖环境安装
2.1 安装包列表
序号 | 名称 |
---|
1 | net-tools_1.60+git20181103.0eebece-1ubuntu5_amd64.deb |
2 | unzip_6.0-20ubuntu1.1_amd64.deb |
3 | g++11.3.zip |
4 | gcc11.3.zip |
5 | make_4.3-4.1build1_amd64.deb |
2.2 安装方式
1)传输上述五个文件到服务器内(任意文件夹)。2)dpkg -i net-tools_1.60+git20181103.0eebece-1ubuntu5_amd64.deb 3)dpkg -i unzip_6.0-20ubuntu1.1_amd64.deb 4)cd g++11.3/ 5)dpkg -i *deb 6)cd ../gcc11.3 7)dpkg -i *deb 8)cd .. 9)dpkg -i make_4.3-4.1build1_amd64.deb 10)g++ -v 11)gcc -v
3 redis-6.0.19版本安装
3.1 安装包列表
序号 | 名称 |
---|
1 | redis-6.0.19.tar.gz |
2 | redis.conf |
3.2 安装方式
1)上传安装包到任意目录下2)mkdir -p /usr/local/redis 3)tar -zxvf redis-6.0.19.tar.gz -C /usr/local/redis 4)cd /usr/local/redis/redis-6.0.19 5)make 6)make install PREFIX=/usr/local/redis 7)mkdir -p /usr/local/redis/conf 8)cp /usr/local/redis/redis-6.0.19/redis.conf /usr/local/redis/conf 9)vim /usr/local/redis/conf/redis.conf
在GENERAL下增加或修改成daemonize yes #设置后台运行,如下图
在NETWORK下增加或修改bind 0.0.0.0 #修改ip,此处根据需求进行选择。
在SECURITY下增加或修改requirepass z1yOV4FN#0V@E #密码修改,此处可根据需求进行修改。
10)/usr/local/redis/bin/redis-server /usr/local/redis/conf/redis.conf 11)cd /usr/local/redis/bin 12)./redis-cli 13)auth z1yOV4FN14)quit
4 mongoDB-4.0.4安装
序号 | 名称 |
---|
1 | mongodb-linux-x86_64-4.0.4.tgz |
2 | mongodb.conf |
1)上传安装包到任意目录下2)mkdir /usr/local/mongoDB 3)tar -zxvf mongodb-linux-x86_64-4.0.4.tgz -C /usr/local/mongoDB/ 4)cd /usr/local/mongoDB/ 5)mv mongodb-linux-x86_64-4.0.4/ mongodbsoft/ 6)mkdir /usr/local/mongoDB/mongodbsoft/data logs etc 7)cp mongodb.config /usr/local/mongoDB/mongodbsoft/bin 8)./mongod --config /usr/local/mongoDB/mongodbsoft/bin/mongodb.conf 9)ps -ef |grep mongo 10)cd /usr/local/mongoDB/mongodbsoft/bin 11)./mongo 12)>use admin 13)>db.createUser( {user: "oneadmin",pwd: "密码",roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]}) 14)ctrl+c 15)./mongo 16)> use admin switched to db admin > db.auth("oneadmin","密码") 1 17)>show user 18)>use alimugo 19)>db.createUser({user:"root",pwd:"密码",roles:[{role:"dbOwner",db:"alimugo"}]}) 20)ctrl+c 21)./mongo 22)> use alimugo switched to db alimugo > db.auth("root","密码") 1 > show users 23)ctrl+c
5 nginx-1.14.2安装
序号 | 名称 |
---|
1 | nginx-1.14.2.tar.gz |
2 | pcre-zlib-openssl.zip |
3 | nginx.conf |
5.2 安装方式
1)上传1、2安装包到任意目录下。2)unzip pcre-zlib-openssl.zip 3)cd pcre-zlib-openssl/ 4)dpkg -i *.deb 5)tar -zxvf nginx-1.14.2.tar.gz -C /usr/loacl/ 6)cd /usr/local/nginx-1.14.2 7)./configure \--prefix=/usr/local/nginx \--sbin-path=/usr/local/nginx/sbin/nginx \--conf-path=/usr/local/nginx /conf/nginx.conf \ 8)make && make install 9). /usr/local/nginx/sbin/nginx -t
12)上传nginx.conf文件到/usr/local/nginx/conf目录下。13)cd /usr/local/nginx/sbin14)./nginx 15)ps -ef | grep nginx 16)/usr/local/nginx/sbin/nginx -s reload
6 Mysql-8.0.32 安装
6.1 安装包列表
序号 | 名称 |
---|
1 | mysql-server_8.0.32-1ubuntu22.04_amd64.deb-bundle.tar |
2 | libaio1_0.3.110-5_amd64.deb |
3 | libmecab2_0.996-5_amd64.deb |
6.2 安装方式
将部署包上传至任意目录
部署顺序
序号 | 名称 |
---|
1 | libaio1_0.3.110-5_amd64.deb |
2 | libmecab2_0.996-5_amd64.deb |
3 | mysql-community-client-plugins_8.0.32-1ubuntu22.04_amd64.deb |
4 | mysql-community-client-core_8.0.32-1ubuntu22.04_amd64.deb |
5 | mysql-common_8.0.32-1ubuntu22.04_amd64.deb |
6 | mysql-community-client_8.0.32-1ubuntu22.04_amd64.deb |
7 | libmysqlclient21_8.0.32-1ubuntu22.04_amd64.deb |
8 | libmysqlclient-dev_8.0.32-1ubuntu22.04_amd64.deb |
9 | mysql-client_8.0.32-1ubuntu22.04_amd64.deb |
10 | mysql-community-server-core_8.0.32-1ubuntu22.04_amd64.deb |
11 | mysql-community-server_8.0.32-1ubuntu22.04_amd64.deb |
12 | mysql-server_8.0.32-1ubuntu22.04_amd64.deb |
按照上表的顺序进行执行下列语句进行部署
1)dpkg -i libaio1_0.3.110-5_amd64.deb 2)dpkg -i libmecab2_0.996-5_amd64.deb 3)dpkg -i mysql-community-client-plugins_8.0.32-1ubuntu22.04_amd64.deb 4)dpkg -i mysql-community-client-core_8.0.32-1ubuntu22.04_amd64.deb 5)dpkg -i mysql-common_8.0.32-1ubuntu22.04_amd64.deb 6)dpkg -i mysql-community-client_8.0.32-1ubuntu22.04_amd64.deb 7)dpkg -i libmysqlclient21_8.0.32-1ubuntu22.04_amd64.deb 8)dpkg -i libmysqlclient-dev_8.0.32-1ubuntu22.04_amd64.deb 9)dpkg -i mysql-client_8.0.32-1ubuntu22.04_amd64.deb 10)dpkg -i mysql-community-server-core_8.0.32-1ubuntu22.04_amd64.deb 11)dpkg -i mysql-community-server_8.0.32-1ubuntu22.04_amd64.deb 12)dpkg -i mysql-server_8.0.32-1ubuntu22.04_amd64.deb
修改配置文件
1)cd /etc/mysql/mysql.conf.d/2)vim mysqld.cnflower_case_table_names = 1 skip-grant-tables default-storage-engine = InnoDBinnodb_file_per_table = 1max_connections = 1000max_connect_errors = 6000open_files_limit = 65535table_open_cache = 128max_allowed_packet = 4Mbinlog_cache_size = 1Mmax_heap_table_size = 8Mtmp_table_size = 16Mread_buffer_size = 2Mread_rnd_buffer_size = 8Msort_buffer_size = 8Mjoin_buffer_size = 8Mthread_cache_size = 8key_buffer_size = 4Mft_min_word_len = 4skip-external-lockinginnodb_open_files = 500innodb_buffer_pool_size = 64Minnodb_write_io_threads = 4innodb_read_io_threads = 4innodb_thread_concurrency = 0innodb_purge_threads = 1innodb_log_buffer_size = 2Minnodb_log_file_size = 32Minnodb_log_files_in_group = 3innodb_max_dirty_pages_pct = 90innodb_lock_wait_timeout = 120 bulk_insert_buffer_size = 8Minteractive_timeout = 28800wait_timeout = 28800
初始化数据库
1)systemctl stop mysql2)rm -rf /var/lib/mysql/3)mkdir /var/lib/mysql4)chown mysql:mysql /var/lib/mysql5)mysqld --initialize --user=mysql6)systemctl start mysql
修改数据库密码
1)mysql -uroot -p 2)不用输入密码直接登录3)mysql>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '我的密码'; 4)mysql> flush privileges;5)mysql>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '我的密码';6)mysql>quit
恢复密码验证
1)cd /etc/mysql/mysql.conf.d/2)vim mysqld.cnf3)删除或注释掉skip-grant-tables这句,再重启MySQL:systemctl restart mysql 。
导入数据库
1)mysql -uroot -p2)mysql>create database 数据库名;3)mysql>use 数据库名;4)mysql>source /绝对路径/ xxx.sql;
开通远程访问
1)mysql -uroot -p2)use mysql3)修改用户设置4)update user set host='%' where user='root';5)使修改生效6)flush privileges;7)设置远程密码8)ALTER USER 'root'@'%' IDENTIFIED BY '我的密码' PASSWORD EXPIRE NEVER;9)设置远程权限10)ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '我的密码';11)使修改生效12)flush privileges;
7 ffmpeg
7.1 安装包列表
序号 | 名称 |
---|
1 | ffmpeg-git-amd64-static.tar.xz |
7.2 安装方式
1)mkdir -p /usr/local/ffmpeg2)xz -d ffmpeg-git-amd64-static.tar.xz3)tar -xvf ffmpeg-git-amd64-static.tar.xz -C /usr/local/ffmpeg4)cd /usr/local/ffmpeg/ffmpeg-git-20200803-amd64-static5)./ffmpeg6)cd /usr/bin7)ln -s /usr/local/ffmpeg/ffmpeg-git-20200803-amd64-static/ffmpeg ffmpegln -s /usr/local/ffmpeg/ffmpeg-git-20200803-amd64-static/ffprobe ffprobe8)随意进入目录输入ffmpeg -i a.mp4
相关组件下载链接:链接:https://pan.baidu.com/s/1H1wsqueN32Dc_0cW5htaNA
提取码:e1sk
原创!仅供参考!点赞关注!谢谢支持!
来源地址:https://blog.csdn.net/qq_43098110/article/details/131064943
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341