Fork me on GitHub

【树莓派】服务配置相关2:基于RPi Desktop的服务配置

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

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

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

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/dicom

sudo apt-get install chkconfig

cd /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.jar

sudo 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/osprey

sudo chmod +x /etc/init.d/osprey
sudo chmod +x /etc/init.d/pandion

sudo 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 2345 nginx on
# sudo apt-get install nginx -y
sudo cp /home/lifeccp/webapp/nginx-conf-prod/osprey.conf /etc/nginx/conf.d/osprey.conf


sudo 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.conf

sudo 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/24
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:

(待续)

 

posted @ 2017-08-29 16:02  念槐聚  阅读(514)  评论(0编辑  收藏  举报

IT技术&应用开发&研究 - 创建于 2008年05月12日

这是一位IT工程师的个人站,内容主要是网站开发方面的技术文章,大部分来自学习或工作,部分来源于网络,希望对大家有所帮助。

致力于软件学习&研究工作,涉及Linux与软件开发出、测试、产品、行业相关知识,关注互联网前沿技术与与创业趋势等。


博客园 | Github | W3C

返回顶部