zoukankan      html  css  js  c++  java
  • wordpress安装 相关

    64 位ubuntu 安装 32位兼容包

    apt-get install ia32-libs
    刚看了一下,wordpress才11个表太神奇了,这么复杂的系统,amazing
     

    参考以下文章

    http://9hills.us/2011/01/wordpress/

    http://dueam.org/2010/09/ubuntu-server-%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AElnmp%E5%B9%B6%E5%AE%89%E8%A3%85wordpress/(主要)

    安装的过程还算顺利,只是在几个server间切换,搞混了
    
    
    php-fpm在10.04上没有进官方源,我们添加ppa源。
    
    1
    2
    3
    sudo apt-get install python-software-properties
    sudo add-apt-repository ppa:brianmercer/php
    sudo apt-get update

    sudo apt-get install php5-fpm php5-mysql

    
    
    service php5-fpm start
    在nginx.conf中加入下面一段代码
    server {
            listen   80 ;
            server_name  blog.geilibuy.com;
    
            #access_log  /var/log/nginx/localhost.access.log;
    
            index index.php index.htm index.html;
            root /var/www/wordpress;
            expires 7d;
            location ~ \.php$ {
                    fastcgi_pass 127.0.0.1:9000;
                    fastcgi_index index.php;
                    fastcgi_param APPLICATION_ENV production;
                    include fastcgi.conf;
                    expires off;
            }
    }
    在/usr/local/nginx/conf/fastcgi.conf中(其实这里原来的就可以,是一样的,只是代码的顺序不一样而已)
    将内容替换为
    fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
    fastcgi_param  SERVER_SOFTWARE    nginx;
    
    fastcgi_param  QUERY_STRING       $query_string;
    fastcgi_param  REQUEST_METHOD     $request_method;
    fastcgi_param  CONTENT_TYPE       $content_type;
    fastcgi_param  CONTENT_LENGTH     $content_length;
    
    fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
    fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
    fastcgi_param  REQUEST_URI        $request_uri;
    fastcgi_param  DOCUMENT_URI       $document_uri;
    fastcgi_param  DOCUMENT_ROOT      $document_root;
    fastcgi_param  SERVER_PROTOCOL    $server_protocol;
    
    fastcgi_param  REMOTE_ADDR        $remote_addr;
    fastcgi_param  REMOTE_PORT        $remote_port;
    fastcgi_param  SERVER_ADDR        $server_addr;
    fastcgi_param  SERVER_PORT        $server_port;
    fastcgi_param  SERVER_NAME        $server_name;
    
    # PHP only, required if PHP was built with enable-force-cgi-redirect
    fastcgi_param  REDIRECT_STATUS    200;
    
    
    完成之后通过:
    root@lnmp:/home/windonly# nginx -t
    the configuration file /etc/nginx/nginx.conf syntax is ok
    configuration file /etc/nginx/nginx.conf test is successful
     
    来测试配置文件是否正确。
    最后通过 service nginx reload 重启nginx
    wget http://cn.wordpress.org/wordpress-3.0.5-zh_CN.tar.gz
    tar -zxvf ./wordpress-3.0.5-zh_CN.tar.gz
    
    
    sudo mv wordpress /var/www/
    sudo chown -R www-data:www-data  /var/www/wordpress
     
    
    
     
    通过:
    vi /var/www/index.php
    <? php
    phpinfo();
    ?>
    然后访问这个页面来测试是否配置成功了。
    mysql -uroot -p
    show databases;
    create database b2c2_blog;
    use mysql;
    
    
     create user 'user'@'localhost' identified by 'password';
    
    
    grant all on b2c2_blog.* to 'user'@'localhost';
    FLUSH PRIVILEGES;
    
    
    http://blog.geilibuy.com/
    根据向导会生成wp-config.php文件
    
    
    主题推荐
    http://www.wpmes.cn/archive/red-wordpress-theme-hibeetle.html
    http://www.os80.info/archives/72.html(不错)
    改wordpress的footer.php来去掉一些信息


    使用capistrano来部署wordpress
    http://devblog.imedo.de/2008/06/23/wordpress-deployment-with-capistrano-2-and-git/
    http://whomwah.com/2006/05/21/deploying-wordpress-using-capistrano/
    http://whomwah.com/2009/02/01/deploying-wordpress-to-slicehost-using-capistrano-and-git/(主要是这篇)
    mkdir wordpress

    cd wordpress
    capify .
    cap deploy:setup#进行初始化
    部署代码的机子要向github所在的server提交公钥,参考http://help.github.com/linux-key-setup/
    在我的测试中并不是把公钥提交就可以了,还要再连接一遍先

    esting things out

    Testing if our new key works is simple, we just ssh to github. If this is the first time you’re connecting you’ll have to save the server’s key. You can confirm the fingerprint on the SSH keys tab of the account settings page

    $ ssh git@github.com
    The authenticity of host 'github.com (207.97.227.239)' can't be established.
    RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts.
    ERROR: Hi tekkub! You've successfully authenticated, but GitHub does not provide shell access
    Connection to github.com closed.
    
    这样记住了之后再执行cap deploy才能真正访问
    如果没有设置会导致如下的错误
      * executing "if [ -d /home/mlzboy/wordpress/shared/cached-copy ]; then cd /home/mlzboy/wordpress/shared/cached-copy && git fetch -q origin && git reset -q --hard ee90302da9134c62c5c0c841a69759f4b8c8129b && git clean -q -d -x -f; else git clone -q --depth 1 git@github.com:mlzboy/geilibuy-blog.git /home/mlzboy/wordpress/shared/cached-copy && cd /home/mlzboy/wordpress/shared/cached-copy && git checkout -q -b deploy ee90302da9134c62c5c0c841a69759f4b8c8129b; fi"
        servers: ["boy38girl.com"]
        [boy38girl.com] executing command
     ** [boy38girl.com :: err] Host key verification failed.
     ** [boy38girl.com :: err] fatal: The remote end hung up unexpectedly
        command finished
    *** [deploy:update_code] rolling back
      * executing "rm -rf /home/mlzboy/wordpress/releases/20110213131718; true"
        servers: ["boy38girl.com"]
        [boy38girl.com] executing command
        command finished
    failed: "sh -c 'if [ -d /home/mlzboy/wordpress/shared/cached-copy ]; then cd /home/mlzboy/wordpress/shared/cached-copy && git fetch -q origin && git reset -q --hard ee90302da9134c62c5c0c841a69759f4b8c8129b && git clean -q -d -x -f; else git clone -q --depth 1 git@github.com:mlzboy/geilibuy-blog.git /home/mlzboy/wordpress/shared/cached-copy && cd /home/mlzboy/wordpress/shared/cached-copy && git checkout -q -b deploy ee90302da9134c62c5c0c841a69759f4b8c8129b; fi'" on boy38girl.com
    



    cap deploy
    将nginx中的路径定位到/home/mlzboy/wordpress/current/public

    使用ssh-keygen生成密钥对,是随机生成的,所以如果生成一次丢了其中的一个就很麻烦了
    这是一个很奇怪的问题,侥幸解决了
    ssh git@github.com
        [boy38girl.com] executing command
     ** [boy38girl.com :: err] Permission denied (publickey).
     ** [boy38girl.com :: err] fatal: The remote end hung up unexpectedly
    
    原因是在~/.ssh下同时有公钥和密钥,把公钥移走就好了
    cd ~/.ssh
    mv id_rsa.pub id_rsa.pub.bak
    mlzboy@15-1688:~/.ssh$ ssh git@github.com
    PTY allocation request failed on channel 0
    Hi mlzboy! You've successfully authenticated, but GitHub does not provide shell access.
    

    Fixed Permission denied (publickey,gssapi-with-mic)

    If you have some problems likes Permission denied (publickey,gssapi-with-mic), or the error 'Not a RSA1 key file' when using ssh remote login, try to fix issues as below:

    1. get more information with ssh -vvv username@yourhost.com, it's more important.
    2. check the permissions of your private and public keys, id_rsa should 600, id_rsa.pub should 644
    3. check if your id_rsa matched with id_rsa.pub.

    For the 3rd, it looks very strange, I am not sure it's a bug of openssh or something. The id_rsa.pub is the public key for my windows host (I have ssh server on windows), the id_rsa is the private key for remote linux host, I put them to the .ssh folder.

    But when I ssh login the linux host, I got "Permission denied (publickey,gssapi-with-mic)". if I remove id_rsa.pub from .ssh folder, it work fine.






    其它相关问题
    SSH关于公钥认证Permission denied (publickey,gssapi-with-mic的问题
    2010-07-09 14:39:58

    SSH关于公钥认证Permission denied (publickey,gssapi-with-mic的问题
    首先确认配置文件内PasswordAuthentication no这句要为no。

           在客户端中生成key时
    Enter file in which to save the key 要注意不要自己改名,直接按确认就可以。其他步骤照常!
    最后的id_rsa.pub大家就可以改名啦!
    关于这个生成key时不能改名的问题还待研究下。 

     

     

     

     

     

     

    之前在这一块在linode上出现一些问题,主要是在第一次添加用户的时候,应该是密码这一块搞错了,之后没有drop user去尝试,这回主要是用了drop user成功了

     

    mysql> drop user 'geilibuy'@'localhost';

    Query OK, 0 rows affected (0.00 sec)


    mysql> create user 'geilibuy'@'localhost' identified by 'geilibuyxxx;//最后这个是密码

    Query OK, 0 rows affected (0.00 sec)

    grant all on b2c2_blog.* to 'geilibuy'@'localhost';
     

  • 相关阅读:
    前沿技术解密——VirtualDOM
    Ques核心思想——CSS Namespace
    Unix Pipes to Javascript Pipes
    Road to the future——伪MVVM库Q.js
    聊聊CSS postproccessors
    【译】十款性能最佳的压缩算法
    Kafka Streams开发入门(9)
    Kafka Streams开发入门(8)
    【译】Kafka Producer Sticky Partitioner
    【译】99th Percentile Latency at Scale with Apache Kafka
  • 原文地址:https://www.cnblogs.com/lexus/p/1951283.html
Copyright © 2011-2022 走看看