easyswoole安裝

1.安裝centos6.5
2.安裝lnmp1.5
3. 安裝gcc4.8

wget http://people.centos.org/tru/devtools-2/devtools-2.repo
mv devtools-2.repo /etc/yum.repos.d
yum install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c++javascript

三個安裝包(gcc/g++/c++)會被安裝到,/opt/rh/devtoolset-2/root/目錄中。而後咱們建立一個軟鏈接就能夠使用了。php

ln -s /opt/rh/devtoolset-2/root/usr/bin/gcc /usr/bin/gcc
ln -s /opt/rh/devtoolset-2/root/usr/bin/c++ /usr/bin/c++
ln -s /opt/rh/devtoolset-2/root/usr/bin/g++ /usr/bin/g++
gcc --version
4.安裝swoole
pecl install swoole
5.安裝easyswoolecss

php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
composer config -g repo.packagist composerhttps://packagist.phpcomposer.com
 
composer require easyswoole/easyswoole=3.x-dev
php vendor/bin/easyswoole.php install
php easyswoole starthtml

提示個人PHP 7版本過高,不符合composer.json須要的版本,可是在PHP 7下應該也是能夠運行的,composer能夠設置忽略版本匹配,命令是:
composer install --ignore-platform-reqs
or
composer update --ignore-platform-reqs
6.反向代理
nginx.confjava

user  www www;

worker_processes auto;
worker_cpu_affinity auto;

error_log  /home/wwwlogs/nginx_error.log  crit;

pid        /usr/local/nginx/logs/nginx.pid;

#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;

events
    {
        use epoll;
        worker_connections 51200;
        multi_accept off;
        accept_mutex off;
    }

http
    {
        include       mime.types;
        default_type  application/octet-stream;

        server_names_hash_bucket_size 128;
        client_header_buffer_size 32k;
        large_client_header_buffers 4 32k;
        client_max_body_size 50m;

        sendfile on;
        sendfile_max_chunk 512k;
        tcp_nopush on;

        keepalive_timeout 60;

        tcp_nodelay on;

        fastcgi_connect_timeout 300;
        fastcgi_send_timeout 300;
        fastcgi_read_timeout 300;
        fastcgi_buffer_size 64k;
        fastcgi_buffers 4 64k;
        fastcgi_busy_buffers_size 128k;
        fastcgi_temp_file_write_size 256k;

        gzip on;
        gzip_min_length  1k;
        gzip_buffers     4 16k;
        gzip_http_version 1.1;
        gzip_comp_level 2;
        gzip_types     text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss;
        gzip_vary on;
        gzip_proxied   expired no-cache no-store private auth;
        gzip_disable   "MSIE [1-6]\.";

        #limit_conn_zone $binary_remote_addr zone=perip:10m;
        ##If enable limit_conn_zone,add "limit_conn perip 10;" to server section.

        server_tokens off;
        access_log off;

server
    {	
		listen       80;
		server_name  111.111.111.111;
				
		fastcgi_connect_timeout 300;
		fastcgi_send_timeout 300;
		fastcgi_read_timeout 300;
		
		location / {
			proxy_http_version 1.1;
			proxy_set_header Connection "keep-alive";
			proxy_set_header X-Real-IP $remote_addr;
			if (!-f $request_filename) {
				 proxy_pass http://127.0.0.1:9501;
			}
		}
		
		
        access_log  /home/wwwlogs/access.log;
    }
server
    {
        listen       81;
        server_name 127.0.0.1:81;
        index index.html index.htm index.php admin.php;
        root  /home/wwwroot/default/phpmyadmin;

        #error_page   404   /404.html;
        include enable-php-pathinfo.conf;

        location /nginx_status
        {
            stub_status on;
            access_log   off;
        }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }

        location ~ /\.
        {
            deny all;
        }

        location / {
            if (!-e $request_filename) {
                rewrite  ^(.*)$  /index.php?s=/$1  last;
            }
        }

        access_log  /home/wwwlogs/access.log;
    }
	
#include vhost/*.conf;
}


7.啓動框架後,訪問 es.com 便可看到 Hello World 。node

相關文章
相關標籤/搜索