zoukankan      html  css  js  c++  java
  • LAMP(LNMP) 环境搭建

    一、首先保证网络畅通
    我们可以在通过ping  ip地址来检查是否通,

    若果不通就登录远程服务器查看Linux下的网络配置文件 命令:cat /etc/sysconfig/network-scripts/ifcfg-eth0

    打开后如图所示:(https://www.cnblogs.com/baichuanhuihai/p/8127329.html)

    确保上图信息准确无误,如果还是无法连网,进入修改命令:sudo vim /etc/sysconfig/network-scripts/ifcfg-eth0

    修改BOOTPROTO=static 或者添加mac地址linux/Centos下查看网卡Mac地址,输入命令:

    # cat /sys/class/net/eth0/address

    最后从起网络服务:service network restart或者systemctl restart network.service ,关闭本机防火墙命令:systemctl stop firewalld

    二、安装MySQL

    https://segmentfault.com/a/1190000007667534

    https://www.cnblogs.com/dengshihuang/p/8029092.html

    https://segmentfault.com/a/1190000012703513

    https://dev.mysql.com/doc/refman/5.6/en/linux-installation-yum-repo.html

    1目录说明
    安装文件下载目录:/data/software
    Mysql目录安装位置:/usr/local/mysql

    数据库保存位置:/data/mysql
    日志保存位置:/data/log/mysql

    2下载安装

    由于wget方法下载的包安装失败所以不建议wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.20-linux-glibc2.12-x86_64.tar.gz

    就按照官网给的下载步骤:

    1、新开的云服务器,需要检测系统是否自带安装mysql : yum list installed | grep mysql

    发现提示已经安装了mariadb-server数据库,

    要卸载自带的:yum -y remove mariadb-libs.x86_64

    2 、安装rpm:wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm

    3、接着执行这句,这个rpm还不是mysql的安装文件,只是两个yum源文件,执行后,在/etc/yum.repos.d/ 这个目录下多出mysql-community-source.repomysql-community.repo

    # rpm -ivh mysql-community-release-el6-5.noarch.rpm

    4、 这个时候,可以用yum repolist mysql这个命令查看一下是否已经有mysql可安装文件

    #yum repolist all | grep mysql

    5 、安装MySQL :yum install mysql-community-server

    6 、启动MySQL :service mysqld start

    7 、修改密码:

    # mysql -u root

    # use mysql;

    # update user set password=PASSWORD("这里输入root用户密码") where User='root';

    8、 查看mysql是否自启动,并且设置开启自启动

    # chkconfig --list | grep mysqld

    # chkconfig mysqld on

    三、安装Apachehttpd

    1、 安装前要确保防火墙关闭

    查看防火墙状态:systemctl status firewalld

    关闭防火墙:systemctl stop firewalld 禁用防火墙:systemctl disable firewalld

    2、安装Apache :yum install httpd

    3、 修改IP地址 vim /etc/httpd/conf/httpd.conf

     

    4 、启动/从启 sudo systemctl start httpd / sudo systemctl restart httpd

    5、如果无法启动 检测httpd进程状态ps -e |grep httpd

    至此,在浏览器输入 10.1.81.145 即可打开欢迎页面

    四、安装PHP http://10.1.81.146/info.php

    使用yum安装:

    yum install php70w-common php70w-fpm php70w-opcache php70w-gd php70w-mysqlnd php70w-mbstring php70w-pecl-redis php70w-pecl-memcached php70w-devel

    图像化界面一键部署LAMP(宝塔面板)

    下面是安装教程:

    https://yq.aliyun.com/articles/697349#

    六、主要配置文件

    #虚拟主机配置:
    356 <VirtualHost *:80>
    357  ServerName localhost
    358  DocumentRoot "/var/www/html/duoduo_huinong/public"
    359  DirectoryIndex index.html index.php
    360 
    361  <Directory "/var/www/html/duoduo_huinong/public">
    362   Options -Indexes +FollowSymlinks
    363   AllowOverride All
    364   Require all granted
    365  </Directory>
    366 </VirtualHost>
  • 相关阅读:
    SpringBoot 之基础学习篇.
    Java 反射机制
    第二十二节,TensorFlow中的图片分类模型库slim的使用、数据集处理
    第二十一节,条件变分自编码
    第二十节,变分自编码
    第十九节,去噪自编码和栈式自编码
    使用webdriver+urllib爬取网页数据(模拟登陆,过验证码)
    第十八节,自编码网络介绍及代码实现
    第十七节,受限玻尔兹曼机网络及代码实现
    第二十二节,TensorFlow中RNN实现一些其它知识补充
  • 原文地址:https://www.cnblogs.com/jervy/p/11742099.html
Copyright © 2011-2022 走看看