Centos6.8阿里云linux系统下配置LAMP运行环境

1.Apache

#安装apache软件

yum -y install httpd

#启动httpd服务

service httpd start

#设置开机启动chkconfig --list httpd查看

chkconfig httpd on

#进入配置文件修改服务器名

1vi /etc/httpd/conf/httpd.conf 2ServerName localhost:80 3DirectoryIndexindex.html index.php index.htm

#重启httpd服务

service httpd restart

2.centos6.8 yum安装mysql 5.6 (完整)

1一、检查系统是否安装其他版本的MYSQL数据 2 3#yum list installed | grep mysql 4#yum -y remove mysql-libs.x86_64 5 6二、安装及配置 7 8# wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm 9# rpm -ivh mysql-community-release-el6-5.noarch.rpm 10# yum repolist all | grep mysql 11 12安装MYSQL数据库 13 14# yum install mysql-community-server -y 15 16设置为开机启动(234都是on代表开机自动启动) 17 18# chkconfig --list | grep mysqld 19# chkconfig mysqld on 20 21三、设置远程root 22 23# service mysqld start 24 25设置root密码 26 27# mysql_secure_installation 28 29登陆root账号 30 31# mysql -uroot -p 32 33建立远程root用户 34 35mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '你设置的密码' WITH GRANT OPTION; 36mysql> flush privileges; 37 38查看mysql原本编码: 39 40mysql> show variables like 'character%'; 41 42设置编码 43 44# vi /etc/my.cnf 45 46[mysqld] 47character-set-server=utf8 48collation-server=utf8_general_ci 49performance_schema_max_table_instances=400 50table_definition_cache=400 51table_open_cache=256 52# 修改 53sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION 54 55[mysql] 56default-character-set = utf8 57 58[mysql.server] 59default-character-set = utf8 60 61 62[mysqld_safe] 63default-character-set = utf8 64 65 66[client] 67default-character-set = utf8 68 69重启mysql 70 71# service mysqld restart

再次查看编码:

1# mysql -uroot -p 2mysql> show variables like 'character%'; 3+--------------------------+----------------------------+ 4| Variable_name | Value | 5+--------------------------+----------------------------+ 6| character_set_client | utf8 | 7| character_set_connection | utf8 | 8| character_set_database | utf8 | 9| character_set_filesystem | binary | 10| character_set_results | utf8 | 11| character_set_server | utf8 | 12| character_set_system | utf8 | 13| character_sets_dir | /usr/share/mysql/charsets/ | 14+--------------------------+----------------------------+ 15rows in set (0.00 sec)

3.PHP

#安装依赖包

1rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm 2rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

#安装PHP及相关软件

1yum install php70w.x86_64 php70w-opcache.x86_64 php70w-pdo.x86_64 php70w-fpm.x86_64 php70w-mysql.x86_64 2yum install php70w-gd.x86_64 libjpeg* php70w-ldap.x86_64 php70w-odbc.x86_64 php70w-pear.noarch php70w-xml.x86_64 3yum install php70w-xmlrpc.x86_64 php70w-mbstring.x86_64 php70w-bcmath.x86_64 php-mhash php70w-pecl-redis.x86_64

#启动php-fpm服务

service php-fpm start

设置环境自动启动:

chkconfig php-fpm on

打开文件后查找内容

1//查找内容,n为下一个内容 2/你要查找的内容 3n

新建目录

mkdir /你的路径/你的路径

修改文件名称

1//把当前目录下的file1文件名改成file2,如果该目录下有file2,则覆盖以前的file2文件。 2mv file1 file2

删除文件

rm -rf filename

 最后,需要在阿里云服务器实例--安全组--添加端口3306和80端口

点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

皕杰报表之UUID

​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

2020年前端实用代码段,为你的工作保驾护航

有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )

Centos6.8阿里云linux系统下配置LAMP运行环境 - HelloWorld