写点什么

申请鲲鹏 920 测试机试水 + 编译 nginx

用户头像
草宝虫
关注
发布于: 2020 年 04 月 22 日

申请测试机

https://dw.pcl.ac.cn/cloud/

提需求,填写公司信息,申请试用三个月的服务器,服务器CPU选择鲲鹏920,操作系统选择CentOS7

等一会审批后,登录进去,在云主机菜单就能看到服务器列表,点击服务器详情,看到服务器的管理员密码(即root用户的密码)和端口映射左侧22映射到对应的互联网ip和端口

xshell连接互联网IP和端口,输入用户名root,管理员密码

进入操作系统shell。

系统环境查看

看下cpu信息

[root@host-15-0-0-28 ~]# lscpu
Architecture: aarch64
Byte Order: Little Endian
CPU(s): 16
On-line CPU(s) list: 0-15
Thread(s) per core: 1
Core(s) per socket: 16
Socket(s): 1
NUMA node(s): 1
Model: 2
BogoMIPS: 100.00
NUMA node0 CPU(s): 0-15
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid

可以看到是aarch64架构,16核心

看下内存信息

[root@host-15-0-0-28 ~]# free -m
total used free shared buff/cache available
Mem: 32636 260 31593 33 783 29348
Swap: 0 0 0



可以看到是32GB内存

看下硬盘信息

root@host-15-0-0-28 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 200G 0 disk
├─sda2 8:2 0 520M 0 part /boot
├─sda3 8:3 0 79.4G 0 part
│ └─centos-root 253:0 0 79.4G 0 lvm /
└─sda1 8:1 0 100M 0 part /boot/efi



200GB,已分区80GB,剩下的要自己分区

软件环境

java -version

看到已经有java的openjdk环境了。

装一下wget

yum install -y wget



尝试安装nginx

sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
sudo yum install -y nginx



提示找不到aarch64架构的目录,啊……看来要自行编译了

准备编译安装nginx

编译环境安装

yum install -y gcc-c++
yum install -y pcre pcre-devel
yum install -y zlib zlib-devel
yum install -y openssl openssl-devel



看执行情况,aarch64架构的常见编译环境还是没有问题的

---> Package gcc-c++.aarch64 0:4.8.5-36.el7 will be updated
---> Package gcc-c++.aarch64 0:4.8.5-39.el7 will be an update
--> Processing Dependency: libstdc++-devel = 4.8.5-39.el7 for package: gcc-c++-4.8.5-39.el7.aarch64
--> Processing Dependency: libstdc++ = 4.8.5-39.el7 for package: gcc-c++-4.8.5-39.el7.aarch64
--> Processing Dependency: gcc = 4.8.5-39.el7 for package: gcc-c++-4.8.5-39.el7.aarch64



下载源码

wget http://nginx.org/download/nginx-1.17.10.tar.gz
#解压
tar xzvf nginx-1.17.10.tar.gz



编译

cd nginx-1.17.10
./configure --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-pcre --with-http_stub_status_module --with-http_gzip_static_module --with-http_ssl_module
make
make install



运维

#开启、关闭、重启nginx

/usr/local/nginx/nginx
/usr/local/nginx/nginx -s stop
/usr/local/nginx/nginx -s reload



修改配置

vi /usr/local/nginx/nginx.conf



访问

访问http://localhost

看到输出html即表示可以了



[root@host-15-0-0-28 nginx-1.17.10]# curl http://localhost
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style></style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>



发布于: 2020 年 04 月 22 日阅读数: 88
用户头像

草宝虫

关注

架构师(后端、大数据) 2018.12.21 加入

还未添加个人简介

评论

发布
暂无评论
申请鲲鹏920测试机试水+编译nginx