LAMP

CakePHP Security::cipher() is not working specifically on server

萝らか妹 提交于 2019-12-02 01:27:27
问题 I'm having a problem with reading the encrpyted cookie. Debugging revealed that Security::cipher() on server is somehow broken. Is there anyway I could solve it? Below is the breakdown. Code $value = "Hello World"; $key = Configure::read('Security.salt'); $val = Security::cipher($value, $key); debug($val); $ret = Security::cipher($val, $key); debug($ret); Local app\views\pages\home.ctp (line 17) �J��WtJ0� app\views\pages\home.ctp (line 19) Hello World Server app/views/pages/home.ctp (line 17)

Best way to transparently log downloads?

孤街浪徒 提交于 2019-12-02 00:56:49
问题 I have a personal project that's been online for sometime now. I've been keeping a tally of downloads by doing this: When the user clicks the download link, it hits a PHP script that writes some information to a table. Once the data is written, the script returns the path to the actual file. The user then has the ability to save the file to their hard disk as if it was any other download. This has worked well enough for sometime; however, it prevents users from being able to right-click >

LAMP架构用户认证、域名跳转及访问日志

别来无恙 提交于 2019-12-01 23:54:38
11月15日任务 11.18 Apache用户认证 11.19/11.20 域名跳转 11.21 Apache访问日志 apache用户认证 针对目录 先确保主配置文件内开启了虚拟主机服务 [root@localhost ~]# vim /usr/local/apache2.4/conf/httpd.conf # Virtual hosts # Include conf/extra/httpd-vhosts.conf 删除Include行首的#,保存退出 编辑虚拟主机配置文件 [root@localhost ~]# vim /usr/local/apache2.4/conf/extra/httpd-vhosts.conf //把111.com那个虚拟主机编辑成如下内容 <VirtualHost *:80> # 指定网页文件存储的根目录 DocumentRoot "/data/wwwroot/111.com" # 指定服务器的主机名 ServerName www.111.com # 指定服务器的别名 ServerAlias www.example.com # 指定认证的目录 <Directory /data/wwwroot/111.com> # 这个相当于打开认证的开关 AllowOverride AuthConfig # 自定义认证的名字,作用不大 AuthName "111

Centos7下zabbix安装与部署

和自甴很熟 提交于 2019-12-01 23:39:43
Centos7下zabbix安装与部署 Zabbix介绍 LAMP/LNMP介绍 Zabbix安装与部署 1.Zabbix介绍 zabbix是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案。 zabbix能监视各种网络参数,保证服务器系统的安全运营;并提供灵活的通知机制以让系统管理员快速定位/解决存在的各种问题。 zabbix由2部分构成,zabbix server与可选组件zabbix agent。 zabbix server可以通过SNMP,zabbix agent,ping,端口监视等方法提供对远程服务器/网络状态的监视,数据收集等功能,它可以运行在Linux,Solaris,HP-UX,AIX,Free BSD,Open BSD,OS X等平台上。 2. LAMP/LNMP介绍 LAMP:Linux+Apache+Mysql/MariaDB+Perl/PHP/Python一组常用来搭建动态网站或者服务器的开源软件,本身都是各自独立的程序,但是因为常被放在一起使用,拥有了越来越高的兼容度,共同组成了一个强大的Web应用程序平台。 LNMP :LNMP指的是一个基于CentOS/Debian编写的Nginx、PHP、MySQL、phpMyAdmin、eAccelerator一键安装包。可以在VPS、独立主机上轻松的安装LNMP生产环境。 L

PHP + PhantomJS Rasterize

ぃ、小莉子 提交于 2019-12-01 22:46:16
I'm using PhantomJS 64 bit in my PHP application to dynamically capture an HTML page to be emailed to the user. phantomjs rasterize.js "http://..." /path_to_images/image.png This method works fine when I run the above on the command line but when the PHP script runs the command using exec it fails with no output and returns exit code 11. If I switch it to use the 32 bit phantomJS binary, the command succeeds but fails to load the google JSAPI on the page since with error Reference Error: can't find variable google . This is a problem because not all of the page content is loaded and captured

Chrome timeout Ajax request after 120 seconds?

房东的猫 提交于 2019-12-01 21:19:43
I am not sure if it is a bug or configuration error but I keep getting ajax requests "canceled" at exactly 120 seconds. No http response code given. The server side is running on a LAMP stack and the php max_execution_time is set to 240 seconds using mod_php5 Oddly enough, if I request the same page without ajax, it won't timeout after 120 seconds. Early tests shows that firefox does the same thing. Can anyone help with this bug/annoyance? Sample code set_timeout_limit(o); sleep(1000); try to add timeout: xxx (in ms) to your AJAX call example: $.ajax({ url: "test.html", timeout: 240000,

四十二、LAMP与LNMP web架构深度优化实战-第一部

早过忘川 提交于 2019-12-01 20:27:16
1.nginx.conf配置文件基本参数优化 1.1 隐藏nginx header内版本号信息 一些特定的系统及服务漏洞一般都和特定的软件版本号有关,我们应尽量隐藏服务器的敏感信息(软件名称及版本等信息),这样黑客无法猜到有漏洞的服务是否是对应服务的版本,从而确保web服务最大的安全。 [root@djw1 ~]# curl -I 192.168.0.102 HTTP/1.1 200 OK Server: nginx/1.6.2 -- 优化隐藏这个版本号 Date: Fri, 14 Jun 2019 08:25:07 GMT Content-Type: text/html Connection: keep-alive X-Powered-By: PHP/5.3.27 配置参数如下: [root@djw1 ~]# cat /application/nginx/conf/nginx.conf worker_processes 1; events { worker_connections 1024; } http { server_tokens off; include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; include extra/www.conf;

基于centos7.3 redhat7.3安装LAMP(php7.0 php7.1)生产环境实践

给你一囗甜甜゛ 提交于 2019-12-01 19:35:33
#本机信息 hostname LAMP ip 172.22.34.164 #由于官网yum源下载慢,这里添加ali源 yum clean all rm -rf /etc/yum.repos.d/*.repo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo sed -i '/aliyuncs/d' /etc/yum.repos.d/CentOS-Base.repo sed -i '/aliyuncs/d' /etc/yum.repos.d/epel.repo sed -i 's/$releasever/7/g' /etc/yum.repos.d/CentOS-Base.repo #关闭selinux&firewalld sed -i 's/SELINUX=.*/SELINUX=disabled/' /etc/selinux/config setenforce 0 systemctl stop firewalld systemctl disable firewalld #同步各个节点时间: yum -y

Chrome treating smart url and causing concurrent requests pend for each other

孤者浪人 提交于 2019-12-01 18:08:59
问题 I'm experiencing a weird issue in Google-Chrome that when one tab is open with a long-running script, a different tab is in 'pending' state until the first tab finishes. I've create a small fiddle to reproduce this issue and am also including here results from the run on Safari. When this fiddle is added a ?q=a and ?q=b it resolves this issue. However, when I'm calling two different smart urls ( http://domain.com/a/v1 http://domain.com/a/v2 or even http://dev.domain.com/a/v6 or http://dev

linux上安装LAMP笔记

大城市里の小女人 提交于 2019-12-01 17:33:53
B哥最近在参加比赛,需要把一个php项目部署到服务器上,故此在linux上安装LAMP环境,用于部署项目,第一次安装,做点儿笔记记录一下。 安装条件: Redhat或者CentOS linux环境已装好,并配置了yum源。 用yum安装httpd、mariadb、php 安装httpd: yum -y install httpd 安装mariadb: yum -y install mariadb-server 安装php: yum -y install php php-mysql 检查安装包 rpm -qa|grep -P "httpd|php|maria" 正常情况输出如下: 启动httpd: systemctl start httpd 验证httpd启动是否正常: 在index.html文件里加入http running字符串: echo “-----------------httpd running.-------------” > /var/www/html/index.html 然后用curl命令调接口: curl -k http://localhost:80 -v 正常返回如下: 问题解决: 启动后用curl调返回403 Forbidden: google查了资料也没有查到解决方法,然后无意间重启了一把竟然好了: systemctl restart httpd