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

转载于:https://www.cnblogs.com/aleph/p/4433668.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值