<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Apache on nagg.eu</title><link>https://nagg.eu/tags/apache/</link><description>Recent content in Apache on nagg.eu</description><generator>Hugo</generator><language>en</language><lastBuildDate>Tue, 30 Jul 2013 15:49:37 +0000</lastBuildDate><atom:link href="https://nagg.eu/tags/apache/index.xml" rel="self" type="application/rss+xml"/><item><title>WordPress admin, SSL, Apache + nginx</title><link>https://nagg.eu/wordpress-admin-ssl-apache-nginx/</link><pubDate>Tue, 30 Jul 2013 15:49:37 +0000</pubDate><guid>https://nagg.eu/wordpress-admin-ssl-apache-nginx/</guid><description>&lt;p&gt;Let&amp;rsquo;s say we have a WordPress blog and we would like to encrypt our login pages and the whole back-end of the site.&lt;br&gt;
There are many ways to do it, but since I already have a nginx instance configured as reverse proxy running in front of Apache I&amp;rsquo;ll use it to &lt;code&gt;protect&lt;/code&gt; my admin pages and logins.&lt;br&gt;
In this page I&amp;rsquo;ll not cover Apache&amp;rsquo;s configuration, which, by the way, is trivial to say the least, so please refer to this other post: &lt;!-- raw HTML omitted --&gt;Apache + nginx as reverse proxy&lt;!-- raw HTML omitted --&gt;.&lt;br&gt;
Using the configuration posted in the above&amp;rsquo;s link as starting point, to add SSL encryption to admin pages we should add a couple more bunch of lines of code.&lt;br&gt;
First of all, we must create our own Certificate Authority and issue a SSL certificate.&lt;br&gt;
Another option is buying a certificate, but I don&amp;rsquo;t trust CA (certificate forgery anyone?) and I don&amp;rsquo;t mind having a properly signed certificate for a page I am the only one accessing to.&lt;br&gt;
Follows a brief explanation on how to create a CA and issue a certificate.&lt;/p&gt;</description></item><item><title>Apache + nginx as reverse proxy</title><link>https://nagg.eu/apache-nginx-as-reverse-proxy/</link><pubDate>Fri, 21 Jun 2013 16:11:13 +0000</pubDate><guid>https://nagg.eu/apache-nginx-as-reverse-proxy/</guid><description>&lt;p&gt;One of the things I was planning to do but never did is installing nginx as &lt;!-- raw HTML omitted --&gt;reverse proxy&lt;!-- raw HTML omitted --&gt; in front of Apache.&lt;br&gt;
nginx is present in the epel repos for CentOS, so the installation process is just a matter of:&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;yum install nginx mysql mysql-server phpmyadmin httpd
&lt;/code&gt;&lt;/pre&gt;&lt;!-- raw HTML omitted --&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;wget -q -O - http://www.atomicorp.com/installers/atomic | sh
&lt;/code&gt;&lt;/pre&gt;&lt;!-- raw HTML omitted --&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;yum install mod_rpaf
&lt;/code&gt;&lt;/pre&gt;&lt;!-- raw HTML omitted --&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;mkdir /etc/nginx/v.hosts
&lt;/code&gt;&lt;/pre&gt;&lt;!-- raw HTML omitted --&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;vi /etc/nginx/nginx.con
&lt;/code&gt;&lt;/pre&gt;&lt;!-- raw HTML omitted --&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;http {
 include v.hosts/*.conf;
 include /etc/nginx/mime.types;
 default_type application/octet-stream;
 
 log_format main &amp;#39;$remote_addr - $remote_user [$time_local] &amp;#34;$request&amp;#34; &amp;#39;
 &amp;#39;$status $body_bytes_sent &amp;#34;$http_referer&amp;#34; &amp;#39;
 &amp;#39;&amp;#34;$http_user_agent&amp;#34; &amp;#34;$http_x_forwarded_for&amp;#34;&amp;#39;;
 
 access_log /var/log/nginx/access.log main; 
 
 charset utf-8;
 keepalive_timeout 65;
 server_tokens off;
 sendfile on;
 tcp_nopush on;
 tcp_nodelay off;
 
# Default Server Block to catch undefined host names
# server {
# listen 80;
# server_name _; 
# root /usr/share/nginx/html;
# index index.html index.htm; }
}
&lt;/code&gt;&lt;/pre&gt;&lt;!-- raw HTML omitted --&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;/usr/sbin/nginx -t
&lt;/code&gt;&lt;/pre&gt;&lt;!-- raw HTML omitted --&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt; server {
 listen 80;
	 server_name nagg.eu;
 
 access_log off;
 error_log off;
 
 location / {
 proxy_pass http://127.0.0.1:8080;
 proxy_set_header X-Real-IP $remote_addr;
 proxy_set_header Host $host;
 proxy_redirect off;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 proxy_connect_timeout 90;
 proxy_send_timeout 90;
 proxy_read_timeout 90;
 client_max_body_size 10m;
 client_body_buffer_size 128k;
 proxy_buffer_size 4k;
 proxy_buffers 4 32k;
 proxy_busy_buffers_size 64k;
 }
 }
&lt;/code&gt;&lt;/pre&gt;&lt;!-- raw HTML omitted --&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;sudo /usr/sbin/nginx -t
service nginx restart
&lt;/code&gt;&lt;/pre&gt;&lt;!-- raw HTML omitted --&gt;
&lt;!-- raw HTML omitted --&gt;</description></item></channel></rss>