Ubuntu 安装配置nginx记录
下载地址:http://nginx.org/download/
下载后解压
安装相关依赖
sudo apt-get install openssl libssl-dev
sudo apt-get install libpcre3 libpcre3-dev
sudo apt-get install zlib1g-dev
进入解压后的目录,运行
- $./configure
- $ make & make install
这边报错:
[alert]: could not open error log file: open() “/usr/local/nginx/logs/error.log” failed (13: Permission denied)
2011/03/21 06:09:33 [emerg] 24855#0: mkdir() “/usr/local/nginx/client_body_temp” failed (13: Permission denied)解决:
sudo chmod a+rwx -R logs
sudo chmod a+rwx -R /usr/local/nginx运行:
12> $ sudo sbin/nginx>启动运行
12> $ sudo nginx -s reload>重新启动
12> $ sudo service nginx restart>停止运行
12> $ sudo nginx -s stop>
nginx 部署静态页面
|
|
我将我的blog文件夹作为根目录,pwd:/home/ubuntu/blog
blog 目录 index.html css(文件夹) js(文件夹)
root即为 /home/ubuntu/blog/