ubuntu配置lamp运行环境笔记

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即可。

posted @ 2015-04-16 23:30  Aleph_zero  阅读(117)  评论(0编辑  收藏  举报