ssh远程连接服务器常用命令

版权声明:本博客内容归个人所有,如需转载,请标明出处。 https://blog.csdn.net/m0_37468171/article/details/89238945

命令行下,使用ssh 远程登录服务器

ssh  '用户名'@'IP地址'    #不用加'号,这里是为了作区分
'用户名'@'IP地址''s password:  xxx

项目所在服务器目录

/home/jimsir/sites/www.lovejim.cn/DjangoBlog/JimWeb/JimWeb

gunicorn 网站部署

gunicorn --bind unix:/tmp/lovejim.cn.socket JimWeb.wsgi:application

Django-haystack框架结合中文jieba分词和英文whoosh引擎实现全文检索功能(参考:https://blog.csdn.net/weixin_40475396/article/details/78692981)

pip install whoosh   # 纯Python编写的全文搜索引擎
pip install jieba   # 一款免费的中文分词包
pip install django-haystack  # 全文检索的框架

激活虚拟环境

source env/bin/activate
source /home/jimsir/sites/www.lovejim.cn/env/bin/activate

nginx -s reload :修改配置后重新加载生效

Ubuntu下启动/重启/停止apache服务器

Task: Start Apache 2 Server /启动apache服务
# /etc/init.d/apache2 start
or
$ sudo /etc/init.d/apache2 start
Task: Restart Apache 2 Server /重启apache服务
# /etc/init.d/apache2 restart
or
$ sudo /etc/init.d/apache2 restart
Task: Stop Apache 2 Server /停止apache服务
# /etc/init.d/apache2 stop
or
$ sudo /etc/init.d/apache2 stop

Django 忘记管理员账户和密码的解决办法 :https://www.cnblogs.com/liyiran/p/4123637.html

猜你喜欢

转载自blog.csdn.net/m0_37468171/article/details/89238945