zoukankan      html  css  js  c++  java
  • 在Ubuntu上安装LAMP服务器

    1.安装Ubuntu上安装LAMP

    apt-get install lamp-server^
    

    2.安装过程中设置MySql密码

    3.测试 创建index.php

    var/www/html/index.php

    index.php的内容为

    <?php phpinfo(); ?>
    

    重启apache,

    service apache2 restart

    在浏览器中输入

    http://localhost/index.php
    

    或者localhost改为IP地址

    5配置MYSql

    cat /etc/hosts | grep localhost
    

    显示:127.0.0.1  localhost

    cat /etc/mysql/my.cnf | grep bind-address
    

    显示:bind-address = 127.0.0.1

    6.  安装phpMyAdmin

    apt-get install phpmyadmin
    

    7. 配置Apache服务器

    cp /etc/phpmyadmin/apache.conf /etc/apache2/conf-enabled/phpmyadmin.conf
    

    然后重启apache

    访问http://localhost/phpmyadmin页面

    如果出现如下错误:

    #2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)

    解决方法:

    /etc/mysql/my.cnf

    [client]
    port            = 3306
    socket          = /var/run/mysqld/mysqld.sock
    
  • 相关阅读:
    Nmap笔记
    Spring AOP(一)
    Spring IOC(三)
    Spring IOC(二)
    Spring IOC(一)
    bootstrap 使用(三)
    bootstrap 使用(二)
    bootstrap 使用(一)
    js(二)
    QQ邮件
  • 原文地址:https://www.cnblogs.com/linlf03/p/5819075.html
Copyright © 2011-2022 走看看