sudo apt-get install nginx
提示 ImportError: No module named 'ConfigParser'。
原因:python3中并沒有ConfigParser這個(gè)模塊,為了遵循pep 8的標(biāo)準(zhǔn),已經(jīng)改名為configparser了。
解決方案:
cd /usr/bin/
有個(gè)文件叫做pycompile,還有個(gè)文件叫做py3compile,前者遵循的是python2的語(yǔ)法,而我們使用pip的時(shí)候使用的就是pycompile,我們只需要用py3compile中的內(nèi)容覆蓋pycompile中的內(nèi)容,這樣的話就解決這個(gè)問題了
啟動(dòng)命令:service nginx start
停止命令:service nginx stop
重啟命令:service nginx restart
查看服務(wù)狀態(tài):systemctl status nginx.service
Server Configuration
/etc/nginx: The nginx configuration directory. All of the Nginx configuration files reside here.
/etc/nginx/nginx.conf: The main Nginx configuration file. This can be modified to make changes to the Nginx global configuration.
/etc/nginx/sites-available/: The directory where per-site "server blocks" can be stored. Nginx will not use the configuration files found in this directory unless they are linked to the sites-enabled directory (see below). Typically, all server block configuration is done in this directory, and then enabled by linking to the other directory.
/etc/nginx/sites-enabled/: The directory where enabled per-site "server blocks" are stored. Typically, these are created by linking to configuration files found in the sites-available directory.
/etc/nginx/snippets: This directory contains configuration fragments that can be included elsewhere in the Nginx configuration. Potentially repeatable configuration segments are good candidates for refactoring into snippets.
Server Logs
/var/log/nginx/access.log: Every request to your web server is recorded in this log file unless Nginx is configured to do otherwise.
/var/log/nginx/error.log: Any Nginx errors will be recorded in this log.