Ubuntu16.04下安裝Nginx

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.

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容

  • NAME dnsmasq - A lightweight DHCP and caching DNS server....
    ximitc閱讀 2,910評(píng)論 0 0
  • Spring Cloud為開發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見模式的工具(例如配置管理,服務(wù)發(fā)現(xiàn),斷路器,智...
    卡卡羅2017閱讀 134,886評(píng)論 18 139
  • 愿望:下午六點(diǎn)前寫完案例分析。 結(jié)果:按時(shí)交作業(yè)。 在某種程度上得到放松 障礙:時(shí)間不夠,無法完成。 計(jì)劃:提高自...
    再見你好_8260閱讀 202評(píng)論 0 0
  • 關(guān)于寫作的書,很多人寫過書評(píng),趕上優(yōu)惠比較大,也買了一本。粗粗讀完,對(duì)自己最有啟發(fā)的是: 一、觸發(fā)。對(duì)經(jīng)驗(yàn)的事物,...
    明光照耀閱讀 364評(píng)論 0 1
  • 作者:小鋒子日期:2016-6-6 Grunt學(xué)習(xí)筆記 王福朋的博客 讀書:JavaScript Web 應(yīng)用開發(fā)...
    小鋒子_Gruad閱讀 118評(píng)論 0 1