moonshineidolon

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

centos6.5 下配置 (centos7.0 不行)

网络架设:

  1. vmware->编辑->虚拟网络编辑器:

选 Vmnet0 桥接模式。

桥接到本地链接。

  1. 本机Ipconfig查看本地连接
  2. 设置linux网络

编辑网卡配置文件:vim /etc/sysconfig/network-scripts/ifcfg-eth0

IPADDR=192.168.183.253

NETMASK=255.255.255.0

GATEWA=192.168.183.10

ONBOOT=yes

BOOTPROTO=static

  1. 重新启动网卡

Service network restart

  1. 设置DNS

Vim /etc/resolv.conf

nameserver 192.168.183.225

nameserver 8.8.8.8

  1. 设置http及https代理

export http_proxy=192.168.183.225:8080

export https_proxy=192.168.183.225:8080

安装redis

  1. 安装gcc

yum install gcc 

  1. mkdir /usr/local/redis 
  2. cd /usr/local/src 

$ wget http://download.redis.io/releases/redis-3.0.3.tar.gz

$ tar xzf redis-3.0.3.tar.gz

$ cd redis-3.0.3

$ make MALLOC=libc

$ make install

$cd utils

$./install_server.sh

安装mysql

  1. 安装mysql客户端:

yum install mysql

  1. 安装mysql 服务器端:

yum install mysql-server

  1. 启动mysql

Service mysqld start

安装apache

  1.  系统自带,无需安装
  2. 启动
  3. Service httpd start

安装php

  1. rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
2. yum install php55w php55w-opcache

PHP + anpache配置

Vim /etc/httpd/conf/httpd.conf

  1. LoadModule php5_module modules/libphp5.so
  2. AddType application/x-httpd-php .php .phtml .php3 .inc

安装ftp                                                                                                                           

  1. yum install vsftpd

 

Laravel白屏

  1. vim /etc/php.in

display_errors=On (*O大学)

  1. vim /shop/config/app.php

debug=true

 

Class PDO not found in …

  1. yum install php-pdo

call to undefined function Illuminate\Foundation\Bootstrap\m_binternal_encoding(_) in .,,

  1. yum install php55w-mbstring

PDOException not found

  1. yum install php55w-mysql

can not connect mysql server

  1. setsebool httpd_can_network_connect 1

 

ngrok 搭建

  1. 下载ngrok

http://www.kissthink.com/archive/--4316.html

         (已经上传到我的邮箱:zengdou@163.com)

  1. 解压缩到/usr/local/ngrok
  2. 创建配置文件

vim ngrok.cfg

server_addr: tunnel.mobi:44433

trust_host_root_certs: true

  1. 运行命令

./ngrok –subdomain xdbtest –config=ngrok.cfg127.0.0.2:80

 

Vsftp

  1. 关闭防火墙

a)   查看防火墙状态:/etc/init.d/iptables status

b)   停掉防火墙:/etc/init.d/iptables stop

c)   也可以永久关闭防火墙:chkconfig --level 35 iptables off

  1. 500 OOPS  cannot  chanage directory

a)   查看SELinux设置
# getsebool -a|grep ftp

b)   出现如下项:
ftpd_disable_trans --> off
或者
ftp_home_dir-->off

c)   解决方法:
//使用setsebool命令开启
# setsebool ftpd_disable_trans 1
或者
# setsebool ftp_home_dir 1
//再次查看当前状态是否是on的状态
# getsebool -a|grep ftp
ftpd_disable_trans --> on
或者
ftp_home_dir-->on

d)   //setsebool使用-P参数,永久有效,无需每次开机都输入这个命令
# setsebool -P ftpd_disable_trans 1
或者
# setsebool -P ftp_home_dir 1
# service vsftpd restart

e)   有关selinux的配置

f)   如关闭,仅仅警告,强制等等 需要编辑/etc/sysconfig/selinux 默认是强制

Linux 创建定时任务

  1. crontab -u root –e
  2. * * * * * php /var/www/shop/artisan schedule:run 1>> /dev/null 2>&1

安装Predis

  1. 1.  http://www.redis.io/clients
  2. 2.  http://www.redis.io/clients#php
  3. 3.  https://github.com/nrk/predis
  4. 4.  Download ZIP
  5.  

安装Supervisor

  1. 安装easy_install

yum install python-setuptools

  1. 安装supervisor

easy_install supervisor

  1. 修改配置文件

echo_supervisord_conf > /etc/supervisord.conf

vim /etc/supervisord.conf

文件末尾追加内容,保存退出

[program:laravel-worker]

process_name=%(program_name)s_%(process_num)02d

command=php /var/www /shop /artisan queue:work sqs --sleep=3 --tries=3 --daemon

autostart=true

autorestart=true

user=root

numprocs=8

redirect_stderr=true

stdout_logfile=/var /www/shop /worker.log

 

重要: sqs代表队列名字。一般使用redis

  1. 启动supervisor

supervisord   

  1. 进入客户端启动laravel队列监听器

supervisorctl  

      start laravel-worker:*

 

  

安装gulp(WIN7)

  1. 下载

https://nodejs.org/en/

  1. 运行

node-v4.1.1-x86.msi

  1. 安装gulp

C:\>set http_proxy=http://192.168.183.225:8080

C:\>set https_proxy=http://192.168.183.225:8080

npm install gulp –g

  1. 安装到项目路径:

进入项目文件夹:cd D:\php\takeout

npm install gulp

 

yum安装Apache

1、yum install httpd
2、设置Apache服务的启动级别
   chkconfig --levels 235 httpd on

3、现在就启动它
/etc/init.d/httpd start

搭建SVN服务器

1、安装    

 yum install subversion

2、判断是否安装成功

 svnserve --version

3、建立SVN库。

 mkdir /opt/svn/repos

 svnadmin create /opt/svn/repos

4、配置用户名和密码

 cd /opt/svn/repos/conf

 vi passwd

 添加用户名和密码:

   hello=123 (用户名=密码)

5、设置用户权限

  vi authz

  最后行追加:

  [/]

  hello= rw

  意思是hello用户对所有的目录有读写权限,

6、设定svnserve.conf

  anon-access = none # 使非授权用户无法访问

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

  password-db = password

  authz-db = authz   # 访问控制文件

  realm = /opt/svn/repos # 认证命名空间,subversion会在认证提示里显示,并且作为凭证缓存的关键字。

7、启动svn

 svnserve -d -r /opt/svn/repos

posted on 2016-06-14 10:26  eidole's space  阅读(323)  评论(0编辑  收藏  举报