zoukankan      html  css  js  c++  java
  • ubuntu 10.10安装nginx+php的过程

    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 ipv4
    	listen   [::]:80 default ipv6only=on; ## listen for ipv6
    
    	server_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:9000
    
    	location ~ \.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=1
    zend_extension="/etc/zend/ZendOptimizer.so" ;将引号路径换成自己的路径
    
    ;将注释去掉cgi.fix_pathinfo=1;
  • 相关阅读:
    Linux CentOS6环境下MySQL5.1升级至MySQL5.5版本过程
    linux卸载mysql
    springboot2.x+security对明文密码加密
    AJAX模拟登录注册
    Jedis工具类
    java连接Redis
    centOS 6.5 以及7以上的开启端口,以及重启防火墙指令
    Mybatis连接数据库错误he server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one
    Git clone时出现Please make sure you have the correct access rights and the repository exists.问题已解决。
    Spring Cloud-集群配置的eureka
  • 原文地址:https://www.cnblogs.com/breg/p/2277927.html
Copyright © 2011-2022 走看看