摘要: Openstack api 学习文档 & restclient使用文档转载请注明http://www.cnblogs.com/juandx/p/4943409.html这篇文档总结一下我初步学习Openstack的api,并且趁这个机会学习一下Firefox的restclient客户端。一、使用cu... 阅读全文
posted @ 2015-11-06 19:01 juandx 阅读(9628) 评论(1) 推荐(3) 编辑

配置httpd

mkdir /etc/ssl/private
chmod 700 /etc/ssl/private
openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout /etc/ssl/private/apache-selfsigned.key -out /etc/ssl/certs/apache-selfsigned.crt
openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
cat /etc/ssl/certs/dhparam.pem | sudo tee -a /etc/ssl/certs/apache-selfsigned.crt

vi /etc/httpd/conf.d/ssl.conf
<VirtualHost _default_:443>
. . .
DocumentRoot "/var/www/your_dir"
ServerName www.example.com:443

#然后是配置flask,当然flask是必须用wsgi来搞apache了,官网有http的例子http://flask.pocoo.org/docs/0.12/deploying/mod_wsgi/
#这里其实只需要在/etc/httpd/conf.d/ssl.conf做这些工作就行啦 在上一步的后面中加入

WSGIDaemonProcess your_web_group user=apache group=apache threads=2
WSGIScriptAlias / /var/www/your_dir/your_web.wsgi

<Directory /var/www/your_dir>
    WSGIProcessGroup your_web_group
    WSGIApplicationGroup %{GLOBAL}
    Order deny,allow
    Allow from all
</Directory>

注释两行:
# SSLProtocol all -SSLv2
. . .
# SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5:!SEED:!IDEA

改两个地方:
SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key


设置http强制proxy到https

vi /etc/httpd/conf.d/non-ssl.conf
<VirtualHost *:80>
        ServerName www.example.com
        Redirect "/" "https://www.example.com/"
</VirtualHost>

检查配置,重启服务,设置防火墙

apachectl configtest

systemctl restart httpd.service

iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT
iptables -I INPUT -p tcp -m tcp --dport 443 -j ACCEPT

访问ip,如果没有问题就ok了,注意防火墙和selinux的问题

关闭selinux
vim /etc/selinux/config
设置为disable

reboot
posted @ 2018-02-08 14:27 juandx 阅读(368) 评论(0) 推荐(0) 编辑
摘要: linux: windows: 如果密码复杂的,密码历史修改: 阅读全文
posted @ 2017-06-12 10:55 juandx 阅读(724) 评论(0) 推荐(0) 编辑
摘要: yum y groupinstall "Server with GUI" RHEL7 安装图形界面 1. 以root角色运行以下命令来安装TigerVNC server yum install tigervnc server 也可以同时安装vnc client yum install vnc 2. 阅读全文
posted @ 2017-06-12 10:34 juandx 阅读(374) 评论(0) 推荐(0) 编辑
摘要: http://blog.jobbole.com/86594/ 阅读全文
posted @ 2017-05-24 11:27 juandx 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 在ubuntu安装gcc 编辑 test.c 完成后会出现一个可执行文件test,这就是编译好的文件,直接./test 就可以执行了! 阅读全文
posted @ 2017-04-27 00:19 juandx 阅读(661) 评论(0) 推荐(0) 编辑
摘要: k8s的一个好guide啊,分分钟上手 https://kubernetes.io/docs/tutorials/stateless-application/hello-minikube/ 在mac上操作,使用virtulbox的driver,如果用linux,可以使用kvm的driver,文档在上 阅读全文
posted @ 2017-04-24 10:54 juandx 阅读(2171) 评论(0) 推荐(0) 编辑
摘要: yum -y groupinstall "Server with GUI" RHEL7 安装图形界面1. 以root角色运行以下命令来安装TigerVNC server yum install tigervnc-server 也可以同时安装vnc client yum install vnc2. 配 阅读全文
posted @ 2017-04-17 18:05 juandx 阅读(383) 评论(0) 推荐(0) 编辑
摘要: 在“计算机”图标上右键选择“管理”,在打开的“计算机管理”窗口中选择左侧的“设备管理器”,然后在右侧图示的地方右键选择“添加过时硬件”。 在打开的窗口中点击“下一步”。 选择“安装我手动从列表中选择的硬件(高级)”,然后下一步。 把滚动条拉到最下面,选择“网络适配器”,然后下一步。 在左侧的“厂商” 阅读全文
posted @ 2017-04-15 16:09 juandx 阅读(5278) 评论(0) 推荐(0) 编辑
摘要: Linux中查看socket状态:cat /proc/net/sockstat #(这个是ipv4的) sockets: used 137 TCP: inuse 49 orphan 0 tw 3272 alloc 52 mem 46UDP: inuse 1 mem 0RAW: inuse 0 FRA 阅读全文
posted @ 2017-03-24 17:50 juandx 阅读(370) 评论(0) 推荐(0) 编辑
摘要: Nginx:Hey,WSGI,我刚收到了一个请求,我需要你作些准备,然后由Flask来处理这个请求。 WSGI:OK,Nginx。我会设置好环境变量,然后将这个请求传递给Flask处理。 Flask:Thanks WSGI!给我一些时间,我将会把请求的响应返回给你。 WSGI:Alright,那我等 阅读全文
posted @ 2017-03-23 13:16 juandx 阅读(291) 评论(0) 推荐(0) 编辑
摘要: 黑书 计算机操作系统中说了很多。 首先,在一个cpu的情况下,进程是一个程序运行时的总和,一个时刻肯定只有一个进程在执行,只是cpu会使用进程调度算法来回切换进程而已,就绪,运行,阻塞 三个状态,一般交互式操作系统采用优先级 ,时间轮转,多级反馈队列调度算法等调度算法。 每个进程有一个执行线程,也可 阅读全文
posted @ 2017-03-23 12:22 juandx 阅读(305) 评论(0) 推荐(0) 编辑
摘要: jenkins GitHub 自动触发转载请注明出处: 转载自Bin's Blog: jenkins GitHub 自动触发( http://www.wenbin.cf/post/54/ )需要在github得到push后自动触发jenkins做构建参考自http://www.cnblogs.com 阅读全文
posted @ 2017-03-22 10:53 juandx 阅读(1091) 评论(0) 推荐(0) 编辑
摘要: celery突然连接不上rabbitmq server,结果找半天发现是rabbitmq卡的不行。。。 rabbitmq 设置web管理,添加用户rabbitmqctl list_queues | grep notificationsrabbitmq-plugins enable rabbitmq_ 阅读全文
posted @ 2017-03-21 15:12 juandx 阅读(381) 评论(0) 推荐(0) 编辑
摘要: 系统编码,可以通过locale命令查看(LINUX)https://wiki.archlinux.org/index.php/Locale_(简体中文), centos7 配置文件在/etc/profile.d/lang.sh文件编码,它代表源码文件内的所有内容都是根据词方式编码成二进制码流,存入到 阅读全文
posted @ 2017-03-20 14:34 juandx 阅读(7655) 评论(0) 推荐(0) 编辑
摘要: 尴尬了,昨天被问,突然不知道咋搞。 二叉树遍历,前中后,是以root为准的前中后 所以反转二叉树用后续遍历就好 递归 非递归 阅读全文
posted @ 2017-03-15 11:17 juandx 阅读(387) 评论(0) 推荐(0) 编辑
摘要: 一个二叉树,从右边看,输出你看到的从上到下的顺序 其实就是遍历每一层 阅读全文
posted @ 2017-02-23 21:23 juandx 阅读(560) 评论(0) 推荐(0) 编辑
摘要: 使用pyenv安装多个版本的python 管理多个python环境使用 virtualenv 请看 http://www.cnblogs.com/juandx/p/5357518.html 阅读全文
posted @ 2017-02-20 11:37 juandx 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 官方的解释是:闭包是一个拥有许多变量和绑定了这些变量的环境的表达式(通常是一个函数),因而这些变量也是该表达式的一部分。 通俗理解:闭包就是能够读取其他函数内部变量的函数。 在这段代码中,result实际上就是闭包f2函数。它一共运行了两次,第一次的值是1001,第二次的值是1004。这证明了,函数 阅读全文
posted @ 2016-12-13 11:17 juandx 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 自己搭建的devops环境是gitlab/gerrit/jenkins 1. 首先自己checkout一个自己的代码分支,一般不要在master上做直接修改 2. 修改后git add file, git commit 3. git review 4. jenkins自动部署测试 5. 人工revi 阅读全文
posted @ 2016-12-07 11:31 juandx 阅读(770) 评论(0) 推荐(0) 编辑
摘要: http://www.wenbin.cf/post/37/ 1. 安装nginx,createrepo 2. 修改nginx配置文件,/etc/nginx/nginx.conf 重启nginx, systemctl restart nginx 3. 在nginx根目录建立文件夹 4. 准备同步阿里云 阅读全文
posted @ 2016-12-06 11:19 juandx 阅读(4209) 评论(1) 推荐(0) 编辑
点击右上角即可分享
微信分享提示