-
-
Notifications
You must be signed in to change notification settings - Fork 3
Install
执行以下命令,添加Python 3.13的PPA仓库并安装Python 3.13:
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.13然后,安装pip:
sudo apt install python3-pip执行以下命令,安装nginx:
sudo apt update
sudo apt install nginx以下是推荐的nginx配置内容,将以下内容保存到/etc/nginx/sites-available/ideasphere:
server {
listen 80;
server_name your_server_ip;
location / {
proxy_pass http://127.0.0.1:5000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}替换your_server_ip为你的服务器IP地址,然后运行以下命令,使配置生效:
sudo ln -s /etc/nginx/sites-available/ideasphere /etc/nginx/sites-enabled/
sudo systemctl restart nginx执行以下命令,创建并激活Python虚拟环境:
python3.13 -m venv myenv
source myenv/bin/activate执行以下命令,拉取IdeaSphere源代码并安装依赖:
git clone https://github.com/IdeaSphere-team/IdeaSphere.git
cd IdeaSphere
pip install -r requirements.txt执行以下命令,启动IdeaSphere:
python app.py如果你想让IdeaSphere在后台运行,可以使用nohup命令:
nohup python app.py &如果你是通过终端直接启动IdeaSphere(如使用python app.py命令),关闭程序的方法取决于你如何启动它。以下是一些常见的情况:
-
在前台运行:如果IdeaSphere正在终端的前台运行,你可以通过按下
Ctrl + C来中断并停止程序。 -
在后台运行(使用
&):如果IdeaSphere是在后台启动的(例如使用python app.py &),你可以通过以下步骤关闭它:-
查找IdeaSphere进程:
ps aux | grep app.py这将显示与
app.py相关的进程信息,包括进程ID(PID)。 -
杀死进程: 使用查到的PID来杀死进程。例如,如果PID是1234,你可以运行:
kill 1234
-
-
使用
nohup或screen/tmux:如果使用了nohup或在screen/tmux会话中运行IdeaSphere,你可以先找到对应的进程,然后用kill命令关闭它,或者如果使用screen/tmux,可以重新附加上会话,然后在会话内使用Ctrl + C来停止程序。 -
使用进程管理工具:如果你使用了如
systemd等进程管理工具来管理IdeaSphere服务,你可以使用相应的命令来停止服务,例如:sudo systemctl stop ideasphere
(前提是已经为IdeaSphere创建了相应的
systemd服务文件并启用了服务。)