9.17 ubuntu安装LAMP服务
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了9.17 ubuntu安装LAMP服务,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2424字,纯文字阅读大概需要4分钟。
内容图文
![9.17 ubuntu安装LAMP服务](/upload/InfoBanner/zyjiaocheng/1143/7d498314d00d4e758ea2e3470be7c2f5.jpg)
更新ubuntu源
/etc/apt/sources.list
Cp /etc/apt/sources.list /etc/apt/sources.list.bak备份
修改vim /etc/apt/sources.list
将其中的数据修改为最新的源镜像地址
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
之后执行 apt-get update
Unbuntu安装LAMP服务
Step1:安装apache
Apt install apache2 -y
默认的配置文件: /etc/apache2/site-enabled/000-defult.conf
默认安装源码的位置:/var/www.html
安装完成,从宿主机浏览器进入虚拟机的地址能看到
Step2:安装mysql
apt install mysql-server -y
Mysql -uroot -proot 登录mtsql数据库
Showdatebases 查看所有的数据库
使用navicat连接数据库
修改配置文件 gedit /etc/mysql/mysql.conf.d/mysqld.cnf
Bind-address = 127.0.0.1 注释掉
mysql>grant all on *.* to root@‘%‘ identified by ‘你的密码‘ with grant option;
mysql>flush privileges;
重启数据库
Step3:
安装PHP
apt install php -y
我这里遇到了问题,提示
这里我选择的解决方法是强制解锁,
执行 rm /var/cache/apt/archives/lock
Rm /var/lib/dpkg/lock
之后再次运行apt install php -y
(或者apt install php7.0 php-pear libapache2-mod-php7.0 php7.0-mysql安装php及其扩展
Apt install php7.0-curl php7.0-json php7.0-cgi安装php组件
)
更改php代码
打开开/etc/apache2/mods-enabled/dir.conf
在其中将主目录设置为index.php
重启apache服务器
Systemctl restart apache2
创建info文件
进入/var/www/html,创建info.php,里面输入调用
<?php
phpinfo();
?>
删除index.html
打开网页,输入虚拟机ip,进入php
安装phpmyadmin,基于web形式的管理mysql数据库的平台
Apt install phpmyadmin
安装过程中根据提示进行设置
之后将/usr/share/phpmyadmin放在 /var/www/html下,使用软连接将其放入
ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin
之后打开浏览器输入地址localhost/phpmyadmin/,可以看到 (localhos为虚拟机地址)
Windows Server2008R2的安装
服务一:IIS Internet information service,互联网信息服务
Windows server 2003、xp使用的iis6
Windows server2008、win7使用的iis7.0
Step1:
原文:https://www.cnblogs.com/x98339/p/11532791.html
内容总结
以上是互联网集市为您收集整理的9.17 ubuntu安装LAMP服务全部内容,希望文章能够帮你解决9.17 ubuntu安装LAMP服务所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。