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设置为开机启动(2、3、4都是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端口