永夜海 发表于 2015-8-19 13:37:13

ubuntu 12.04 lamp配置

  1、安装apache
  apt-get install apache2
  
  2、安装php
  apt-get install php5
  3、配置php+apache
  apt-get install libapache2-mod-php5
  4、apt-get install mysql-server
  安装mysql到时候会让你输入密码
  5、apt-get install php5-mysql
  至此配置完毕,可以使用了
  测试
  apache 默认指向到路径在/usr/www/这个目录下
  新建一个php文件,测试链接myql数据库即可。
  在终端下执行到话。
  root@xgw-Rev-1-0:/var/www#php 文件名
  或者/usr/bin php 文件名
  安装phpmyadmin
  apt-get install phpmyadmin
  默认到路径是装到了这里 /usr/share/phpmyadmin/
  我们需要做一个软链接
  ln -s /usr/share/phpmyadmin/ /var/www/
  这样我们就可以访问了localhost/phpmyadmin/
  
  


Ubuntu下启动/重启/停止apache服务器
2010-09-28 19:53:58|分类: Apache|字号 订阅



Task: Start Apache 2 Server /启动apache服务  # /etc/init.d/apache2 start
or
$ sudo /etc/init.d/apache2 start
Task: Restart Apache 2 Server /重启apache服务  # /etc/init.d/apache2 restart
or
$ sudo /etc/init.d/apache2 restart
Task: Stop Apache 2 Server /停止apache服务  # /etc/init.d/apache2 stop
or
$ sudo /etc/init.d/apache2 stop
  
  http://hi.baidu.com/phpshare/item/8a420ff63406b105d89e72ce
页: [1]
查看完整版本: ubuntu 12.04 lamp配置