Arm架构服务器环境配置

内容纲要

Mysql

#安装
apt-get install default-mysql-server
#启动
#1.使用 service 启动:
service mysql start
#2.使用 mysqld 脚本启动:
/etc/inint.d/mysql start
#3.进入:mysql
进入:mysql
#4.修改密码:
set password for root@localhost = password('123456');

根据源的服务器不同,安装时长不同,尽量选择速度较好的服务器。

Mongodb

1、Mongodb官网下载安装文件,参考下面图片的内容下载,下载arm64位,可以选ubuntu20的版本。

官网选择Package的 mongos、 server、 shell、tools、tgz下载即可。

如果系统环境相关依赖版本较低,可以下载4.0.27版本。

Arm架构服务器环境配置

2、导入公钥

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5

3、分别安装,上传到home文件夹中

Arm架构服务器环境配置

依次安装下面5个软件即可,中间报错暂时忽略:

dpkg -i mongodb-org-shell_4.4.5_arm64.deb 
dpkg -i mongodb-org-tools_4.4.5_arm64.deb 
dpkg -i mongodb-org-mongos_4.4.5_arm64.deb 
dpkg -i mongodb-org-server_4.4.5_arm64.deb 
dpkg -i mongodb-org_4.4.5_arm64.deb

apt search mongodb

安装好后检查如图

Arm架构服务器环境配置

4、新建数据的目录在data目录下面新建db目录

mkdir /data/db
cd /data/db

Arm架构服务器环境配置

5、打开终端,执行 mongod –dbpath /data/db(dbpath指向的路径是安装mongoDB时,创建的存放数据目录,就是data/db那个路径,可根据自己创建的路径位置做对应修改)出现如上图的内容,就证明第一步ok

mongod --dbpath /data/db

6、执行mongo,进入mongo数据库

Arm架构服务器环境配置

PostgreSQL

  • 创建文件存储库配置
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list
  • 导入存储库签名密钥
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
  • 更新包列表
sudo apt-get update
  • 安装最新版本的PostgreSQL If you want a specific version, use ‘postgresql-12’ or similar instead of ‘postgresql’
sudo apt-get -y install postgresql-13

注意不同sudo权限。

  • PostgreSQL的默认会创建一个postgres账号,所以我们要切换账号:
su postgres
  • 创建数据库
pg_createcluster 13 main --start
  • 改权限
chmod -R 700 /etc/ssl/private/ssl-cert-snakeoil.key
chmod -R 700 /etc/ssl/private/ssl-cert-snakeoil.key
  • 启动
/etc/init.d/postgresql start
  • 用命令psql测试
psql

详细文档和常见问题参考官网:https://www.postgresql.org/download/linux/debian/

apache2

  • 安装
apt-get install apache2
  • 启动
/etc/init.d/apache2 start
  • 配置文件修改 apache2修改端口,在document可以快速找到下列文件并修改

修改 /etc/apache2/ports.conf 将 Listen 80 改为自己需要的端口,如 Listen 9321,修改/etc/apache2/sites-enabled/000-default.conf,将第一行的

<VirtualHost *:80>

改为自己需要的端口

<VirtualHost *:9321>

在document打开文件 /etc/apache2/apache2.conf,在最后添加:

ServerName localhost:9321
  • 重启
service apache2 restart
  • 打开浏览器验证 http://localhost:9321/

nginx

  • 安装
apt-get install nginx
  • 修改配置文件

配置文件路径:

/etc/nginx/sites-enabled/default
listen 80 default_server;

在文件管理工具里面修改自己需要的端口号

listen 9322 default_server;
listen [::]:9322 default_server;
  • 重新加载
/etc/init.d/nginx reload
  • 重新启动
/etc/init.d/nginx start
  • 查看状态
/etc/init.d/nginx status

code enjoy! 🐾🐾🐾🐾🐾🐾🐾🐾🐌🐝

作者:indeex

链接:https://indeex.club

著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


发表评论

您的电子邮箱地址不会被公开。