首页 文章 精选 留言 我的

精选列表

搜索[Python环境],共10000篇文章
优秀的个人博客,低调大师

[转]使用 Homestead 作为 tp5 的开发环境配置

这是迄今为止最优雅的解决方案了,亲测有效 在 Homestead/scripts 目录下新建文件 serve-tp5.sh #!/usr/bin/env bash declare -A params=$6 # Create an associative array paramsTXT="" if [ -n "$6" ]; then for element in "${!params[@]}" do paramsTXT="${paramsTXT} fastcgi_param ${element} ${params[$element]};" done fi block="server { listen ${3:-80}; listen ${4:-443} ssl http2; server_name .$1; root \"$2\"; index index.html index.htm index.php; charset utf-8; location / { #try_files \$uri \$uri/ /index.php?\$query_string; if (!-e \$request_filename) { rewrite ^(.*)$ /index.php?s=/\$1 last; #break; } } location = /favicon.ico { access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; } access_log off; error_log /var/log/nginx/$1-error.log error; sendfile off; client_max_body_size 100m; location ~* ^(/images|/Static).+.(jpg|jpeg|css|gif|png|ico) { access_log off; } location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php/php7.1-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name; fastcgi_intercept_errors off; fastcgi_buffer_size 16k; fastcgi_buffers 4 16k; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; include fastcgi_params; } location ~ /\.ht { deny all; } ssl_certificate /etc/nginx/ssl/$1.crt; ssl_certificate_key /etc/nginx/ssl/$1.key; } " echo "$block" > "/etc/nginx/sites-available/$1" ln -fs "/etc/nginx/sites-available/$1" "/etc/nginx/sites-enabled/$1" Homestead.yaml 文件添加 type 设置 sites: - map: domain.test to: /path type: tp5 原文地址:https://wp.hellocode.name/?p=439 2018年11月2日更新: 现在更新到最新的Homestead版本,官方自带了thinkphp类型

优秀的个人博客,低调大师

环境搭建-CentOS服务器之间设置免密码登录

在做大数据项目分布式开发时会用到Hadoop组件,Hadoop集群由Namenode节点和Datanode节点组成,在运行启动集群操作时,需要从Namenode节点登录到Datanode节点,执行相关启动脚本,因此需要配置免密码登录。 1.使用root账户修改shhd_config配置文件 执行命令【vi /etc/ssh/sshd_config】 修改shhd_config配置文件.png 去掉RSAAuthention yes前面的# 去掉PubkeyAuthentication yes前面的# shhd_config.png 然后运行命令【service sshd restart】生效配置 2.使用rsa非对称加密生成密钥 进入用户目录,运行命令【ssh-keygen -t rsa】生成密钥 生成密钥.png 进入【.ssh】目录,会发现生成了如下几个文件: ssh目录.png authorized_keys:存放远程免密登录的公钥,主要通过这个文件记录多台机器的公钥 id_rsa:私钥文件 id_rsa.pub:公钥文件 3.将公钥添加到需要远程登录机器的authorized_keys文件中 在添加之前先做一个测试,现在通过【ssh localhost】命令试试本机有没有免密码登录 测试.png 出现需要输入密码界面,证明还没有免密,需要将公钥添加到authorized_keys中,运行文件追加命令【cat id_rsa.pub >> authorized_keys】。 再通过【ssh localhost】命令试试本机有没有免密码登录: image.png 测试通过,现在就可以将公钥添加到需要远程登录机器的authorized_keys文件中,然后就实现了Namenode节点到Datanode节点的免密码登录。

优秀的个人博客,低调大师

Pi编译安装PHP/Nginx并安装完整LEMP环境

安装 Nginx+Php+Mysql #添加Nginx、Php最新源并刷新源 sudo add-apt-repository ppa:nginx/stable sudo add-apt-repository ppa:ondrej/php sudo apt-get update #安装Nginx sudo apt-get install nginx #安装Php7.1 FPM sudo apt-get install php7.1-fpm #php7.1 curl扩展 sudo apt-get install php7.1-curl #安装Mysql sudo install mysql-server #备份Mysql数据库 mysqldump -u root -p 欲备份的数据库名 > 导出的数据库名.sql #恢复mysql数据库 mysql -u root -p 恢复的数据库名 < 导出过的数据库名.sql #如恢复的数据库不存在 需要手动创建 create database 恢复的数据库名; 编译安装Nginx/1.11.4升级HTTP/2.0 #下载并解压Nginx源码 wget -c https://nginx.org/download/nginx-1.11.4.tar.gz tar -zxvf nginx-1.11.4.tar.gz #下载并解压OpenSSL源码 wget -c https://www.openssl.org/source/openssl-1.1.0.tar.gz tar -zxvf openssl-1.1.0.tar.gz #下载并解压nginx-ct源码 wget -O nginx-ct.zip -c https://github.com/grahamedgecombe/nginx-ct/archive/v1.3.0.zip unzip nginx-ct.zip #修复Nginx/1.11.3无法编译的问题<font style="color:red">此问题在Nginx 1.11.4已经解决,1.11.4请忽略</font> #由于OpenSSL 1.1.0 删除了 SSL_R_NO_CIPHERS_PASSED导致Nginx无法编译。这里我们需要修复nginx源码中的[一个文件](https://github.com/nginx/nginx/commit/af9e72533a69de3b8b7ed59be7be9b37203b5c82) #用文本编辑器打开 ./nginx-1.11.3/src/event/ngx_event_openssl.c #找到这个位置,大约在第2000行附近 if (n == SSL_R_BAD_CHANGE_CIPHER_SPEC /* 103 */ || n == SSL_R_BLOCK_CIPHER_PAD_IS_WRONG /* 129 */ || n == SSL_R_DIGEST_CHECK_FAILED /* 149 */ || n == SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST /* 151 */ || n == SSL_R_EXCESSIVE_MESSAGE_SIZE /* 152 */ || n == SSL_R_LENGTH_MISMATCH /* 159 */ || n == SSL_R_NO_CIPHERS_PASSED /* 182 */ 修改为 if (n == SSL_R_BAD_CHANGE_CIPHER_SPEC /* 103 */ || n == SSL_R_BLOCK_CIPHER_PAD_IS_WRONG /* 129 */ || n == SSL_R_DIGEST_CHECK_FAILED /* 149 */ || n == SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST /* 151 */ || n == SSL_R_EXCESSIVE_MESSAGE_SIZE /* 152 */ || n == SSL_R_LENGTH_MISMATCH /* 159 */ #ifdef SSL_R_NO_CIPHERS_PASSED || n == SSL_R_NO_CIPHERS_PASSED /* 182 */ #endif #保存 #编译Nginx #进入Nginx源码目录 cd ./nginx-1.11.4 #生成编译配置 ./configure \ #设置OpenSSL源码目录 --with-openssl=../openssl-1.1.0 \ #设置nginx-ct源码目录 --add-module=../nginx-ct-1.3.0 \ --with-debug \ --with-pcre-jit \ --with-ipv6 \ --with-http_ssl_module \ #启用HTTP/2.0模块 --with-http_v2_module \ --with-http_stub_status_module \ --with-http_realip_module \ --with-http_auth_request_module \ --with-http_addition_module \ --with-http_dav_module \ --with-http_gzip_static_module \ --with-http_sub_module \ --with-mail \ --with-mail_ssl_module #如无缺失依赖库,将会生成MakeFile #开始编译 make #编译完成后安装 sudo make install #默认安装在 /usr/local/nginx 下 #install Nginx End. 编译安装Php7.0 #从http://php.net/get/php-7.0.8.tar.gz/from/a/mirror 下载源码并解压 tar -xzvf xxxx.tar.gz #安装依赖 apt-get install libxml2-dev libssl-dev libcurl4-gnutls-dev libmcrypt-dev #解压镜像,然后进入文件夹中 ./configure --prefix=/usr/local/php7 \ --exec-prefix=/usr/local/php7 \ --bindir=/usr/local/php7/bin \ --sbindir=/usr/local/php7/sbin \ --includedir=/usr/local/php7/include \ --libdir=/usr/local/php7/lib/php \ --mandir=/usr/local/php7/php/man \ --enable-mbstring \ --with-curl \ --with-gd \ --with-config-file-path=/usr/local/php7/etc \ --enable-fpm \ --enable-mysqlnd \ --with-pdo-mysql=mysqlnd \ --with-mysql-sock=/var/run/mysqld/mysqld.sock #如提示缺少依赖包,请根据错误提示安装 #开始编译 make #编译测试 make test #安装 make install #install Php7 End.

资源下载

更多资源
腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册