当前位置: 首页 > wzjs >正文

jsp网站开发案例东莞关键词优化软件

jsp网站开发案例,东莞关键词优化软件,3gb2c.com是什么网站,手机开发者模式怎么打开说明:这是我的学习笔记,很多内容转自网络,请查阅文章末尾的参考资料。 目录 安装 Ollama 和 DeepSeek没有root权限,如何安装?如果没有网络,如何安装?访问11434端口,没有显示 “Ollam…

说明:这是我的学习笔记,很多内容转自网络,请查阅文章末尾的参考资料。

目录

  • 安装 Ollama 和 DeepSeek
      • 没有root权限,如何安装?
      • 如果没有网络,如何安装?
      • 访问11434端口,没有显示 “Ollama is running"
      • localhost 访问拒绝的原因
  • 应用 AnythingLLM
  • 开发 LangChain + Ollama + DeepSeek
  • 参考资料

安装 Ollama 和 DeepSeek

  • Ollama官网,下载安装 Ollama
    安装完成以后,在浏览器中输入 http://localhost:11434/
    如果显示 “Ollama is running”,就说明安装成功。

  • Ollama Models网页 ,查看不同的 LLM 信息
    然后,在本地终端执行如下命令,可以自动下载 deepseek-r1:7b 模型(个人电脑适用)
    安装成功,就可以进行聊天对话了!

$ ollama run deepseek-r1:7b
pulling manifest 
... 
success
>>> how to run a test?
...
  • 配置和重启 ollama service
$ vim /etc/systemd/system/ollama.service
...
[Service]
...$ systemctl stop ollama.service
$ systemctl status ollama.service
$ systemctl restart ollama.service

没有root权限,如何安装?

特别说明:如果没有root 或者 sudo权限,需要按照下面的方法来安装

  • Why Ollama install script need SUDO? The install script does this because it needs to check for devices, drivers and set up an ollama user. The releases include pre-built binaries that will work without any sudo (e.g. just run ollama serve).
  • Ollama release 网页直接下载预编译好的二进制文件 (ollama-linux-amd64.tgz)
  • 解压并执行下面的命令运行即可(可能需要修改PATH环境变量)
$ tar xzf ollama-linux-amd64.tgz
...
$ ollama serve
$ ollama run deepseek-r1:7b

如果没有网络,如何安装?

  • 先用上面的方法,安装Ollama
  • 然后从一台已经安装好的机器上把model目录copy到没有网络的机器对应的目录

macOS: ~/.ollama/models
Linux: /usr/share/ollama/.ollama/models
Windows: C:\Users<username>.ollama\models

访问11434端口,没有显示 “Ollama is running"

curl http://localhost:11434/
curl http://localhost:11434/ -o ollama_page.html

This Page Cannot Be Displayed
The system cannot communicate with the external server ( localhost ). The Internet server may be busy, may be permanently down, or may be unreachable because of network problems.
Please check the spelling of the Internet address entered. If it is correct, try this request later.
If you have questions, please contact your organization’s network administrator and provide the codes shown below.

The error message you are encountering indicates that your Linux server is having trouble connecting to a service or application that is supposed to be running locally (on localhost). Here are some common reasons and troubleshooting steps you might consider:

  1. Service Not Running: Ensure that the service or application you are trying to access is running on your server. You can check the status of the service using commands like systemctl status <service-name> or ps aux | grep <service-name>.

  2. Port Issues: Verify that the service is listening on the expected port. Use commands like netstat -tuln or ss -tuln to see which ports are open and being used by services.

  3. Firewall Settings: Check if the firewall is blocking the connection to the service. Use iptables -L or firewalld commands to inspect and modify firewall rules as necessary.

  4. Configuration Errors: Review the configuration files for the service to ensure they are correctly set up to accept connections from localhost.

  5. DNS Resolution: Confirm that localhost is properly defined in the /etc/hosts file. It should typically map to 127.0.0.1.

  6. Network Issues: Ensure there are no network issues or restrictions that could be affecting the communication between services on your server.

  7. Logs: Check the logs for the specific service and system logs (e.g., /var/log/syslog or /var/log/messages) for any error messages that could provide more details.

localhost 访问拒绝的原因

针对“localhost拒绝访问”的问题,以下是一些可能的解决方法,你可以按照这些步骤逐一排查和尝试:

  1. 检查本地主机服务是否启动
    确保你尝试访问的本地服务(如Web服务器、数据库服务等)已经启动并且正在运行。例如,如果你在使用Apache或Nginx作为Web服务器,可以通过以下命令检查其运行状态(以Linux系统为例):
# 检查Apache服务器状态
sudo systemctl status apache2# 检查Nginx服务器状态
sudo systemctl status nginx

如果服务未启动,你可以使用sudo systemctl start apache2或sudo systemctl start nginx命令来启动服务。

  1. 检查防火墙设置是否阻止访问
    防火墙可能会阻止对localhost的访问。你可以检查防火墙规则,确保允许对本地主机的访问。以下是在Linux系统中检查防火墙状态的命令:
# 检查UFW防火墙状态(Ubuntu系统)
sudo ufw status# 检查iptables防火墙规则(通用Linux系统)
sudo iptables -L -v -n

如果发现防火墙阻止了访问,你可以添加相应的规则来允许访问。例如,使用UFW允许HTTP和HTTPS访问:

sudo ufw allow http
sudo ufw allow https
  1. 确认网络连接设置是否正确
    有时候,网络连接设置问题也可能导致无法访问localhost。你可以尝试使用ping命令来测试网络连接:
ping localhost

如果ping命令成功返回响应,说明网络连接基本正常。此外,你还可以检查网络适配器的设置,确保没有配置错误或冲突。

  1. 尝试重启本地主机服务
    有时候,重启本地主机服务可以解决一些暂时性的问题。你可以尝试重启你正在使用的服务,例如Web服务器、数据库服务等。重启服务的命令通常与启动服务的命令类似,只是将start替换为restart:
# 重启Apache服务器
sudo systemctl restart apache2# 重启Nginx服务器
sudo systemctl restart nginx
  1. 查看相关日志文件以获取更多错误信息
    如果以上步骤都没有解决问题,你可以查看相关日志文件以获取更多错误信息。日志文件通常包含有关问题的详细信息和可能的解决方案。例如,Apache服务器的错误日志文件通常位于/var/log/apache2/error.log,Nginx服务器的错误日志文件通常位于/var/log/nginx/error.log。

你可以使用以下命令来查看日志文件的内容:

# 查看Apache错误日志文件
sudo tail -f /var/log/apache2/error.log# 查看Nginx错误日志文件
sudo tail -f /var/log/nginx/error.log

应用 AnythingLLM

  • AnythingLLM官网,下载安装
  • 运行AnythingLLM
    在开始界面,“Search LLLM Providers”,选择我们刚才安装的 Ollama
  • 参考 AnythingLLM 手册,创建Workspace, 上传本地文档
    这样,一个本地知识库+LLM就搭建完成了!

开发 LangChain + Ollama + DeepSeek

# pip install langchain-ollama
from langchain_ollama.chat_models import ChatOllama
llm = ChatOllama(temperature=0.0,base_url="http://localhost:11434",model="deepseek-r1:14b"#model="deepseek-r1:7b"   # too simple#model="deepseek-r1:32b" # too slow
)

如果用终端调试,可以采用下面的方法,

$ curl http://localhost:11434/api/chat -d '{"model": "deepseek-r1:1.5b","messages": [{ "role": "user", "content": "why is the sky blue?" }]
}'

参考资料

  1. 用DeepSeek和AnythingLLM搭建个人知识库,简单又省事,关键还好用
  2. DeepSeek+本地知识库:真的太香了
  3. Building an End-to-End Gen AI App with DeepSeek-R1, Langchain, and Ollama
  4. LangChain - Run models locally
  5. LangChain - Ollama
  6. Enable installation without root priviledge
  7. windows离线ollama部署本地模型并配置continue实现离线代码补全
  8. Ollama使用指南
http://www.dtcms.com/wzjs/319078.html

相关文章:

  • 外国炫酷网站设计seo基本概念
  • 江苏泰兴网站建设郑州优化网站公司
  • 网站编程课程设计心得体会培训网址大全
  • 唐山医疗网站建设市场营销培训课程
  • 洛阳免费提供建站方案如何建立网站
  • 自己的服务器做网站域名解析平板电视seo优化关键词
  • 亚马逊卖家可以做促销的网站百度关键词排名提升工具
  • 大理装饰公司做网站优化排名推广技术网站
  • 免费创建论坛网站最专业的seo公司
  • 怎么建设国际网站首页如何制作网页广告
  • 一个网站的优势有哪些百度seo什么意思
  • 医院vi设计公司seo站外推广有哪些
  • 做现货值得关注的财经网站百度网站客服电话
  • html网站怎么做优化游戏的软件
  • 北京丰台做网站c++培训班学费一般多少
  • 大型网站运维公司星力游戏源码
  • jsp做网站视频教程百度网盘登录入口官网
  • wordpress网站变灰服务营销7p理论
  • 酒店协会网站集静态模板百度引擎入口
  • 建筑施工安全员c证查询邢台市seo服务
  • 潮州有没有做网站的人网络推广营销方式
  • 网站建设实训目的百度广告费一般多少钱
  • 一品威客做任务要给网站钱吗国外常用的seo站长工具
  • 从事网站开发需要哪些知识seochinazcom
  • 怎么做域名网站备案营销推广的平台
  • 怎样访问简版网站关键词查询
  • 一个专门做海鲜的网站怎么注册一个网站
  • 建网站的目的元搜索引擎有哪些
  • 怎么用dw英文版做网站何鹏seo
  • 电子商务网站建设基本步骤成都百度推广账户优化