linux运维
zrk-kyle
这个作者很懒,什么都没留下…
展开
-
Ubuntu修改locale问题解决
本文针对的问题是“Ubuntu 安装中文语言包”“Ubuntu Server中文问题”,“Ubuntu更改语言环境”,“Ubuntu locale的设定”,“cannot change locale (zh_CN.UTF-8)”,“Linux中文乱码”,“Linux字符集的修改”,“Linux乱码的解决办法”等问题,提供一站式解决。如果系统显示中文异常,例如出现显示中文乱码等,可以参考本文章。关于转载 2016-12-22 09:31:50 · 5452 阅读 · 1 评论 -
创建数据库,并给指定账号授权
create database new_db;grant all privileges on new_db.* to new_user@"%" Identified by "abc"; flush privileges;转载 2016-12-19 14:16:59 · 369 阅读 · 0 评论 -
利用svn的commit hooks,实现服务器项目自动更新
1、进入svn项目仓库的hooks文件夹cd /仓库目录/项目名/hooks/ 2、找到post-commit.tmpl,复制一份名为post-commitcp post-commit.tmpl post-commit3、写入vim post-commitexport LANG=zh_CN.GBKSVN=/usr/bin/svnW转载 2016-12-19 14:24:40 · 409 阅读 · 0 评论 -
设置环境变量/etc/profile,针对所有用户
vim /etc/profile底部添加:PATH=$PATH:路径生效:source /etc/profile转载 2016-12-19 15:18:25 · 4369 阅读 · 0 评论 -
centos 修改主机名及显示全路径
1、修改显示全路径:vim /etc/bashrc找到[ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ " 把里面的大写W改为小写w2、修改主机名 hostnamectl set-hostname 新主机名转载 2016-12-28 10:39:07 · 2230 阅读 · 0 评论 -
centos 清理缓存
To free pagecache://释放页缓存echo 1 > /proc/sys/vm/drop_cachesTo free reclaimable slab objects (includes dentries and inodes)://释放inode和目录树缓存echo 2 > /proc/sys/vm/drop_cachesTo free slab objects a转载 2016-12-29 15:52:27 · 16159 阅读 · 0 评论 -
Linux安装openoffice和swftools
一、安装openoffice1、下载ubuntu:Apache_OpenOffice_4.1.3_Linux_x86-64_install-deb_zh-CN.tar.gzcentos:Apache_OpenOffice_4.1.3_Linux_x86-64_install-rpm_zh-CN.tar.gz2、解压:ubuntu:tar zxvf Apache_OpenOffi转载 2016-12-20 16:24:19 · 851 阅读 · 0 评论 -
nginx 下载安装
针对centos 7.2 64位1、建立用户组groupadd -r nginx //-r表示创建系统工作组,且工作组的ID小于500useradd -r -g nginx -M nginx //-r表示创建系统用户 -g表示属于nginx组 -M表示不自动生成登录目录2、下载nginx安装包wget -c http://nginx.org/download/转载 2017-03-02 20:38:17 · 385 阅读 · 0 评论 -
shell脚本语法
举栗子说明:编写nginx启动脚本:#!/bin/bash #表示当前脚本由/bin/bash这个程序来执行# chkconfig: 35 80 30 #系统服务的运行级# description: Nginx ServerNGINXD='/usr/local/nginx/sbin/nginx' #nginx运行文件LOCKFILE='/var/lock/nginx.转载 2017-03-03 15:56:37 · 266 阅读 · 0 评论 -
通过进程名批量kill指定进程
ps -ef | grep "进程名" | grep -v grep | cut -c 9-15 | xargs kill -9分析:ps -ef 用标准的格式显示进程 ps aux 是用BSD的格式来显示grep "进程名" 搜索进程名grep -v grep 反向选择,即搜索没有‘grep’的那一行数据cut -c 9-15 字符分割,转载 2017-03-03 16:19:51 · 2227 阅读 · 0 评论 -
linux服务器-LAMP安装配置2-安装mysql
十、安装mysql(mysql-5.7.13)1、到mysql官网获取下载地址:选择linux通用版:复制下载链接:2、下载:cd /home/srcwget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.13-linux-glibc2.5-转载 2016-12-19 10:20:24 · 489 阅读 · 0 评论 -
linux命令
ln -s mysql-5.7.17-linux-glibc2.5-x86_64/ mysql-s 是代号(symbolic)的意思。 这 里有两点要注意:第一,ln命令会保持每一处链接文件的同步性,也就是说,不论你改动了哪一处,其它的文件都会发生相同的变化;第二,ln的链接又软链接 和硬链接两种,软链接就是ln -s ** **,它只会在你选定的位置上生成一个文件的镜像,不会占用磁盘空间转载 2017-03-03 17:17:04 · 205 阅读 · 0 评论 -
php7 安装扩展 phpize 没有生成configure文件
在执行phpize之后没有生成configure文件说明没有安装autoconfyum -y install autoconf转载 2017-03-07 17:31:54 · 7982 阅读 · 2 评论 -
linux 设置mail
sudo vim /etc/mail.rcset from=用来发件的邮箱(要到邮箱中设置允许第三方发送) smtp=邮箱服务地址(如smtp.163.com)set smtp-auth-user=邮箱用户名 smtp-auth-password=邮箱密码 smtp-auth=认证方式(一般填login)测试发送:echo “邮件内容” | mail -s "邮件标题" 要发...原创 2017-09-06 19:42:08 · 1211 阅读 · 0 评论 -
SVN Checkout 不包括源文件夹根目录
SVN Checkout 不包括源文件夹根目录,比如我要checkout trunk/ 下面的所有文件,但是不包括trunk 文件夹我们可以在svn文件夹后面打个空格,在加个“.”就行了eg: “svn co http://192.168.1.10/svn/project/trunk/“ 改为 ”svn co http://192.168.1.10/svn/project/tr转载 2016-12-19 11:42:04 · 3746 阅读 · 0 评论 -
linux subversion安装配置
安装sqlite(sqlite-autoconf-3130000.tar.gz)tar zxvf sqlite-autoconf-3130000.tar.gzcd sqlite-autoconf-3130000./configure --prefix=/usr/local/sqlitemake && make install安装svn(subversio转载 2016-12-19 10:24:30 · 349 阅读 · 0 评论 -
linux服务器-设置防火墙
不同的linux系统可能都有自己的防火墙,具体的设置可以google对应系统版本下的防火墙设置基本的设置包括:区域、服务、端口/协议高级的用法包括:ICMP阻塞,伪装,端口转发,丢弃,阻塞以CentOS7.2为例:firewall-cmd --state 查看防火墙状态firewall-cmd --reload 不用重启防转载 2016-12-19 10:16:00 · 480 阅读 · 0 评论 -
linux服务器-LAMP安装配置1-依赖包、apache安装
一、安装libxml2库文件libxml2提供的库是用来管理xml文件的下载地址:http://xmlsoft.org/downloads.html安装步骤(libxml2-2.9.4.tar.gz):tar zxvf libxml2-2.9.4.tar.gzcd libxml2-2.9.4./configure --prefix=/usr/lo转载 2016-12-19 10:18:04 · 1959 阅读 · 0 评论 -
linux服务器-LAMP安装配置3-安装php
安装php(php-5.6.24.tar.gz):tar zxvf php-5.6.24.tar.gzcd php-5.6.24该版本的php要先下载libXpm-devel:yum -y install libXpm-devel./configure --prefix=/usr/local/php \--with-config-file-path=/u转载 2016-12-19 10:21:42 · 340 阅读 · 0 评论 -
mysql配置文件详解
[client]port = 3306 # 设置mysql客户端连接服务端时默认使用的端口socket = /tmp/mysql.sockdefault-character-set=utf8 # 设置mysql客户端默认字符集[mysql]no-auto-rehash[mysqld]port=3306 # mysql服务端默认监听(l转载 2016-12-19 10:22:38 · 3771 阅读 · 0 评论 -
设置开机启动、chkconfig命令详解
chkconfig用于设定系统的各种服务语法:chkconfig [--add][--del][--list][系统服务]或chkconfig [--level][系统服务][on/off/reset]参数用法: --add 增加所指定的系统服务,让chkconfig指令得以管理它,并同时在系统启动的叙述文件内增加相关数据。 --del 删除所指定的系转载 2016-12-19 10:23:39 · 15643 阅读 · 0 评论 -
yii架设到服务器
1、在服务器直接生成yii项目,导入到svn中:下载yii框架(yii-1.1.17.467ff50.tar.gz):tar zxvf yii-1.1.17.467ff50.tar.gzcd yii-1.1.17.467ff50把framework移动到apache的htdocs目录下:cp -r framework /usr/local/apache/转载 2016-12-19 10:26:06 · 1348 阅读 · 0 评论 -
linux 配置memcached以及php的memcache扩展
1、安装libevent(libevent-2.0.22-stable.tar.gz)memcached依赖libevent包libevent 是一个用C语言编写的、轻量级的开源高性能网络库tar zxvf libevent-2.0.22-stable.tar.gzcd libevent-2.0.22./configure --prefix=/usr转载 2016-12-19 10:27:28 · 259 阅读 · 0 评论 -
Yii的url重写
1、在/usr/local/apache/modules/ 有mod_rewrite.sovim /etc/httpd/httpd.conf#LoadModule rewrite_module modules/mod_rewrite.so去掉#AllowOverride None 改成 AllowOverride All2、然后修改protected/conf转载 2016-12-19 10:28:21 · 385 阅读 · 0 评论 -
ubuntu php安装 make Generating phar.php 卡住
具体原因未知解决方法:./configure 配置信息 --without-pear --disable-pharmake && make install成功编译安装完成后,再安装pear:wget http://pear.php.net/go-pear.phar /usr/local/bin/php go-pear.phar转载 2016-12-19 10:29:35 · 984 阅读 · 0 评论 -
php 执行linux shell命令
putenv('LANG=C.UTF-8'); //环境声明shell_exec('shell命令');例子:在php中获取svn项目仓库的revision$svn_info = shell_exec('svn info 项目路径');$svn_info = nl2br($svn_info);//在字符串中的新行(\n)之转载 2016-12-19 10:31:51 · 2064 阅读 · 0 评论 -
Internal Server Error<br>The server encountered an internal e
这里的问题只针对php apache的重写功能出现的问题其实只用查看apache的error.log的记录就知道是什么原因了。这里的原因是:.htaccess的内容应该是:Options +FollowSymLinks //这句必须要,不然就会报这个错# IndexIgnore */*RewriteEngine on# if a dire转载 2016-12-19 10:34:29 · 650 阅读 · 0 评论 -
svn hooks利用钩子脚本
在建立的svn仓库的项目里,有hooks文件夹,其中有这样一个文件(这里已post-commit为例):post-commit.tmpl这是一个模板文件,字面意思就是在svn提交的的时候执行相关的脚本操作。cp post-commit.tmpl post-commit //复制模板文件不要忘记给post-commit这个文件执行权限:chmod a+x post-co转载 2016-12-19 10:35:23 · 2782 阅读 · 1 评论 -
MySQL用户权限管理详解
一、用户授权mysql> grant all privileges on *.* to 'yangxin'@'%' identified by 'yangxin123456' with grant option; •all privileges:表示将所有权限授予给用户。也可指定具体的权限,如:SELECT、CREATE、DROP等。 •on:表示这些权限对哪些数据库和表生转载 2016-12-19 10:39:11 · 322 阅读 · 0 评论 -
拷贝php.ini到/usr/local/php/lib?
为什么要拷贝到那个目录,那时因为 PHP 编译时指定了配置文件目录,而指定的目录是 /usr/local/php/lib 因此 PHP 启动时会去那个目录下读取 php.ini 的配置文件,不拷贝不影响 PHP 正常运行,只不过无法添加配置项罢了。要查看当前 PHP 会去哪个目录下找配置文件,可以在 phpinfo() 中看到,(命令行下运行 php -i 也可以),看到 'Configurati转载 2018-03-26 22:47:23 · 1854 阅读 · 1 评论