直播服务器搭建
<p><strong>服务器环境:</strong> </p>
<ul>
<li>Linux系统</li>
</ul>
<p><strong>安装宝塔:</strong> </p>
<ul>
<li><code>yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && bash install.sh</code></li>
</ul>
<p><strong>获取默认登录账号密码及登录地址:</strong></p>
<ul>
<li><code>bt default</code></li>
</ul>
<p><strong>首页选择安装Lnmp环境:</strong></p>
<ul>
<li>极速编译 mysql-5.7 nginx-1.5 phpmyadmin-5.6 php- 7.1</li>
</ul>
<p><strong>安装Redis:</strong></p>
<ul>
<li>进入软件面板,安装redis - 5.0</li>
</ul>
<p><strong>开发端口:</strong></p>
<ul>
<li>进入安全页面,开放端口8282、9001</li>
</ul>
<p><strong>添加网站:</strong></p>
<ul>
<li>选择网站,添加网站,填写域名,不创建数据库</li>
</ul>
<p><strong>上传文件至网站目录并解压:</strong></p>
<ul>
<li>打开网站位置,上传网站压缩包并解压至当前目录。</li>
</ul>
<p><strong>修改文件权限:</strong></p>
<ul>
<li>修改网站根目录下的storage文件夹权限为777,所有者和网站根目录相同。</li>
</ul>
<p><strong>创建数据库:</strong></p>
<ul>
<li>选择数据库,创建数据库,填写数据名,上传sql文件,导入sql数据库文件,</li>
</ul>
<p><strong>更改网站根目录.env文件:</strong></p>
<ul>
<li>.env文件为项目环境文件,需要配置网站域名,数据库</li>
</ul>
<p><strong>配置网站:</strong></p>
<ul>
<li>选择网站运行目录为public</li>
<li>选择伪静态为laravel</li>
</ul>
<p><strong>安装spuervisor进程管理系统:</strong></p>
<ul>
<li><code>easy_install supervisor</code></li>
<li>添加如下配置文件至<code>etc/supervisor/conf.d</code>文件夹下,其中文件路径<code>/www/wwwroot/liveapp3/</code>更换为项目实际路径</li>
</ul>
<pre><code>[program:liveapp2-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /www/wwwroot/liveapp3/artisan queue:work
autostart=true
autorestart=true
user=root
numprocs=1
redirect_stderr=true
stdout_logfile= /www/wwwroot/liveapp3/storage/logs/laravel.log</code></pre>
<ul>
<li>文件配置完成后启动supervisor进程守护</li>
</ul>
<p><strong>启动workerman:</strong></p>
<ul>
<li>进入项目根目录,输入以下命令</li>
<li><code>php start.php start -d</code></li>
</ul>