林昱 發表於 2020-4-18 12:56:00

Deepin安装LAMP环境

<ul>
<li>版本:deepin V20</li>
</ul>
<h2 id="0-mysql安装">0. Mysql安装</h2>
<ul>
<li>我已经在我的另一篇博客写了如何安装mysql,建议先安装</li>
</ul>
<p>https://www.cnblogs.com/Jennyism/p/deepin-mysql-install.html</p>
<h2 id="1-apache安装">1. Apache安装</h2>
<ul>
<li>使用apt安装(如果刚装系统没有换源,建议先换源,mysql安装文章有写如何换源)</li>
</ul>
<pre><code class="language-shell">sudo apt-get install apache2
</code></pre>
<h2 id="11-配置">1.1 配置</h2>
<ul>
<li>
<p>没有什么特殊的配置,我觉得不要让apache占用我们的80端口就好</p>
</li>
<li>
<p>它的配置文件可能跟我们以前配置文件不在同个地方,在 <strong>/etc/apache2</strong></p>
</li>
<li>
<p>里面有ports.conf,我们可以在里面修改我们的端口</p>
</li>
</ul>
<pre><code class="language-shell">sudo vim ports.conf


# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

Listen 8766

&lt;IfModule ssl_module&gt;
        Listen 443
&lt;/IfModule&gt;

&lt;IfModule mod_gnutls.c&gt;
        Listen 443
&lt;/IfModule&gt;

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

按i (进入编辑模式)
把Listen修改为 8766 或者你喜欢的端口
按esc键退出编辑模式
:wq写入并退出
</code></pre>
<h2 id="2-php安装">2. PHP安装</h2>
<pre><code class="language-shell">sudo apt-get install php
</code></pre>
<h2 id="3-测试">3. 测试</h2>
<ul>
<li>重启Apache</li>
</ul>
<pre><code class="language-shell">service apache2 restart
service apache2 status (查看状态)
</code></pre>
<ul>
<li>测试PHP环境</li>
</ul>
<p>新建一个php文件</p>
<pre><code class="language-php">&lt;?php
        phpinfo();
?&gt;
</code></pre>
<p>复制到 /var/www/html 文件夹</p>
<pre><code class="language-shell">sudo mv test.php /var/www/html
</code></pre>
<p>访问 127.0.0.1:8766/test.php测试</p><br><br>
来源:https://www.cnblogs.com/Jennyism/p/deepin-lamp-install.html
頁: [1]
查看完整版本: Deepin安装LAMP环境