vps

PHP sessions *not always* working

ⅰ亾dé卋堺 提交于 2019-12-09 01:01:55
问题 I've recently migrated a bunch of websites to a new VPS and I've been having a lot of trouble with PHP sessions. All the websites are pretty much configured the same way, but there is one website where the sessions don't always work. The thing that bugs me is it's kind of random. I can go on the website, log in, and the session will work fine. Then, I go back a hour later, try to log in on the same account, but it doesn't keep my session anymore. The VPS is running on CentOS 5.8 and it has

Browser forces downloading the php page when I want to open the page

依然范特西╮ 提交于 2019-12-08 11:08:05
问题 I use a VPS for my website. its based on Laravel framework and I have sat up php54 for my website. Now when I want to open the website (index.php in the public folder of Laravel), browser just force downloading the file as a application/x-httpd-php54 file type. I tested adding AddType application/x-httpd-php54 .php and AddHandler to the .htaccess in the public folder. Neither worked! I should mention if I enter the ip of my website or enter the name of page it opens the website with no

What exactly entails setting up a PHP Websocket Server?

Deadly 提交于 2019-12-07 04:01:13
问题 I'm getting into Web Sockets now and have been successfully using the online websockets Pusher(didn't like it) and Scribble(amazing but downtime is too frequent since it's just one person running it). I've followed this tutorial http://www.flynsarmy.com/2012/02/php-websocket-chat-application-2-0/ on my localhost and it works great! What I wanted to ask is, how do I setup the server.php from the above file to run as a websocket server on an online webhost/shared server? Or do I need to get a

SSH and -bash: fork: Cannot allocate memory VPS Ubuntu

大兔子大兔子 提交于 2019-12-07 02:06:10
问题 I am hosting my Rails app on Ubuntu 12.04 VPS, Nginx + Unicorn, after deployment everything is fine, but few hours later, when I ssh to the VPS I get this message -bash: fork: Cannot allocate memory -bash: wait_for: No record of process 4201 -bash: wait_for: No record of process 4201 If I run any command, it would just return -bash: fork: Cannot allocate memory. 回答1: Seems you have run out of memory. Many VPS servers are setup with no swap, so when you run out of memory, it will kill things

connect to the mysql database using phpseclib library

回眸只為那壹抹淺笑 提交于 2019-12-07 00:25:27
I have successfully connect to the My VPS using phpscelib library.Now i want to connect to my existing database.Please help me for this ? <?php set_include_path(get_include_path() . PATH_SEPARATOR . 'phpseclib'); include('Net/SSH2.php'); $ssh = new Net_SSH2('192.ccc.ccc.ccc'); if (!$ssh->login('ccc', 'cccc')) { exit('Login Failed'); } echo $ssh->exec("I need to put MySql commands here"); ?> First, wouldn't it be better to allow remote access for that user to mysql? However, I don't know your reasons. The most common an transparent way would be create a ssh tunnel. This can be done in two

pip install require tls/ssl

允我心安 提交于 2019-12-06 20:23:55
问题 I have got a problem with install python on my OVH vps server kubuntu 14.04 desktop. What i need to do ? :~/Desktop# python get-pip.py pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Collecting pip Could not fetch URL https://pypi.python.org/simple/pip/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping Could not find a version that satisfies the

不会前后端,用vps搭建个人博客(二)

可紊 提交于 2019-12-06 11:36:41
三、添加网页内容 1.下载安装WordPress 输入以下命令: wget https://wordpress.org/latest.tar.gz 当然你也可以用浏览器进网站下,但是基本都会提示如下图 注意到没?下面写的Nginx,我大胆猜测一下:访问流量大,但是该网站只用了Nginx,所以总是显示访问数过多。 但是我们的个人博客是完全不用担心的。 下载之后输入以下命令: tar -xzvf latest.tar.gz 然后使用 ls命令 你会发现一个名为wordpress的文件夹,接着 cd wordpress 然后我们就进入了该文件夹,再使用 ls命令 我们会在其中找到一个名为 wp-config-sample.php 的文件(图中为更改后的,相应文件名为wp-config.php) 输入以下命令: mv wp-config-sample.php wp-config.php vim wp-config.php `` 然后我们进入文本编辑,如下图: ![](https://img2018.cnblogs.com/blog/1839136/201912/1839136-20191204065604832-1988118382.png) 如果不会用vim,建议学一下,百度上都有,毕竟Linux编辑文件很多时候都离不开它。 目前你只要知道,进入vim界面后,按“i”键即可进入插入模式

不会前后端,用vps搭建个人博客(一)

核能气质少年 提交于 2019-12-06 11:30:54
 一、vps供应商选择 常见的国内有腾讯云(良心云)、阿里云(套路云)等,国外有bandwagon和vultr,本人选的vultr山姆叔叔东部便宜小鸡。目前vlutr还有新用户注册后充值10刀送50刀的活动。 二、域名注册商 国内有万网(已加入阿里豪华套餐)、腾讯云、华为云等,国外则有godaddy、name、namesilo等。有的域名便宜有的贵。另外, 目前国内域名只有org不用备案,其他的貌似都要备案(包括顶级域名com) 。说什么国内域名解析国外服务器不用备案都是假的,我就踩过坑。我的网站就是个人博客,一开始买了国内域名后想着建个站吧,于是先申请了良心云的试用(貌似是学生认证才有的,25岁以下免认证),这里庆幸一下。当我把一切都搭好后,还没高兴几天,我的域名被停止解析了。然后我想着,那就备个案吧,毕竟不想再折腾了。结果手续一堆,最要命的:命名不能全英文、名字不能有“论坛”、“博客”等字眼。好吧,我认了。但是转念一想,不能有这些字眼,那是不是意味着通不过呢?网上一搜,果然如此,个人建的博客(论坛就更不用说了,毕竟人一多就难以保证发的内容是否合法合规)很难通过,然后我屁颠屁颠跑去注册了国外域名。服务器又重新设置了才算完。 二、服务器搭建 网站环境 目前常见的结构有LNMP、LAMP。 LNMP:Linux+Nginx+MySQL+PHP

VPS系统后台性能优化实战

自闭症网瘾萝莉.ら 提交于 2019-12-05 23:40:46
2019年开始,新东方APP团队启动了长达半年以上的稳定性建设工作,为什么稳定性如此重要?因为随着每年30%以上的高速增长,现有的后端服务完全扛不住日益增多的用户带来的高并发,高可用场景。所以优化工作势在必行。 如果你是一名java程序员的话,相信你也会很清楚,有时候,在研发功能的时候,仅仅是贴着产品的需求在做开发,功能是都实现了,但是没有考虑到功能在高并发下面是否可用,响应是否及时。这就给以后的线上运行留下很多隐患。 我们做稳定性建设的原因就是要解决这些隐患,提高系统稳定性,提高单台机器的QPS性能。加快接口响应速度,优化数据库的sql查询。 下面看一下优化后的效果图: 以上是单独一台服务器的吞吐率和响应时间曲线图,从图中可以看到,暑期吞吐率增长5倍,服务响应时间从最长的50多秒大幅度减少到0.4秒。优化效果明显。 以下从3方面阐述优化方法: 1、如何定位后端问题 2、如何解决数据库问题 3、如何分析和解决程序问题 一、定位后端问题的方法: kibana 。可以还原线上有问题的接口的参数列表(实时性比较好,统计多台服务器的日志,统一处理)。 听云 用听云监测慢事务,慢接口比较详细,能准确定位接口是sql慢,还是代码哪里慢。 二、数据库知识点和优化 1、2种存储引擎 在MySQL中,索引属于存储引擎级别的概念,不同存储引擎对索引的实现方式是不同的

Upload with paperclip very slow (unicorn)

本秂侑毒 提交于 2019-12-05 15:27:19
Sitting here with a simple rails 3 app in which I have a simple Gallery model and each gallery has many images. The image model is extended with paperclip and with the following options has_attached_file :local, :styles => { :large => "800x800>", :medium => "300x300>", :thumb => "100x100#", :small => "60x60#" } In my galleries_controller I have the following action that is implemented in order to work with the jQuery-File-Upload plugin. thereby the json response. def add_image gallery = Gallery.find params[:id] image = gallery.images.new({:local => params[:local]}) if image.save render :json =