ubuntu nginx安装(ubuntu22.04安装nginx失败)

本文目录
- ubuntu22.04安装nginx失败
- Ubuntu 下使用 Docker 安装 Nginx
- ubuntu安装nginx遇到的问题及解决方案
- Ubuntu 简单实践keepalived +nginx
- ubuntu安装nginx,make的时候出错,求大神解答
- Armbian-Ubuntu18.04安装Nginx、PHP7.2和可道云
- ubuntu服务器 自己安装的nginx 宝塔安装nginx 和通过宝塔安装的nginx一样吗
ubuntu22.04安装nginx失败
重新安装。
1、更新系统后重新安装。
2、到nginx官网下载源码包,再重新安装。
Ubuntu2204LTS是Canonical于2022年4月21日发布的操作系统,代号为JammyJellyfish,采用GNOME电源配置文件和流线型工作空间过渡,提高优化图形驱动程序上的桌面帧速率。
Ubuntu 下使用 Docker 安装 Nginx
docker pull nginx
将 nginx.conf 配置文件放在 /your/dir/conf/ 下。
将 default.conf 配置文件放在 /your/dir/conf/conf.d 下。
将容器 80 端口映射到主机 80 端口。
ubuntu安装nginx遇到的问题及解决方案
1.apt安装包时太慢,切换了阿里数据源,执行sudo ./configure --prefix=/usr/local/nginx 时报 ./configure: error: C compiler cc is not found错误,
然后执行sudo apt install build-essential,仍然不行
2.切换成清华数据源 执行 sudo apt install build-essential成功,解决 ./configure: error: C compiler cc is not found的错误。
3.继续用configure构建程序报 没有pcre,执行sudo apt-get install libpcre3 libpcre3-dev 和 sudo apt-get install openssl libssl-dev,解决该问题
4.继续构建程序 报需要zlib包,sudo apt install zlib1g 和 sudo apt install zlib1g-dev,解决该问题
5.重新构建nginx没有再报错了~
6.执行sudo make && sudo make install 安装完成
Ubuntu 简单实践keepalived +nginx
1.两台ubuntu虚拟机
2.安装nginx
3.安装keepalived
安装nginx 自行参考ubuntu 安装nginx
我们需要在 /etc/keepalived 目录下新建一个 check_nginx.sh 的脚本文件,文件内容如下
给文件添加权限
复制keepalived 的配置文件 到固定位置 /etc/keepalived/ 启动是去这个目录下面读取配置文件信息
备份一下这个配置文件 然后修改 /etc/keepalived/keepalived.conf
参考文档:
***隐藏网址***
***隐藏网址***
***隐藏网址***
ubuntu安装nginx,make的时候出错,求大神解答
Nginx安装问题
***隐藏网址***
解压安装,这个不解释
问题出现1:
?
1
2
3
4
./configure: error: the HTTP rewrite module requires the PCRE library.
***隐藏网址***
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=《path》 option.
解决1:
?
1
sudo apt-get install libpcre3 libpcre3-dev
问题出现2:
?
1
2
3
4
./configure: error: the HTTP gzip module requires the zlib library.
***隐藏网址***
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using --with-zlib=《path》 option.
解决2:
***隐藏网址***
直接解压安装
?
1
which zlib
查看一下,有可能还需要安装:
?
1
sudo apt-get install openssl libssl-dev
执行configure操作:
?
1
2
3
4
***隐藏网址***
make
make install
启动:
?
1
/usr/local/nginx/sbin/nginx
测试:
?
1
***隐藏网址***
干净卸载nginx
命令:
?
1
sudo apt-get --purge autoremove nginx
命令:
?
1
which nginx
Armbian-Ubuntu18.04安装Nginx、PHP7.2和可道云
安装nginx,参考 Armbian-N1源码安装Nginx
若armbian中没有软件源,报错 Unable to locate package php7.2 ,需要先添加软件源:
然后再进行安装。
1. fpm.ini配置文件路径: /etc/php/7.2/fpm/php.ini
2. www.conf 文件路径: /etc/php/7.2/fpm/pool.d/www.conf
3. 重启php服务
4. 配置 nginx可解析 .php文件
修改 /usr/local/nginx/conf/nginx.conf 文件中 server{} 配置:
重启nginx: systemctl restart nginx
5. 测试nginx和php是否配置成功
在 /usr/local/nginx/html 中创建test.php,里面内容如下
***隐藏网址***
重启nginx: systemctl restart nginx
***隐藏网址***
ubuntu服务器 自己安装的nginx 宝塔安装nginx 和通过宝塔安装的nginx一样吗
ubuntu服务器 自己安装的nginx 宝塔安装nginx 和通过宝塔安装的nginx不一样
服务器上有两个nginx,一个是宝塔面板的一个是自己Xshell命令装的。
一般情况下我们自己用Xshell都是安装到:/usr/local/nginx
然后我打开了另一个:/usr/bin 目录可以看到nginx果然指向的是宝塔面板安装的nginx,这样就能区别开了。

更多文章:
在from子句中可以出现(如何在from 子句中嵌套查询下面的语句在access中出错!)
2026年10月11日 05:20
countif函数统计个数怎么用(countif函数怎么用 详解Excel中countif函数的使用方法)
2026年10月11日 03:30
正则匹配数字之前的字符(正则表达式如何匹配前面是数字、中间是“/”、后面也是数字,就像2/3专业的模式)
2026年10月11日 03:00
orlnsertbootmediinselected(我电脑开机显示这个是什么意思or insert boot media in select)
2026年10月10日 23:00
display的用法(display是什么意思 详解display的含义和用法)
2026年10月10日 22:00
html全部居中代码(怎么让网页居中显示,html如何让网页居中)
2026年10月10日 21:10





