安装mysql的服务与客户端,根据提示输入mysql的root密码
$sudo apt-get install mysql-server mysql-client
![](https://i-blog.csdnimg.cn/blog_migrate/8401e8d5ea88c24147024f07f37d83f6.webp?x-image-process=image/format,png/w/1240)
安装apache2服务器
$sudo apt-get install apache2
![](https://i-blog.csdnimg.cn/blog_migrate/4a2db79790aff8dd44323e106553fcb9.webp?x-image-process=image/format,png/w/1240)
安装php5
$sudo apt-get install php5 libapache2-mod-php5
![](https://i-blog.csdnimg.cn/blog_migrate/aa68efb03bdc92d56e590071753d9ec7.webp?x-image-process=image/format,png/w/1240)
安装相关其他相关的模块
$sudo apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
![](https://i-blog.csdnimg.cn/blog_migrate/265659b2855324d03d92a9a2ccbdcffa.webp?x-image-process=image/format,png/w/1240)
安装phpmyadmin管理数据库,安装配置完成后就可以在浏览器 地址栏 中127.0.0.1/phpmyadmin 登陆管理数据库了
$sudo apt-get install phpmyadmin
![](https://i-blog.csdnimg.cn/blog_migrate/748692a49487a765396da2f3e7bba5df.webp?x-image-process=image/format,png/w/1240)
![](https://i-blog.csdnimg.cn/blog_migrate/89bbc0a9c06ccc4f7a5ea04c33dbeecb.webp?x-image-process=image/format,png/w/1240)
现在浏览器地址栏目输入 127.0.0.1 看看是不是已经搭建完成了?
网站的默认目录是/var/www/html 很简单吧,更详细的配置小编就不多说了
ps:此笔记只为方便收藏,原地址:http://jingyan.baidu.com/article/ceb9fb10d572d88cad2ba093.html