搭站

系统 centos7
环境 安装lamp 地址 https://lamp.sh/
apache 配置

数据库配置
默认mysql 是不可远程访问的,使用命令放开权限
mysql -h localhost -u root

任何主机可连接
1. GRANT ALL PRIVILEGES ON *.* TO ‘root’@’%’ IDENTIFIED BY ‘123456’ ;

2.flush privileges;

参考地址 https://www.cnblogs.com/cnblogsfans/archive/2009/09/21/1570942.html

如出现 Access denied for user ‘root’@’localhost’ (using password:YES) 错误,则修改密码不正确
执行“use mysql;”,使用mysql数据库。
执行“update user set password=PASSWORD(“123456”) where user=’root’;”(修改root的密码)

常用命令

下载
wget url

打包
范例一:将整个 /etc 目录下的文件全部打包成为 /tmp/etc.tar
[root@linux ~]# tar -cvf /tmp/etc.tar /etc <==仅打包,不压缩!
[root@linux ~]# tar -zcvf /tmp/etc.tar.gz /etc <==打包后,以 gzip 压缩
[root@linux ~]# tar -jcvf /tmp/etc.tar.bz2 /etc <==打包后,以 bzip2 压缩
# 特别注意,在参数 f 之后的文件档名是自己取的,我们习惯上都用 .tar 来作为辨识。
# 如果加 z 参数,则以 .tar.gz 或 .tgz 来代表 gzip 压缩过的 tar file ~
# 如果加 j 参数,则以 .tar.bz2 来作为附档名啊~
# 上述指令在执行的时候,会显示一个警告讯息:
# 『tar: Removing leading `/” from member names』那是关於绝对路径的特殊设定。

引用地址: https://www.cnblogs.com/lovevivi/archive/2013/09/04/3300950.html

解压
tar –xvf file.tar //解压 tar包
tar -xzvf file.tar.gz //解压tar.gz
tar -xjvf file.tar.bz2 //解压 tar.bz2
tar –xZvf file.tar.Z //解压tar.Z
unrar e file.rar //解压rar
unzip file.zip //解压zip

1、*.tar 用 tar –xvf 解压
2、*.gz 用 gzip -d或者gunzip 解压
3、*.tar.gz和*.tgz 用 tar –xzf 解压
4、*.bz2 用 bzip2 -d或者用bunzip2 解压
5、*.tar.bz2用tar –xjf 解压
6、*.Z 用 uncompress 解压
7、*.tar.Z 用tar –xZf 解压
8、*.rar 用 unrar e解压
9、*.zip 用 unzip 解压

引用地址:http://blog.csdn.net/mmllkkjj/article/details/6768294/

svn安装

主要步骤:
subversion 安装
建立仓库目录
svnadmin create 命令创建svn仓库
进入仓库目录 修改 conf 目录下svnserve.conf、authz、passwd 文件
svnserve.conf
[general]

anon-access = none #取消匿名访问

auth-access = write #授权用户有可写权限

password-db = passwd #指定用户配置文件,后面会用到

authz-db = authz #指定权限配置文件,后面会用到

编辑passwd文件,建立svn客户端用户以及密码,一行一个
用户名 = 密码
编辑authz文件,指定SVN仓库目录, [/]代表根目录,以及每个用户的权限,这里均为可读可写
[/]
用户名 = rw
启动服务
svnserve -d -r 目录路径
远程检出现19:option expected 错误 ,是因为conf 目录下配置文件行前有空格 ,去掉空格重启服务
ps -x
kill pid

引用地址:http://www.linuxidc.com/Linux/2016-04/130346.htm

 

/******************************************/
nginx 服务器配置 wordpress 固定链接的方法,在server 中加入重定向

if (!-e $request_filename) {
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
rewrite ^(/[^/]+)?(/wp-.*) $2 last;
rewrite ^(/[^/]+)?(/.*\.php) $2 last;
}

location / {
try_files $uri $uri/ /index.php?$args ;
}