首页 > 系统服务 > 详细

ubuntu配置lamp运行环境笔记

时间:2015-04-17 01:04:07      阅读:314      评论:0      收藏:0      [点我收藏+]

step 1 安装lamp

sudo apt-get install lamp-server^

 

step2 配置apache环境

/*设置默认目录*/

在centos等系统中,apache的配置文件一般在 /etc/httpd/conf/httpd.conf下

而debian系统中,配置文件在 /etc/apache2/sites-enabled/000-default.conf

编辑该文件中的DocumentRoot就可以设置默认目录

之后重启apache 命令为:sudo /etc/init.d/apache2 restart  (显然还有start和stop)

会发现报错:Could not reliably determine the server‘s fully qualified domain name, using 127.0.1.1. Set the ‘ServerName‘ directive globally to suppress this  message

因为,apache server不能确定主机的域名,因此用IP127.0.1.1代替,解决办法在centos系统中添加 servername localhost:80 即可,在debian系统中,寻找        /etc/apache2/sites-available/default 在最顶端加入 ServerName 127.0.0.1即可。

/*设置默认主页*/

在centos中,找到httpd.conf中的DirectoryIndex,它改成DirectoryIndex index.php index.Html index.html 这样,你的网站目录的默认首页是 index.php, 如果没有index.php系统会自动寻找index.html、html。

 

step3 安装phpmyadmin

sudo apt-get install phpmyadmin

phpmyadmin一般安装在/usr/share只下,这时,必须使用软链接,先切换到我们设置的根目录下,然后 sudo ln -s /usr/share/phpmyadmin phpmyadmin即可。

ubuntu配置lamp运行环境笔记

原文:http://www.cnblogs.com/aleph/p/4433668.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!