博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ubuntu一键安装LAMP 及一键卸载
阅读量:6904 次
发布时间:2019-06-27

本文共 2249 字,大约阅读时间需要 7 分钟。

hot3.png

用root账号安装

用tasksel可以方便安装dns server, lamp, kubuntu desktop, ubuntu desktop, xubuntu之类的软件包。

这个软件在ubuntu server里是预装的,而在桌面版里是不预装的,想用的话得安装一下: sudo apt-get install tasksel
用这个软件的话就用命令:sudo tasksel

由于tasksel在桌面版中没有预装,所以要先安装

11151219_is9P.jpg

直接安装会出错,解决办法是先更新一下

sudo apt-get update

11151219_sjqC.jpg

安装完tasksel之后就是开始安装LAMP

11151220_bSJC.jpg

一键安装LAMP服务:sudo tasksel install lamp-server

一键卸载LAMP:sudo tasksel remove lamp-server

 

通过上面的命令卸载Lamp时不免把Linux系统本身的东西卸载掉了,因此,

在卸载LAMP后一定记着更新一下系统

sudo apt-get update

sudo apt-get upgrade

上面两条都要执行

安装lamp环境:
输入命令 sudo tasksel install lamp-server , 即可完成LAMP的安装。
通过命令 sudo tasksel 可查看LAMP安装是否成功。需要指出的是,通过tasksel软件包不仅可以安装LAMP组件,还可以安装其他服务器组件,比如DNS服务器,Mail服务器,打印服务器等。
通过命令 sudo apt-get install phpmyadmin 安装MySQL管理工具phpmyadmin。
由于phpmyadmin默认安装在/usr/share/phpmyadmin,而不是/var/www下,所以只需在终端输入 sudo ln -s /usr/share/phpmyadmin/ /var/www/ 即可解决。
然后通过命令 sudo /etc/init.d/apache2 restart 重启Apache服务器。
如果要修改php.ini文件,则通过命令 sudo gedit /etc/php5/apache2/php.ini 编辑即可

ubuntu 卸载lamp  

ubuntu 删除mysql

sudo apt-get autoremove mysql-server

sudo apt-get remove mysql-common
dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P

ubuntu 卸载apache2 php5

1、sudo apt-get remove apache2
2、sudo apt-get remove apache2.2-common
3、sudo apt-get autoremove

主要用这个

aptitude purge apache2 apache2.2-common

find /etc -name "*apache*" -exec rm -rf {} \;

aptitude purge php5 php5-common

 

Apache配置多级域名

1、进入Apache2配置目录 :

         cd  /etc/apache2/

2、进入site-available目录创建新的site文件,建议文件名和二级域名一样:比如education.bigtreechina.com

       cd sites-avaiable

       vi education.bigtreechina.com.conf

       然后输入以下内容,并保存退出

<VirtualHost*:80>

    ServerAdmin education@qq.com

    DocumentRoot /var/www/html/education

    <Directory /var/www/html/education>

       Options ExecCGI FollowSymLinks

       AllowOverride all

       allow from all 

       Order allow,deny 

    </Directory>

    ServerName education.bigtreechina.com

    ErrorLog ${APACHE_LOG_DIR}/education.bigtreechina.com-error.log

    CustomLog ${APACHE_LOG_DIR}/education.bigtreechina.com-access.log combined

</VirtualHost>

4、激活site文件

         a2ensite  education.bigtreechina.com.conf

         激活成功后在/etc/apache2/sites-enabled/目录下就会出现这个文件,如果想disable某个site,可以用a2dissite

5、修改hosts

打开host文件:vi /etc/hosts

添加:127.0.0.1 education.bigtreechina.com

重启网络:sudo /etc/init.d/networking restart

6、重启apache

sudo /etc/init.d/apache2 restart

转载于:https://my.oschina.net/u/3522874/blog/1926097

你可能感兴趣的文章
还没写过爬虫的小白点进来,一文带你入门python爬虫(小白福利)
查看>>
【synchronized底层原理之3】JDK1.6对锁所做的优化
查看>>
重写equals方法时重写hashcode方法的必要性
查看>>
Mybatis 缓存系统源码解析
查看>>
20180825 上课截图
查看>>
深入解析Vue里函数的调用顺序介绍
查看>>
Ember.js 入门指南——model的关联关系处理
查看>>
Ubuntu Linux下使用搜狗浏览器加速代理
查看>>
Docker应用容器引擎介绍与搭建
查看>>
教你制作属于自己的CentOS 6.4一键自动化安装ISO镜像光盘
查看>>
线上 mysql 主库配置文档
查看>>
Java web部署目录结构和web.xml作用
查看>>
负载均衡DR(direct routing)模式
查看>>
Python中list的遍历
查看>>
ListView提供多选框功能
查看>>
Linux下查看内存等硬件信息
查看>>
mysql 登录权限
查看>>
ADO.NET操作数据库(删除)
查看>>
《Servlet学习笔记》Servlet 简介
查看>>
Java之内部类
查看>>