Ubuntu下安裝lamp

今日來一首插曲,為大家送上一篇lamp在Ubuntu上的安裝,首先介紹一下Lamp:
LAMP 是指一組通常一起使用來運(yùn)行動(dòng)態(tài)網(wǎng)站或者服務(wù)器的自由軟件名稱首字母縮寫:
=============
Linux,操作系統(tǒng)
=============
Apache,網(wǎng)頁服務(wù)器
=============
MySQL,數(shù)據(jù)庫管理系統(tǒng)(或者數(shù)據(jù)庫服務(wù)器)
=============
PHP
=============

1. 安裝 Apache

<code>sudo apt-get install apache2</code>

  1. 安裝 MySQL

<code>sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql</code>激活:
<code>sudo mysql_install_db</code>
運(yùn)行 MySQL set up 腳本
<code>sudo /usr/bin/mysql_secure_installation</code>接下來會(huì)讓你填寫密碼。

  1. 安裝 PHP
    <code>sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt</code>將 php 加入到目錄索引:
    <code>sudo nano /etc/apache2/mods-enabled/dir.conf</code>在首行添加:
    <code><IfModule mod_dir.c> DirectoryIndex index.php index.html index.cgi index.pl index.php index.xhtml index.htm</IfModule></code>添加PHP 有各種有用的庫和模塊
    <code>apt-cache search php5</code>-裝入模塊:
    <code>sudo apt-get install name of the module</code>此時(shí)已經(jīng)安裝好了,接下來我們查看一下效果:首先創(chuàng)建新文件:<code>
    sudo nano /var/www/html/info.php添加下面的代碼:
    <?phpphpinfo();?>
    </code>
    重啟 apache 以讓更改生效:
    sudo service apache2 restart然后訪問:URL/info.php
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容