<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>nginx Archives - Chris Gilligan » new media</title>
	<atom:link href="https://chrisgilligan.com/tag/nginx/feed/" rel="self" type="application/rss+xml" />
	<link>https://chrisgilligan.com/tag/nginx/</link>
	<description>portfolio of web work</description>
	<lastBuildDate>Mon, 29 Apr 2013 13:27:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>Install phpMyAdmin with SSL on CentOS, Amazon Linux, RedHat (Apache or NginX)</title>
		<link>https://chrisgilligan.com/consulting/install-phpmyadmin-with-ssl-on-centos-amazon-linux-redhat/</link>
					<comments>https://chrisgilligan.com/consulting/install-phpmyadmin-with-ssl-on-centos-amazon-linux-redhat/#respond</comments>
		
		<dc:creator><![CDATA[Chris Gilligan]]></dc:creator>
		<pubDate>Mon, 24 Sep 2012 05:53:52 +0000</pubDate>
				<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[Consulting]]></category>
		<category><![CDATA[Virtualmin]]></category>
		<category><![CDATA[amazon linux]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[phpmyadmin]]></category>
		<category><![CDATA[redhat]]></category>
		<guid isPermaLink="false">https://chrisgilligan.com/?p=1132</guid>

					<description><![CDATA[<p>How to install phpMyAdmin on CentOS, Amazon Linux, or Redhat. Configuration instructions are provided for Apache and NginX web servers.</p>
<p>The post <a href="https://chrisgilligan.com/consulting/install-phpmyadmin-with-ssl-on-centos-amazon-linux-redhat/">Install phpMyAdmin with SSL on CentOS, Amazon Linux, RedHat (Apache or NginX)</a> appeared first on <a href="https://chrisgilligan.com">Chris Gilligan » new media</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p style="float: right; margin: 0 0 10px 15px; width:240px; height: auto;">
		<img src="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2012/09/Screen-Shot-2012-09-07-at-11.09.50-AM.png?x32346" width="240" style="max-width: 100%; height: auto;" />
		</p><div id="attachment_1137" style="width: 310px" class="wp-caption alignright"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-1137" class="size-medium wp-image-1137" title="phpMyAdmin database display" alt="" src="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2012/09/Screen-Shot-2012-09-07-at-11.09.50-AM-300x195.png?x32346" width="300" height="195" srcset="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2012/09/Screen-Shot-2012-09-07-at-11.09.50-AM-300x195.png?x32346 300w, https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2012/09/Screen-Shot-2012-09-07-at-11.09.50-AM-1024x668.png?x32346 1024w, https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2012/09/Screen-Shot-2012-09-07-at-11.09.50-AM.png?x32346 1263w" sizes="(max-width: 300px) 100vw, 300px" /><p id="caption-attachment-1137" class="wp-caption-text">phpMyAdmin database display</p></div>
<p>I recently ran into a problem with the upgraded 3.5.2 phpMyAdmin package provided via the rpmforge.repo. Search no longer works, nor does pagination, etc. Plus, it&#8217;s out of date and vulnerable to an XSS exploit.</p>
<p>I have solved this by changing to the EPEL repo, which maintains the latest version of phpMyAdmin.</p>
<p>This post will teach you how to install phpMyAdmin on CentOS, Amazon Linux, or Redhat. Configuration instructions are provided for Apache and NginX web servers.</p>
<p>For this to work properly and safely, you should be running SSL on your host. Otherwise, change the ForceSSL line in the config file provided below&#8230;</p>
<h3>Install phpMyAdmin from EPEL repository</h3>
<p><strong>Uninstall current PMA:</strong><br />
<code>yum erase phpMyAdmin</code></p>
<p><strong>Set up EPEL repo:</strong></p>
<p>Find the latest epel-release at <a href="http://download.fedoraproject.org/pub/epel/6/x86_64/">http://download.fedoraproject.org/pub/epel/6/x86_64/</a><br />
<code>rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm</code></p>
<p>On Amazon Linux, epel-release is already loaded. Edit /etc/yum.repos.d/epel.repo to enabled=1</p>
<p><strong>Edit /etc/yum.repos.d/epel.repo to only include necessary software packages:</strong><br />
<code>includepkgs=phpMyAdmin php-php-gettext</code></p>
<p>I have removed RPMforge repo due to some recent problems, but if you still need rpm forge repo:<br />
<code>exclude=phpMyAdmin php-php-gettext</code></p>
<p><strong>Install PMA:</strong><br />
<code>yum install phpMyAdmin</code></p>
<div>
<h3>Apache</h3>
<div><strong>Edit /etc/httpd/conf.d/phpMyAdmin.conf</strong></div>
<div>
<ul>
<li>Allow all incoming hosts for a web hosting server, or only allow hosts you require: localhost, your local workstation, etc.)</li>
<li>For a hosting server with open access, you should have a login failure daemon to block offending IP addresses with multiple failed HTTP logins. <a href="http://configserver.com/">ConfigServer Firewall</a> works well, and has modules for cPanel and Webmin. <a href="http://ossec.net/">OSSEC</a> is another reactive IPTables firewall with Apache login failure IP blacklisting.</li>
<li>For Amazon EC2, a good practice is to create a discrete database server, and only allow access to it inside a VPC security group, or from specific IP addresses enabled in that security group. That way, you can safely Allow from ALL hosts, because the VPC firewall will prevent other access. Install phpMyAdmin on a separate web server, and restrict access to PMA&#8217;s directory (see below).</li>
</ul>
</div>
<div>
<pre class="lang:python decode:true"># phpMyAdmin - Web based MySQL browser written in php
# 
# Allows only localhost by default
#
# But allowing phpMyAdmin to anyone other than localhost should be considered
# dangerous unless properly secured by SSL

Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin

&lt;Directory /usr/share/phpMyAdmin/&gt;
   &lt;IfModule mod_authz_core.c&gt;
     # Apache 2.4
     &lt;RequireAny&gt;
       Require ip 127.0.0.1
       Require ip ::1
     &lt;/RequireAny&gt;
   &lt;/IfModule&gt;
   &lt;IfModule !mod_authz_core.c&gt;
     # Apache 2.2
     Order Deny,Allow
     # comment out Allow from All and add your own static IPs here for security 
     # Allow from All
     Allow from 123.456.7.89
     Allow from 12.345.67.89
     Allow from 127.0.0.1
     Allow from ::1
   &lt;/IfModule&gt;
&lt;/Directory&gt;

&lt;Directory /usr/share/phpMyAdmin/setup/&gt;
   &lt;IfModule mod_authz_core.c&gt;
     # Apache 2.4
     &lt;RequireAny&gt;
       Require ip 127.0.0.1
       Require ip ::1
     &lt;/RequireAny&gt;
   &lt;/IfModule&gt;
   &lt;IfModule !mod_authz_core.c&gt;
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from 127.0.0.1
     Allow from ::1
   &lt;/IfModule&gt;
&lt;/Directory&gt;

# These directories do not require access over HTTP - taken from the original
# phpMyAdmin upstream tarball
#
&lt;Directory /usr/share/phpMyAdmin/libraries/&gt;
    Order Deny,Allow
    Deny from All
    Allow from None
&lt;/Directory&gt;

&lt;Directory /usr/share/phpMyAdmin/setup/lib/&gt;
    Order Deny,Allow
    Deny from All
    Allow from None
&lt;/Directory&gt;

&lt;Directory /usr/share/phpMyAdmin/setup/frames/&gt;
    Order Deny,Allow
    Deny from All
    Allow from None
&lt;/Directory&gt;

# This configuration prevents mod_security at phpMyAdmin directories from
# filtering SQL etc.  This may break your mod_security implementation.
#
#&lt;IfModule mod_security.c&gt;
#    &lt;Directory /usr/share/phpMyAdmin/&gt;
#        SecRuleInheritance Off
#    &lt;/Directory&gt;
#&lt;/IfModule&gt;</pre>
<h3>NginX</h3>
<p><strong>Edit nginx.conf for the hostname&#8217;s server_name website</strong></p>
<pre class="lang:default decode:true">       location /phpMyAdmin {
               root /usr/share/;
               index index.php;
               location ~ ^/phpMyAdmin/(.+\.php)$ {
                       try_files $uri =404;
                       root /usr/share/;
                       fastcgi_pass localhost:9002;
                       fastcgi_param HTTPS on;
                       fastcgi_index index.php;
                       fastcgi_param SCRIPT_FILENAME /usr/share$fastcgi_script_name;
                       include /etc/nginx/fastcgi_params;
                       fastcgi_buffer_size 128k;
                       fastcgi_buffers 256 4k;
                       fastcgi_busy_buffers_size 256k;
                       fastcgi_temp_file_write_size 256k;
                       fastcgi_intercept_errors on;
               }
               location ~* ^/phpMyAdmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
                       root /usr/share/;
               }
        }

        location /phpmyadmin {
               rewrite ^/* /phpMyAdmin last;
        }</pre>
<p><strong>Edit /etc/phpMyAdmin/config.inc.php</strong></p>
<p>The config below shows some common config options. Important ones are ForceSSL and auth_type. For a production server, SSL should be ON and auth_type http is better; http auth uses MySQL user/pass combinations to restrict access to user-specific databases.</p>
</div>
<div>
<pre class="lang:php decode:true">&lt;?php
/* Servers configuration */
$i = 0;

/* Server: MySQL Server [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = 'MySQL Server';
$cfg['Servers'][$i]['host'] = '122.34.567.89';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'http';
$cfg['Servers'][$i]['user'] = 'pma';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = 'pmapassword';
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
$cfg['Servers'][$i]['relation'] = 'pma_relation';
$cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
$cfg['Servers'][$i]['table_info'] = 'pma_table_info';
$cfg['Servers'][$i]['column_info'] = 'pma_column_info';
$cfg['Servers'][$i]['history'] = 'pma_history';
$cfg['Servers'][$i]['recent'] = 'pma_recent';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma_table_uiprefs';
$cfg['Servers'][$i]['tracking'] = 'pma_tracking';
$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
$cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';

/* End of servers configuration */

$cfg['UploadDir'] = '/tmp';
$cfg['SaveDir'] = '/tmp';
/* only if your host supports SSL */
$cfg['ForceSSL'] = true;
$cfg['DefaultLang'] = 'en';
$cfg['ServerDefault'] = 1;
?&gt;</pre>
<h3>Create the phpmyadmin database for advanced functionality</h3>
</div>
</div>
<p>Look in phpMyAdmin folder /usr/share/phpMyAdmin/examples for create_tables.sql</p>
<p>ssh to server as root user<br />
<code>mysql<br />
-- or if it asks for password --<br />
mysql -u your-mysql-superuser -pyour-superuser-password<br />
mysql &gt; source /usr/share/phpMyAdmin/examples/create_tables.sql<br />
</code></p>
<h3>Log in to PMA</h3>
<p>Now you can log into PMA with your mysql root user credentials. https://yourhost.tld/phpmyadmin</p>
<ul>
<li>Create a mysql user, pma, with the password you added to the config file, with no default permissions, on localhost</li>
<li>Give pma user all permissions on phpmyadmin database, on localhost</li>
</ul>
<p>Now you have a secure PMA which will work for all mysql users on your host. Version 3.5+ now has Status Monitoring and Advisor. Used in conjunction with a performance tuning script like <a title="MySQL Tuning Primer" href="https://launchpad.net/mysql-tuning-primer">MySQL Tuning Primer</a>, it will help you fine-tune your MySQL server to your requirements and your environment.</p>
<div id="attachment_1394" style="width: 310px" class="wp-caption aligncenter"><a href="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2012/09/Screen-Shot-2012-09-24-at-8.51.27-PM.png?x32346"><img decoding="async" aria-describedby="caption-attachment-1394" class="size-medium wp-image-1394" title="phpMyAdmin MySQL server dashboard" alt="" src="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2012/09/Screen-Shot-2012-09-24-at-8.51.27-PM-300x202.png?x32346" width="300" height="202" srcset="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2012/09/Screen-Shot-2012-09-24-at-8.51.27-PM-300x202.png?x32346 300w, https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2012/09/Screen-Shot-2012-09-24-at-8.51.27-PM-1024x692.png?x32346 1024w, https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2012/09/Screen-Shot-2012-09-24-at-8.51.27-PM.png?x32346 1447w" sizes="(max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-1394" class="wp-caption-text">phpMyAdmin MySQL server dashboard</p></div>
<p>The post <a href="https://chrisgilligan.com/consulting/install-phpmyadmin-with-ssl-on-centos-amazon-linux-redhat/">Install phpMyAdmin with SSL on CentOS, Amazon Linux, RedHat (Apache or NginX)</a> appeared first on <a href="https://chrisgilligan.com">Chris Gilligan » new media</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://chrisgilligan.com/consulting/install-phpmyadmin-with-ssl-on-centos-amazon-linux-redhat/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>WordPress with W3 Total Cache on Nginx with APC (Virtualmin)</title>
		<link>https://chrisgilligan.com/wordpress/wordpress-with-w3-total-cache-on-nginx-with-apc-virtualmin/</link>
					<comments>https://chrisgilligan.com/wordpress/wordpress-with-w3-total-cache-on-nginx-with-apc-virtualmin/#comments</comments>
		
		<dc:creator><![CDATA[Chris Gilligan]]></dc:creator>
		<pubDate>Mon, 12 Mar 2012 15:25:34 +0000</pubDate>
				<category><![CDATA[Web Server Performance Tuning]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[apc]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[virtualmin]]></category>
		<category><![CDATA[w3 total cache]]></category>
		<category><![CDATA[w3tc]]></category>
		<guid isPermaLink="false">https://chrisgilligan.com/?p=672</guid>

					<description><![CDATA[<p>Virtualmin now includes support for Nginx web server. I deploy many WordPress sites with W3 Total Cache and APC Alternative PHP Cache, so I was very interested to see how Nginx performance compares to Apache for WordPress, and whether APC and W3TC would play nice with Nginx. I prefer to install WordPress in public_html/wordpress for [&#8230;]</p>
<p>The post <a href="https://chrisgilligan.com/wordpress/wordpress-with-w3-total-cache-on-nginx-with-apc-virtualmin/">WordPress with W3 Total Cache on Nginx with APC (Virtualmin)</a> appeared first on <a href="https://chrisgilligan.com">Chris Gilligan » new media</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p style="float: right; margin: 0 0 10px 15px; width:240px; height: auto;">
		<img src="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2012/03/virtualmin-nginx-wordpress-permalinks-apc.png?x32346" width="240" style="max-width: 100%; height: auto;" />
		</p><p><strong><a href="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2012/03/virtualmin-nginx-wordpress-permalinks-apc.png?x32346"><img loading="lazy" decoding="async" class="alignright size-medium wp-image-673" title="virtualmin-nginx-wordpress-permalinks-apc" alt="" src="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2012/03/virtualmin-nginx-wordpress-permalinks-apc-300x187.png?x32346" width="300" height="187" srcset="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2012/03/virtualmin-nginx-wordpress-permalinks-apc-300x187.png?x32346 300w, https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2012/03/virtualmin-nginx-wordpress-permalinks-apc-1024x638.png?x32346 1024w, https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2012/03/virtualmin-nginx-wordpress-permalinks-apc.png?x32346 1202w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a>Virtualmin now includes <a title="Virtualmin Nginx" href="http://www.virtualmin.com/documentation/web/nginx">support for Nginx web server</a>.</strong> I deploy many WordPress sites with W3 Total Cache and APC Alternative PHP Cache, so I was very interested to see how Nginx performance compares to Apache for WordPress, and whether APC and W3TC would play nice with Nginx.</p>
<p>I prefer to install WordPress in public_html/wordpress for ease of development, compatibility with other scripts, etc. Accordingly, the suggested configuration is for WordPress installed in a subfolder. This info also assumes you have successfully installed APC Cache on your server, and set up a <em>clean</em> install of Virtualmin with Nginx as the Alternative Web Server. Switching from Apache to Nginx later is difficult, as is transferring apache virtual server backups. Best to start fresh and build from scratch.</p>
<h3>Testing the Virtualmin Nginx Modules</h3>
<p>Virtualmin does not support Nginx and Apache together, and there is no easy migration from Apache to Nginx, so it is suggested to begin with a fresh install of Virtualmin with no existing accounts.</p>
<p>If you would like to experiment with Nginx, and you already have a Virtualmin Pro license, you are permitted to set up Virtualmin on a second server for testing and migration. I run the extra Virtualmin Pro system on a VPS that I use for backups, slave DNS, and testing.</p>
<p>The Nginx modules are <a title="Virtualmin Nginx on GPL?" href="http://www.virtualmin.com/node/20602">also available for the free Virtualmin GPL version</a>. To install the modules, go to Virtualmin Package Updates (wbm-virtualmin-nginx and wbm-virtualmin-nginx-ssl).</p>
<h3>WordPress Plugins for this Setup</h3>
<ul>
<li><a title="Wordpress opcode cache, page cache, caching, database cache, browser cache" href="http://wordpress.org/extend/plugins/w3-total-cache/">W3 Total Cache</a> &#8212; adds opcode cache, minification, browser cache and page cache capabilities to WordPress&#8230; and it works with Nginx. Works best with Alternative PHP Cache to provide opcode and database cache. Setting APC for all caches works easiest with Nginx&#8230; setting to file caching introduces URL rewrite errors&#8230; See <a title="W3 Total Cache Settings" href="#w3tc-settings">W3TC Settings</a> information below for instructions on how to implement File caching.</li>
<li><a title="Wordpress Nginx Plugin" href="http://wordpress.org/extend/plugins/nginx-compatibility/">nginx Compatibility</a> &#8212; makes WordPress more compatible with Nginx, allows use of permalinks without /index.php/</li>
</ul>
<h3>Configuring Nginx for WordPress pretty URL Permalinks</h3>
<p>The nginx Compatibility plugin has support for pretty URLs, but you must configure Nginx to use them. You should add or edit the following URL path locations to nginx.conf for your virtual domain&#8230; either by direct edit, or via URL Path Locations in Virtualmin &gt; Services &gt; Configure Nginx Website (<em><a title="Virtualmin Nginx WordPress URL Path Locations" href="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2012/03/virtualmin-nginx-wordpress-permalinks-apc.png?x32346">see attached image&#8230;</a></em>). This config is for WP installed in /public_html/wordpress, so you will need to omit or change /wordpress if WP is installed in a different directory.</p>
<pre class="lang:default decode:true" title="nginx conf for wordpress">location ^~ /files/ {
rewrite /files/(.+) /wordpress/wp-includes/ms-files.php?file=$1 last;
}
location @wordpress {
fastcgi_pass localhost:9000;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_NAME /index.php;
}
location ~ \.php$ {
try_files $uri @wordpress;
fastcgi_index index.php;
fastcgi_pass localhost:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location ^~ /blogs.dir/ {
internal;
root /home/username/public_html/wordpress/wp-content;
}</pre>
<h3>Adding APC Support for a Virtual Domain</h3>
<p>Because Virtualmin&#8217;s implementation of Nginx uses php-fastcgi, each virtual domain will load its own php.ini file, so you can add the APC directives to that file (/home/domainname/etc/php5/php.ini)</p>
<p>Add the following to php.ini (adjust to your requirements)</p>
<pre class="lang:default decode:true" title="php.ini section for WordPress with W3 Total Cache">[APC]
extension = apc.so
apc.enabled = 1
apc.shm_segments = 1
apc.shm_size = 12M
apc.optimization = 0
apc.num_files_hint = 256
apc.user_entries_hint = 1024
apc.ttl = 0
apc.user_ttl = 0
apc.gc_ttl = 600
apc.cache_by_default = 0
apc.filters = "-/home/username/public_html/scripts-not-to-cache/.*,-/home/username/public_html/apc/.*"
apc.slam_defense = 0
apc.use_request_time = 1
apc.mmap_file_mask = /tmp/apc.XXXXXX
apc.file_update_protection = 2
apc.enable_cli = 0
apc.max_file_size = 2M
apc.stat = 1
apc.write_lock = 1
apc.report_autofilter = 0
apc.include_once_override = 0
apc.rfc1867 = 0
apc.rfc1867_prefix = "upload_"
apc.rfc1867_name = "APC_UPLOAD_PROGRESS"
apc.rfc1867_freq = 0
apc.localcache = 1
apc.localcache.size = 256
apc.coredump_unmap = 0
apc.stat_ctime = 0</pre>
<h3>Reloading PHP-fastcgi processes after changes to php.ini</h3>
<p>You will need to reload the php-fastcgi processes if you change php.ini. Luckily, Virtualmin creates service scripts for each virtual domain, which you can use to reload PHP.</p>
<p>The service scripts are located in /etc/rc.d/init.d.<br />
<code>php-fcgi-domain1-com<br />
php-fcgi-domain2-com</code><br />
Script allows stop, start, restart<br />
e.g.<br />
<code>service php-fcgi-domain2-com restart</code></p>
<p><em><strong>The service may also be restarted via Webmin &gt; Services &gt; Bootup and Shutdown</strong></em></p>
<h3>Memory Considerations</h3>
<p>PHP FCGId will launch the number of sub-processes you specify in Virtualmin &gt; Server Configuration &gt; Website Options, so beware of the memory overhead if you specify a large number, because each will consume the amount of memory specified in  apc.shm_size. You may need to experiment with this value, depending on your server&#8217;s memory and potential traffic.</p>
<p>Virtualmin explains: &#8220;When PHP scripts for this domain as run via FCGId, the number of PHP processes set in this field will be kept running at all times to serve requests. You can increase this from the default of 4 to improve PHP script latency, or decrease it to reduce memory use. Setting it to None will cause PHP processes to be launched only as needed on demand, and to be cleaned up after some period of inactivity.&#8221;</p>
<p>Nginx support on Virtualmin is working well, and it is reported that the lead developer, Jamie Cameron, is working on a php-fpm implementation, which should increase performance and lessen memory requirements. Let&#8217;s hope this rumor is true!</p>
<h3><a title="W3 Total Cache Settings" name="w3tc-settings"></a>W3 Total Cache Settings</h3>
<p>Provided you use the nginx.conf settings described above, using APC cache for all W3TC categories of cache/minify/etc. will work with no additional changes to the conf file. However, if you wish to choose Disk cache for page and/or minify cache, URL rewriting will not work properly on Virtualmin. You must include the location {&#8230;} directives in the nginx.conf created in your public_html root by W3TC, and add them after the location {&#8230;} directives described above.</p>
<p>You can do this either by copying the directives and pasting into /etc/nginx/nginx.conf, or (better) by using an include statement:</p>
<pre class="lang:python decode:true">[...]
location ^~ /blogs.dir/ {
internal;
root /home/username/public_html/wordpress/wp-content;
}
include /home/username/public_html/nginx.conf;
[...]</pre>
<p><em><strong>However, remember you will need to restart NginX web server after making changes to the W3TC configuration, because these will over-write the local nginx.conf file.</strong></em></p>
<h3>Conclusion</h3>
<p>Sorry, no benchmarks. See my <a title="Wordpress on Nginx with APC cache (Virtualmin)" href="http://nginx.chrisgilligan.com/" target="_blank">example/test site here</a>.</p>
<p>Nginx support on Virtualmin is working well, though I don&#8217;t see much improvement over Apache in terms of initial index page load, or time to first byte on the WordPress test site I created.  Cached and subsequent pages load very quickly, so it looks like there is an overall improvement. All WordPress functions seem to work well: comments, image uploads, etc. are no problem. I am interested to see if there is improvement with other scripts, especially phpbb3.</p>
<p>The post <a href="https://chrisgilligan.com/wordpress/wordpress-with-w3-total-cache-on-nginx-with-apc-virtualmin/">WordPress with W3 Total Cache on Nginx with APC (Virtualmin)</a> appeared first on <a href="https://chrisgilligan.com">Chris Gilligan » new media</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://chrisgilligan.com/wordpress/wordpress-with-w3-total-cache-on-nginx-with-apc-virtualmin/feed/</wfw:commentRss>
			<slash:comments>20</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Page Caching using Disk: Enhanced 
Content Delivery Network via Amazon Web Services: CloudFront: d2lehxir4n36oh.cloudfront.net
Lazy Loading (feed)

Served from: chrisgilligan.com @ 2026-09-06 01:44:59 by W3 Total Cache
-->