首页 技术 正文
技术 2022年11月8日
0 收藏 384 点赞 1,178 浏览 2329 个字

该文接续之前写过的一篇:【树莓派】服务配置相关

这是我个人用来进行树莓派盒子安装配置的脚本,对于外部其他博友,可以部分参考,但不需要逐个引用。

现在有一定更新,部分按如下脚本来操作:

step1:

sudo groupadd wingspan
sudo useradd -g wingspan -d /home/lifeccp -m lifeccp -p lifeccp
sudo cp /etc/sudoers /etc/sudoers.default.bak
sudo sed -i '21a lifeccp ALL=(ALL:ALL) ALL' /etc/sudoers
sudo passwd lifeccp
#sudo visudo

step2:

# 退出,使用lifeccp账户登录
ssh-keygen -t rsa
tar -cvf ssh.tar.gz .ssh
cat .ssh/id_rsa.pub
cat .ssh/id_rsa# get info
sudo cat /proc/cpuinfo | grep Serial | awk '{print $3}' > a.txt
sudo ifconfig | grep HWaddr >> a.txt
sudo ifconfig | grep HWaddr | awk '{print $5}' >> a.txt
cat a.txt

step3:

sudo service ssh start
sudo service ssh status
--------服务配置
mkdir -p /home/lifeccp/webapp
mkdir -p /home/lifeccp/dicomsudo apt-get install chkconfigcd /home/lifeccp/webapp
上传文件
sudo chmod +x /home/lifeccp/webapp/pandion/serve
sudo chmod +x /home/lifeccp/webapp/pandion/startup
sudo chmod +x /home/lifeccp/webapp/pandion/pandion-v1.0.7.release.jarsudo chmod +x /home/lifeccp/webapp/osprey/serve
sudo chmod +x /home/lifeccp/webapp/osprey/startup
sudo chmod +x /home/lifeccp/webapp/osprey/osprey-v1.0.21.release.jar*sudo cp /home/lifeccp/webapp/pandion/serve /etc/init.d/pandion
sudo cp /home/lifeccp/webapp/osprey/serve /etc/init.d/ospreysudo chmod +x /etc/init.d/osprey
sudo chmod +x /etc/init.d/pandionsudo chkconfig --list
sudo chkconfig --add osprey
sudo chkconfig --add pandion
sudo chkconfig --list pandion
sudo chkconfig --list osprey

step4:

sudo apt-get install nginx -y
sudo chkconfig --add nginx
sudo chkconfig --level nginx on
# sudo apt-get install nginx -y
sudo cp /home/lifeccp/webapp/nginx-conf-prod/osprey.conf /etc/nginx/conf.d/osprey.confsudo cp /etc/hosts /etc/hosts.bak
sudo sed -i '$a 59.110.47.149 ef.lifeccp.com' /etc/hosts
sudo cp /etc/nginx/conf.d/osprey.conf /etc/nginx/conf.d/osprey.conf.bak
# sudo sed -i '1i upstream ef.lifeccp.com { \n server 59.110.47.149:80 max_fails=2 fail_timeout=30s ; \n } ' /etc/nginx/conf.d/osprey.confsudo sed -i '5i Welcome!You can send Email to nianhuaiju@qq.com,If the computer malfunctions.' /etc/motd
sudo userdel -rf pi
sudo groupdel pi

step5:

sudo vi /etc/dhcpcd.conf
interface eth0
static ip_address=192.168.21.135/
static routers=192.168.21.1
#static domain_name_servers=223.5.5.5 223.6.6.6
static domain_name_servers=218.30.19.40 61.134.1.4

或者:

sudo sed -i '$a interface eth1\n static ip_address=192.168.21.135/24\n static routers=192.168.21.1\n #static domain_name_servers=218.30.19.40 61.134.1.4' /etc/dhcpcd.conf
# sudo sed -i '$a # static domain_name_servers=223.5.5.5 223.6.6.6' /etc/dhcpcd.conf

step6:重启

sudo reboot

step7:

(待续)

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,487
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,903
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,736
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,487
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,127
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,289