Ubuntu 16.04搭建LAMP开发环境
来源:互联网 发布:戏曲下载软件 编辑:程序博客网 时间:2024/06/17 16:24
基本设置
1.配置网络环境
管理员给分配了一个静态IP,所以还需要进一步配置网络环境
配置DNS:右上角网络连接->编辑链接->有线连接1->IPv4设置->DNS服务器:202.112.80.106->保存
登陆网关:对于校园网用户来说,登陆网关才能访问外网
测试: ping www.baidu.com
2.设置root密码
sudo passwd
切换到root用户:su 或 su - 或 su root
切换到普通用户:su 用户名 或 logout
3.更新源
sudo apt-get update
源保存的文件为:/etc/apt/sources.list
安装常用软件
1.SSH
sudo apt-get install openssh-server
查看状态:service ssh status/start/stop/restart
或:/etc/init.d/ssh status/start/stop/retsrt
实际上,service命令就是执行/etc/init.d脚本,二者功能是一样的
2.Vim
sudo apt-get install vim
3.Tree
sudo apt-get install tree
4.Git
sudo apt-get install git
搭建LAMP
1.安装Apache
sudo apt-get install apache2
测试: 浏览器访问http://Ubuntu的IP(即http://localhost
),出现It Works!网页。
查看状态: service apache2 status/start/stop/restart
Web目录:/var/www
安装目录: /etc/apache2/
全局配置: /etc/apache2/apache2.conf
监听端口: /etc/apache2/ports.conf
虚拟主机: /etc/apache2/sites-enabled/000-default.conf
2.安装MySQL
sudo apt-get install mysql-server mysql-client
测试:mysql -u root -p
查看状态:service mysql status/start/stop/retart
查看监听端口的情况:netstat -tunpl
或 netstat -tap
3.安装PHP
sudo apt-get install php7.0
测试:php7.0 -v
4.安装其他模块
sudo apt-get install libapache2-mod-php7.0sudo apt-get install php7.0-mysql
重启服务 service apache2 restart
service mysql restart
测试Apache能否解析PHP vim /var/www/html/phpinfo.php
文件中写:<?php echo phpinfo();?>
浏览器访问:http://ubuntu地址/phpinfo.php(即http://localhost/phpinfo.php
),出现PHP Version网页
5.修改权限
sudo chmod 777 /var/www
6.安装phpMyAdmin
sudo apt-get install phpmyadmin
安装:选择apache2,点击确定。下一步选择是要配置数据库,并输入密码。
创建phpMyAdmin快捷方式:sudo ln -s /usr/share/phpmyadmin /var/www/html
启用Apache mod_rewrite模块:sudo a2enmod rewrite
重启服务: service php7.0-fpm restart
service apache2 restart
测试:浏览器访问:http://ubuntu地址/phpmyadmin(即http://localhost/phpmyadmin
)
7.配置Apache
vim /etc/apache2/apache2.conf
添加: AddType application/x-httpd-php .php .htm .html
AddDefaultCharset UTF-8
重启Apache服务
- Ubuntu 16.04 搭建LAMP开发环境
- Ubuntu 16.04搭建LAMP开发环境
- Ubuntu 16.04搭建LAMP开发环境
- Ubuntu 16.04搭建LAMP开发环境
- ubuntu 16.04 搭建LAMP开发环境
- Ubuntu 16.04搭建LAMP开发环境
- Ubuntu 16.04搭建LAMP开发环境
- Ubuntu 16.04搭建LAMP开发环境
- Ubuntu 16.04搭建LAMP开发环境
- Ubuntu 16.04搭建LAMP开发环境
- Ubuntu 16.04搭建LAMP开发环境
- Ubuntu 16.04/17.04搭建LAMP开发环境
- Ubuntu 16.04搭建lamp环境
- Ubuntu下PHP开发环境LAMP搭建
- Ubuntu下PHP开发环境LAMP搭建
- Ubuntu下PHP开发环境LAMP搭建
- Ubuntu下PHP开发环境LAMP搭建
- Ubuntu LAMP环境搭建
- Ubuntu下mysql服务的重启命令
- Rescue The Princess(山东省第四届ACM大学生程序设计竞赛 )
- 简单的纳新系统后台php+mysql+oauth2.0认证实现
- 文件路径 正斜杠和反斜杠
- 二分图——vijos1204 CoVH之柯南开锁
- Ubuntu 16.04搭建LAMP开发环境
- 【R语言学习笔记】一、 数据的读取与保存
- 第十四周
- SpringMVC 生命周期
- 数据库索引
- 栈的模拟实现
- Shell脚本基础15-while循环
- 纳税服务系统【用户模块之简单增删改查】
- java中把对象、对象bean、list集合、对象数组、Map和Set以及字符串转换成Json