Ubuntu搭建LAMP和LNMP环境
操作环境:Ubuntu 18.04.1 搭建LAMP环境: 图形界面配置更新Ubuntu源: 在VMware打开Ubuntu,依次打开系统设置,软件和更新。在下载自中选择其他站点,然后在中国的条目下选择mirrors.ustc.edu.cn。 更新资源包和软件: sudo apt update&& sudo apt upgrade sudo apt dist-upgrade&&sudo apt autoclean 清除不需要的软件和文件: sudo apt autoclean&&sudo apt autoremove 安装apache: sudo apt install apache2 默认的配置文件:/etc/apache2/sites-enabled/000-default.conf 默认安装源码的位置(网站根目录):/var/www/html 检查apache是否开启: sudo service apache2 status 显示active(running)则表示已开启。 相关命令: 开启apache:service apache2 start 关闭apache:service apache2 stop 重启apache:service apache2 restart 检查apache默认使用的80端口是否开启: netstat -ntulp | grep 80