<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>linux &#8211; 萧邦的博客</title>
	<atom:link href="https://www.zlhlab.top/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.zlhlab.top</link>
	<description>If not me who, If not now when</description>
	<lastBuildDate>Thu, 29 Jun 2017 14:22:05 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.6</generator>
	<item>
		<title>阿里云Centos7上搭建LNMP服务器环境</title>
		<link>https://www.zlhlab.top/%e9%98%bf%e9%87%8c%e4%ba%91centos7%e4%b8%8a%e6%90%ad%e5%bb%balnmp%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%8e%af%e5%a2%83/</link>
		
		<dc:creator><![CDATA[萧邦]]></dc:creator>
		<pubDate>Thu, 29 Jun 2017 14:22:05 +0000</pubDate>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>
		<guid isPermaLink="false">https://www.zlhlab.top/?p=149</guid>

					<description><![CDATA[阿里云Centos7上搭建LNMP服务器环境，为个人博客和Laravel商城开发做准备。 安装 1、安装 Ng<div class="more-link">
				 <a href="https://www.zlhlab.top/%e9%98%bf%e9%87%8c%e4%ba%91centos7%e4%b8%8a%e6%90%ad%e5%bb%balnmp%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%8e%af%e5%a2%83/" class="link-btn theme-btn"><span>Read More </span> <i class="fa fa-caret-right"></i></a>
			</div>]]></description>
										<content:encoded><![CDATA[<p>阿里云Centos7上搭建LNMP服务器环境，为个人博客和Laravel商城开发做准备。</p>
<p><strong>安装</strong></p>
<p>1、安装 Nginx :</p>
<pre><code>yum install nginx18 -y</code></pre>
<pre><code>systemctl start nginx.service #启动nginx
systemctl stop nginx.service #停止nginx
systemctl restart nginx.service #重启nginx
systemctl enable nginx.service #设置nginx开机启动
</code></pre>
<p>2、安装MariaDB（CentOS 7.0中，已经使用MariaDB替代了MySQL数据库）</p>
<p>安装</p>
<pre><code>yum install mariadb mariadb-server -y #安装
systemctl start mariadb.service #启动MariaDB
systemctl stop mariadb.service #停止MariaDB
systemctl restart mariadb.service #重启MariaDB
systemctl enable mariadb.service #设置开机启动
</code></pre>
<pre><code>cp /usr/share/mysql/my-huge.cnf /etc/my.cnf #拷贝配置文件（注意：如果/etc目录下面默认有一个my.cnf，直接覆盖即可）
</code></pre>
<p>设置Root密码</p>
<pre><code>mysql_secure_installation
#回车，根据提示输入Y
#输入2次密码，回车
#根据提示一路输入Y
#最后出现：Thanks for using MySQL!
#MariaDB密码设置完成，重新启动 MariaDB：
systemctl restart mariadb.service #重启MariaDB
</code></pre>
<p>3、安装 PHP :</p>
<p>建议将下面插件一次性安装,如mbstring、openssl插件，避免单独安装出现的坑~~！</p>
<pre><code>yum install php71w-fpm php71w-mysql php71w-mysqli php71w php71w-opcache php71w-gd php71w-intl php71w-mbstring php71w-exif php71w-mcrypt php71w-openssl -y
</code></pre>
<p>php服务相关操作</p>
<pre><code>systemctl start php-fpm.service #启动php-fpm
systemctl stop php-fpm.service #停止php-fpm
systemctl restart php-fpm.service #重启php-fpm
systemctl enable php-fpm.service #设置开机启动
</code></pre>
<p><strong>配置</strong></p>
<p>1、配置php-fpm:</p>
<pre><code>vi /etc/php-fpm.d/www.conf

#修改user和group
user = nginx
group = nginx
</code></pre>
<p>2、配置 Nginx:</p>
<pre><code>    server {
        listen       80 default_server;
        # listen       [::]:80 default_server;
        server_name  www.geek720.com;
        # set $root_path        /var/www/laravel/market/public/;
        set $root_path  /var/www/websites/blog;
        root $root_path;
        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;
        index   index.html index.htm index.php;

        location / {
            try_files $uri $uri/ /index.php?$query_string;
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
 location ~ \.php {
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index /index.php;

            include /etc/nginx/fastcgi_params;

            fastcgi_split_path_info     ^(.+\.php)(/.+)$;
            fastcgi_param PATH_INFO     $fastcgi_path_info;
            fastcgi_param PATH_TRANSLATED       $document_root$fastcgi_path_info;
            fastcgi_param SCRIPT_FILENAME       $document_root$fastcgi_script_name;
        }

        location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
            root $root_path;
        }

        location ~/\.ht {
            deny all;
        }
    }
</code></pre>
<p>3、重启nginx服务</p>
<pre><code>service nginx restart</code></pre>
<p>4、在配置目录/var/www/websites/blog下，创建测试文件index.php,如能正常访问，则安装正常。</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
