从零初始搭建自己的博客系统-emlog(一)
<h1 style="color: black; text-align: left; margin-bottom: 10px;">导语</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"> <span style="color: black;">非常多</span>人<span style="color: black;">皆想</span>搭建自己的独立博客系统,但不<span style="color: black;">晓得</span><span style="color: black;">怎样</span>操作。<span style="color: black;">这次</span>教程就满足下对<span style="color: black;">创立</span>网站不是很<span style="color: black;">认识</span>,又想搭建一个独立博客的<span style="color: black;">伴侣</span>,跟我<span style="color: black;">一块</span><span style="color: black;">循序渐进</span>安装<span style="color: black;">安排</span>emlog系统来实现这个小理想。</p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">环境准备</h1>下载emlog<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">EMLOG是every memory log的简<span style="color: black;">叫作</span>,即:点滴记忆,是国内<span style="color: black;">运用</span>php语言<span style="color: black;">研发</span>的一个轻量级开源博客系统,后台管理符合国人的思维习惯,<span style="color: black;">安排</span><span style="color: black;">亦</span>很方便。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"> 官网下载<span style="color: black;">位置</span>:http://www.emlog.net/</p>配置nginx+php环境<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">根据</span>官方安装说明,<span style="color: black;">举荐</span><span style="color: black;">运用</span>Linux+Apache主机,<span style="color: black;">原由</span>是Apache对emlog的伪静态支持的更好<span style="color: black;">有些</span>。本文<span style="color: black;">运用</span><span style="color: black;">运用</span>Nginx服务器来<span style="color: black;">安排</span>,Nginx的优点<span style="color: black;">自动</span>搜索,本文不做<span style="color: black;">仔细</span>介绍。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"> 文中的操作是在Linux Centos7系统上操作。</p>安装nginx <span style="color: black;"># yum install nginx </span>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"> 2. 安装完成后,<span style="color: black;">起步</span>nginx服务,</p> <span style="color: black;"># systemctl start nginx</span>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">3. 在浏览器里<span style="color: black;">拜访</span>http://x.x.x.x(x.x.x.x为你服务器的ip地址),查看nginx<span style="color: black;">是不是</span>安装成功。端口默认是80。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/dbfc41a11d7f48f69b26b6ec5fad7c0f~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1728082278&x-signature=n%2FNU%2FSPAukWZykDvUUb%2F05sfOx4%3D" style="width: 50%; margin-bottom: 20px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">nginx 默认页面</p>
</div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">看到上图,<span style="color: black;">暗示</span>成功安装nginx。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"> 4. 安装PHP和PHP-FPM</p> 更换yum源 <span style="color: black;"># yum install epel-release</span>
<span style="color: black;"># rpm -Uvh https:<span style="color: black;">//mirror.webtatic.com/yum/el7/webtatic-release.rpm</span></span> 安装php及其php扩展 <span style="color: black;"># yum install php72w php72w-fpm php72w-gd php72w-mysql php72w-mbstring php72w-xml php72w-mcrypt php72w-imap php72w-odbc php72w-pear</span><span style="color: black;">起步</span>php-fpm服务 <span style="color: black;"># systemctl start php-fpm</span>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">5.配置nginx与php<span style="color: black;">一块</span>工作:</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"> 打开nginx的主配置文件,添加以下代码:</p><span style="color: black;">location</span> / {
<span style="color: black;">root</span> /usr/share/nginx/html;
<span style="color: black;">index</span>index.html index.htm index.php;
}<span style="color: black;">location</span> <span style="color: black;">~ \.php$</span> {
<span style="color: black;">root</span> html;
<span style="color: black;">fastcgi_pass</span> <span style="color: black;">127.0.0.1:9000</span>;
<span style="color: black;">fastcgi_index</span> index.php;
<span style="color: black;">fastcgi_param</span> SCRIPT_FILENAME <span style="color: black;">$document_root</span><span style="color: black;">$fastcgi_script_name</span>;
<span style="color: black;">include</span> fastcgi_params;
}<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">而后</span>重启nginx服务:</p><span style="color: black;"># systemctl restart nginx</span>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">6.测试nginx与php<span style="color: black;">是不是</span>正常:</p>在nginx默认网站根目录下创建一个index.php文件:<span style="color: black;"># vi /usr/share/nginx/html/info.php</span>文件内容如下<span style="color: black;"><span style="color: black;"><?php</span>
phpinfo();
<span style="color: black;">?></span></span>; 在浏览器里<span style="color: black;">拜访</span>http://x.x.x.x/index.php(x.x.x.x为你服务器的ip<span style="color: black;">位置</span>),<span style="color: black;">显现</span>以下界面,说明php环境搭建成功。<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/f90bb5aa612249b99325c0596e5206ab~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1728082278&x-signature=vwCsefmpaCXv3rua3ZtXWyed78o%3D" style="width: 50%; margin-bottom: 20px;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">php环境成功页面</p>
</div>
页:
[1]