php作为后端脚本语言,需要和web服务器搭配。常见的有apache,nginx

php-fpm模式

PHP-CGI就是PHP实现的自带的FastCGI管理器。目前最好的一种方式。

mod_fastcgi模式

cgi定义:

CGI(Common Gateway Interface)。CGI是外部应用程序(CGI程序)与Web服务器之间的接口标准,是在CGI程序和Web服务器之间传递信息的规程。CGI规范允许Web服务器执行外部程序,并将它们的输出发送给Web浏览器,CGI将Web的一组简单的静态超媒体文档变成一个完整的新的交互式媒体。

就是apache和php之间的一个中间件协议。

阅读全文 »

sudo 取消密码

编辑 /etc/sudoers 文件
找到 root ALL=(ALL) …
在下面加入用户名 tyler ALL=(ALL) NOPASSWD:ALL

如果不成功可能是刚添加的语句被 %wheel ALL=(ALL) ALL 这句覆盖了。

查看用户组 id tyler 是否在 wheel 组中
把上面的语句放到 wheel 后面即可

查看yum安装路径

rpm -qa|grep 软件包名
rpm -ql 软件包名

查看端口和PID

mysqld进程在监听4567端口,进程id是2593:
# ss -lnp|grep 4567
tcp LISTEN 0 128 *:4567 *:* users:(("mysqld",2593,11))

2593的父进程是2592:
# ps -ef|grep 2593
mysql 2593 2592 0 04:46 ? 00:00:57 /usr/libexec/mysqld --wsrep-cluster-address=gcomm://

源码编译安装openssl 1.1.0g,当前的最新版。

centos7 OpenSSL安装最新版

查看现有版本

openssl version

安装编译源码的依赖

sudo yum install libtool perl-core zlib-devel -y

下载当前最新版

curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_0g.tar.gz

阅读全文 »

ref

centos7 升级到最新版

先确认openssl是否是最新版,需要支持https。apache现在最新版是2.4.33版本

卸载当前版本

sudo yum remove httpd -y

下载源码

阅读全文 »

安装后的设置

macos安装目录:/usr/local/mysql

添加到环境变量中:

sudo nano ~/.bash_profile
export PATH=${PATH}:/usr/local/mysql/bin

刚装好只有一个密码为空的root用户,设置一个密码
mysqladmin -u root password

阅读全文 »

先备份配置文件
sudo cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak

日志路径:/var/log/nginx

执行命令 cd /etc/nginx/conf.d 打开 Nginx 服务配置文件目录。
执行命令 sudo nano domain_name.conf 创建域名规则配置文件
每个域名建立一个独立的配置文件,输入下面配置信息。

阅读全文 »

Nginx on CentOS/RHEL 7

yum -y install yum-utils
yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
sudo yum install certbot-nginx
sudo certbot --nginx

实际使用的时候用python安装的方式没问题,使用yum安装会缺少python包。

自动更新:
测试一下
sudo certbot renew --dry-run
新建一个 crontab
0 0,12 * * * python -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew

按钮

SImageButton* pBtn = (SImageButton*)FindChildByName(L"btn_authCode");

弹出框 MessageBox

SMessageBox(NULL, _T("找不到系统主题配置文件。"), _T("警告"), NULL);

不显示任务栏图标

去掉appWnd加上toolWindow

标签

SStatic* txt = (SStatic*)FindChildByName(L"txt_activeTips");

<text pos="280,88" align="right" colorText="#4a4a4aff">888987757786</text>

checkbox

SCheckBox* pwnd = (SCheckBox*)FindChildByName(L"chk_proxy");
if (pwnd->IsChecked())
{...}

img

SImageWnd* img = (SImageWnd*)FindChildByName(L"img_errTips");
img->SetVisible(FALSE);

combobox

SComboBox* cmb = (SComboBox*)FindChildByName(L"cmbComPort");
wstring port;
int idx = cmb->GetCurSel();
if (idx != -1)
{
port = cmb->GetLBText(idx);
}

设置半透明

UpdateLayerFromRenderTarget(m_memRT,128)

窗口间异步事件的使用心得,中间也花了些时间,得到了群里同学的帮助,总算知道怎么用了。

  1. 首先在入口函数里面添加通知中心
SNotifyCenter *pNotifyCenter = new SNotifyCenter;
// BLOCK: Run application
{
FloatWin dlgFloat;
...
nRet = theApp->Run(dlgFloat.m_hWnd);
}
delete pNotifyCenter;
delete theApp;
阅读全文 »

为什么使用nginx服务flask还要wsgi服务呢?

Nginx是一个Web服务器,关心web服务相关的信息,不考虑如何运行python程序。
uWSGI是一个应用服务,知道如何通过WSGI和python通信。
Nginx和uWSGI都支持uWSGI协议。

Nginx处理外部世界的请求和返回。你的flask程序处理WSGI请求和返回,uWSGI知道如何启动你的程序,是处于http和wsgi的中间件。