准备工作
《深入理解Nginx》中说明的预备安装包:
gcc gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel
Debian实际安装:
sudo apt-get update
sudo apt-get install libpcre3 libpcre3-dev openssl libssl-dev libperl-dev
安装Nginx
安装Nginx的步骤:
源码下载:http://nginx.org/en/download.html
解压
./configure
make
sudo make install
查看安装:
ls /usr/local/nginx
启动与停止
启动Nginx:
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
查看Nginx进程:
ps -ef | grep nginx
kill掉进程
killall -9 nginx
验证安装
通过浏览器查看localhost页面,可以看到如下的内容:
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.
Thank you for using nginx.
即证明安装成功。
问题与解决
403 Forbidden
遇到 403 Forbidden 时,可能是权限问题,在nginx.conf头部加入一行:
user root;
然后重启nginx即可。
阅读原文 | 作者官网 | 公众号 | Feed | 订阅 | 发私信
最后
以上就是鲤鱼网络最近收集整理的关于Debian下安装Nginx笔记准备工作安装Nginx启动与停止验证安装问题与解决的全部内容,更多相关Debian下安装Nginx笔记准备工作安装Nginx启动与停止验证安装问题与解决内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复