Articles of Ubuntu

权威的LEMP堆栈官方 – Ubuntu 14.04

我已经按照这里所示的确切过程: https : //www.digitalocean.com/community/tutorials/how-to-install-linux-nginx–mysql-php-lemp-stack-on-ubuntu-14-04 我一直有这么多的问题得到一个本地nginx堆栈启动。 我已经search了很多很多的堆栈,但无论如何我都弄不清楚。 虽然我很亲密,但是我的网站目前只是下载php文件而不是运行它们。 我正在使用我自己build立的虚拟盒子的stream浪汉。 我一直认为这是一个php5-fpm的问题,但我不知道了。 我需要帮助。 # You may add here your # server { # … # } # statements for each of your virtual hosts to this file ## # You should look at the following URL's in order to grasp a solid understanding # of Nginx configuration files […]

PHP“AT命令”不能在nginx ubuntu 16.04上执行

PHP示例代码不工作在服务器上: exec('echo "hello world" | at now + 2 minutes'); 在terminal相同的代码成功执行下面的代码: echo "hello world" | at now + 2 minutes 我们使用php 7.0,ngnix,ubuntu 16.04,我可以执行exec(“sudo php -v”); 成功。

PHP堆栈偶尔会显示空白页面

我已经开始在我的服务器上出现一个非常奇怪的错误,我不知道如何解决它。 基本设置是Ubuntu Lucid上的nginx上的PHP-FPM + APC上的Wordpress(而不是v3,以前的稳定版本)站点。 一次五分钟左右,有些页面会直接返回,空白页面,没有内容。 我会等一下,再试一次,它会正常工作。 这只是在过去一周左右发生的,但代码,平台或用户数量并没有真正的变化。 我正在用头撞墙,试图弄清楚它是如何发生的……我愿意接受所有的build议,如果你需要额外的细节,只要放下一个评论,我会尽快的完成。 。

nginx安装在Ubuntu上

我试图在一台Ubuntu机器上安装nginx。 ubuntu – 12.04精确内核 – 3.2.0 gcc – 4.6.3 sudo apt-get install gcc automake autoconf libssl-dev libreadline-dev 编译nginx会出现以下错误: gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -Wno-error -I src/core -I src/event -I src/event/modules -I src/os/unix -I /opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/gems/1.8/gems/passenger-4.0.29/ext -I /tmp/passenger.33e81r/pcre-8.32 -I objs -I src/http -I src/http/modules -I src/mail \ -o objs/addon/nginx/ContentHandler.o \ /opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/gems/1.8/gems/passenger-4.0.29/ext/nginx/ContentHandler.c make[1]: […]

login不支持Django + nginx + uwsgi

我有相当简单的login逻辑 – 类似于官方的Django解决scheme。 class Login(FormView): template_name = 'login.html' form_class = AuthenticationForm def get(self, *args, **kwargs): if self.request.user.is_authenticated(): return self._get_success_url(self.request) return super(Login, self).get(*args, **kwargs) def form_valid(self, form): self.auth(self.request, form.get_user()) return super(Login, self).form_valid(form) def form_invalid(self, form): messages.error(self.request, u'Invalid username or password') return super(Login, self).form_invalid(form) def get_success_url(self): return self._get_success_url(self.request) @staticmethod def _get_success_url(request): if 'next' in request.GET: return request.GET['next'] […]

Gitlab推送起源的主人

我有一个新版本的gitlab与nginx安装。 我可以访问前端没有问题,我可以创build用户/添加键,并创build项目。 创build我的第一个项目后,我试图按照项目页面上的指示,但我不断收到此错误。 我检查了所有的日志,找不到任何相关的东西: git push -u origin master 回报 /home/git/gitlab-shell/lib/gitlab_net.rb:71:in `get': undefined method `request_uri' for #<URI::Generic:0x00000001ca76b8> (NoMethodError) from /home/git/gitlab-shell/lib/gitlab_net.rb:31:in `allowed?' from /home/git/gitlab-shell/lib/gitlab_shell.rb:59:in `validate_access' from /home/git/gitlab-shell/lib/gitlab_shell.rb:23:in `exec' from /home/git/gitlab-shell/bin/gitlab-shell:16:in `<main>' fatal: Could not read from remote repository. Please make sure you have the correct access rights 并存在该存储库。 根据我在网上find的其他帮助,我试了一下: ssh git@myhost 并得到: PTY allocation request failed […]

ProxyPass工作者主机名太长,在apache2(2.4.7 Ubuntu 14.04 LTS),如何解决这个问题?

我必须将apache2设置为来自内部AWS ELB的反向代理。 ELB的URL是85个字符。 使用虚拟主机进行设置会失败,因为它会产生错误 ProxyPass worker hostname (internal-elb-greater-than-64-character-url-that-fails-in-apache-aws.amazon.com) too long. 如果ELBurlless于或等于64个字符,这个效果会很好。 configuration文件看起来像/etc/apache/sites-enabled/000-sites.conf (实际的ELB和网站的名称被replace) <VirtualHost *:80> ProxyPreserveHost On ServerName www.mydomain.com ServerAdmin me@mydomain.com DocumentRoot /var/www/html RewriteEngine On RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteCond %{HTTP_USER_AGENT} !^ELB-HealthChecker.* RewriteRule . https://www.mydomain.com%{REQUEST_URI} [R=301,L] ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined ProxyPass /test/ http://localhost:8080/ ProxyPassReverse /test/ http://localhost:8080/ ProxyPass / http://internal-elb-greater-than-64-character-url-that-fails-in-apache-aws.amazon.com/ ProxyPassReverse / http://internal-elb-greater-than-64-character-url-that-fails-in-apache-aws.amazon.com/ </VirtualHost> 我已经能够使用nginx在/etc/nginx/nginx.conf server […]

如何在保持相同url的同时代理nginx请求

我正在使用这个configuration自我托pipe的服务堆栈应用程序。 所以当我浏览mysite.com/json/reply/mytestmethod时,我被redirect到mysite.com:1337/json/reply/mytestmethod。 该应用程序工作正常,除了寻找帮助删除端口1337部分,并使其似乎来自mysite.com域。 干杯! server { listen 80; server_name mysite.com; root /var/www/mysite.com/html; index index.html; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; proxy_pass http://127.0.0.1:1337; } }

不能获得权限运行uWSGI皇帝

我有一段时间试图让Ubuntu + uWSGI + nginx作为我的networking服务器运行。 以下是我的configuration,以及我的emperor.log文件中的信息: nginxconfiguration: server { listen 80; server_name localhost; charset utf-8; client_max_body_size 5M; location / { try_files $uri @cc; } location @cc { include uwsgi_params; uwsgi_pass unix:/tmp/cc/cc_uwsgi.sock; } } uwsgiconfiguration: [uwsgi] base = /srv/www/cc app = hello module = %(app) socket = /tmp/cc/%n.sock chmod-socket = 664 uid = www-data gid = […]

使用Phusion Passenger(Nginx)的Letsencrypt导致中止的SSL握手

我试图让Letsencrypt在Ubuntu 15.10服务器上与Phusion Passenger(Nginx)一起工作。 我已经采取的步骤: sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt sudo service nginx stop cd /opt/letsencrypt ./letsencrypt-auto certonly –standalone -d example.com -d www.example.com 这创build了证书,链,fullchain和privkey pem文件。 然后用下面的代码编辑我的/etc/nginx/sites-available/example.conf: server { listen 80; server_name example.com www.example.com; return 301 https://$host$request_uri; } server { listen 443 ssl; server_name www.example.com; return 301 $scheme://example.com$request_uri; } server { listen 443 ssl; server_name example.com; root […]