一键安装部署代码的神器之常见问题及解决办法-----walle(瓦力)

常见问题以及解决办法

1.composer安装速度慢

好吧,我已经猜到会有人问有没有现成的,有!

下载百度网盘,解压vendor放到walle-web根目录即可。

2.第一次使用composer可能会出现的问题:1 没有添加git的token

Could not fetch https://api.github.com/repos/jquery/jquery, please create a GitHub OAuth token to go over the API rate limit Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+localhost+2015-10-08+1123 to retrieve a token. It will be stored in "/root/.composer/auth.json" for future use by Composer. Token (hidden):

解决办法:

3.第一次使用composer可能会出现的问题:2 composer install 可能会出现的错误

Loading composer repositories with package information Installing dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages.

Problem 1

  • yiisoft/yii2 2.0.x-dev requires bower-asset/jquery 2.1.@stable | 1.11.@stable -> no matching package found. ....

解决办法composer global require "fxp/composer-asset-plugin:*"

4.如何添加用户key到git的ssh-keys列表

su - www                 # 假如www为你的php进程用户
ssh-keygen -t rsa        # 如果你都没有生成过rsa_key的话
cat ~/.ssh/id_rsa.pub    # 复制
打开github/gitlab添加到你的ssh-keys或者deploy-keys里

5.如何添加用户ssh-key到目标机群部署用户ssh-key信任

宿主机操作

ps aux|grep php          # 假如www_php为你的php进程用户
su - www_php             # 切换用户
ssh-keygen -t rsa        # 如果你都没有生成过rsa_key的话,如果有则跳过
ssh-copy-id -i ~/.ssh/id_rsa.pub www_remote@remote_host  # 加入目标机群信任,需要输入www_remote密码

6.数据导入失败

缺少pdo扩展,解决办法:添加pdo扩展

ubuntu
apt-get install php5 php5-fpm php5-mysql

或者在源码包里编译
cd php-src/ext/pdo_mysql
phpize
./configure --with-php-config=/php/install/dir/bin/php-config
make && make install
vi php.ini # 添加pdo_mysql.so
restart php-fpm

7.nginx简单配置

server {
    listen       80;
    server_name  walle.compony.com; # 改你的host
    root /the/dir/of/walle-web/web; # 根目录为web
    index index.php;

    # 建议放内网
    allow 192.168.0.0/24;
    deny all;

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

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
}

8.apache简单配置

LoadModule rewrite_module modules/mod_rewrite.so
LoadModule php5_module        /usr/lib64/httpd/modules/libphp5.so
<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>
<VirtualHost *:80>
ServerName walle.*.com
DocumentRoot /code/walle-web/web
ErrorLog logs/dev.-error.log
CustomLog logs/dev.-accesslog common
    <Directory "/code/walle-web/web">
      Options  FollowSymLinks
        AllowOverride ALL
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

9.切换用户(www)时:this account is currently not available

cat /etc/passwd | grep www # 查看是否为 /sbin/nolgin

解决办法:

vipw /etc/passwd
修改/sbin/nolgin为/bin/bash
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值