ubuntu 10.10安裝nginx+php的過程

來源:互聯網
上載者:User
ubuntu 10.10安裝nginx+php的過程

裝上系統也有一段時間了,也沒有裝,今天工作時打算用ubuntu開發了,所以就安裝nginx,在公司電腦就一路順風啊!

安裝教程地址在這裡:http://www.cnblogs.com/breg

當然可以baidu,google其實大體上都差不多,

回家時把我的本本也裝上吧!誰知道公司電腦的順利在筆記本上就一波三折,最終在多費很多時間和腦力的情況下終於圓滿解決!

其實具體還是很簡單的,只是要注意幾個配置的問題!

其主要配置有這些:

1.sudo gedit /etc/nginx/sites-available/default

server {listen   80; ## listen for ipv4listen   [::]:80 default ipv6only=on; ## listen for ipv6server_name  localhost;access_log  /var/log/nginx/localhost.access.log;location / {root   /var/www/nginx-default;index  index.html index.htm index.php;}location /doc {root   /usr/share;autoindex on;allow 127.0.0.1;deny all;}location /images {root   /usr/share;autoindex on;}error_page  404  /404.html;# redirect server error pages to the static page /50x.html#error_page   500 502 503 504  /50x.html;location = /50x.html {root   /var/www/nginx-default;}# proxy the PHP scripts to Apache listening on 127.0.0.1:80##location ~ \.php$ {#proxy_pass   http://127.0.0.1;#}# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000location ~ \.php$ {fastcgi_pass   127.0.0.1:9000;fastcgi_index  index.php;fastcgi_param  SCRIPT_FILENAME  /var/www/nginx-default$fastcgi_script_name; #注意替換網站路徑,不然要報input的錯誤include fastcgi_params; #特別注意此處有空格,原始檔案時沒有空格的,我的nginx啟動不了就是忘了改這裡}# deny access to .htaccess files, if Apache's document root# concurs with nginx's one##location ~ /\.ht {#deny  all;#}}

2.sudo gedit /etc/php5/cgi/php.ini

;zend的安裝[Zend Optimizer]zend_optimizer.optimization_level=1zend_extension="/etc/zend/ZendOptimizer.so" ;將引號路徑換成自己的路徑;將注釋去掉cgi.fix_pathinfo=1;

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.