Archive | Wordpress

RSS feed for this section

Load Balancing Virtualmin WordPress Hosting Server with Varnish on AWS

I am creating a true load balancer topography for a WordPress hosting server, if it needs to scale up beyond what the current system can handle.

Scaling Levels

The current system is the “admin” path shown in the diagram, with no CDN or Load Balancing. It will handle a lot of traffic, but it is somewhat vulnerable to failure and overload. A simple and inexpensive extension of this system is to add CloudFront CDN, the “beta users” path.

For ultimate reliability and speed, I propose the “users” path: This will take most load off of the Virtualmin/Apache and Webmin/MySQL servers, because the user will be interacting only with CloudFront CDN and Varnish Caching Servers.

Load Balancing

The Load Balancing layer can be deployed separate from the current configuration, with DNS change to Route 53 for domains that require Load Balancing. If DNS routing for a domain goes to the Elastic IP, that traffic will interact directly with the primary Virtualmin/Apache server, which is OK for beta stage.

Traffic via Route 53 will be served from the Varnish instances, which will be load balanced, in multiple Availability Zones, and will serve cached WordPress pages as static HTML.

W3 Total Cache coordinates Apache and Varnish to provide updated disk-cached pages, and some data objects. CloudFront CDN pulls linked images, css, js, etc. from Apache via the W3 disk and opcode caches.

Redundancy and Fault Tolerance

More fault tolerance, speed and redundancy can be created via RAID10 arrays of multiple EBS Volumes, attached to the Virtualmin and Webmin instances. Creating a Storage Area Network for these volumes will provide shared /home and /var for the primary and slave instances.

Slave Server pairs for Virtualmin/Apache and Webmin/MySQL can be created to respond in round-robin fashion to the Varnish requests. With AWS Auto-scaling, more instances can be created on-demand if load on the backend servers is too great.

EBS snapshots of primary database server and web server will provide speedy recovery from catastrophic failure.
S3 backups of virtual domains on the primary Virtualmin/Apache server will provide speedy restoration of broken code or loss of files.

Be aware that creating a system with all of the elements I have described could be very expensive, and probably not necessary unless traffic is in the millions.

Website Workflow

WordPress sites:

At Soft Launch (client approval or beta):

  • Point A record to Elastic IP
  • Set up W3 Total Cache with CloudFront and Varnish, but do not deploy

At Public Launch:

  • Deploy W3TC
  • Point A record to Route 53, or set name servers to Route 53
Incoming search terms for the article:
Comments { 3 }

Automated WordPress Installation Via Custom Virtualmin Script Installer

WordPress (or any other script) can automatically install during Virtualmin > Create Virtual Server.

Virtualmin automatically creates users, MySQL database, and installs WordPress in the public_html root, then gives a link to the WordPress Installer. You can even create a custom installer with a set of plugins and themes.

To create a custom script installer with plugins and themes:

  • Download http://wordpress.org/latest.zip & unzip
    •   add some themes and plugins folders in /wp-content/
    •   zip as copy-of-latest.zip
  • Create a copy of /usr/libexec/webmin/virtual-server/scripts/wordpress.pl
    •   edit copy-of-wordpress.pl to give a new name: script_wordpress_desc “Custom WordPress”
    •   link to your zip: ‘url’ => “http://yourdomain.com/copy-of-latest.zip”,
  • Put copy-of-wordpress.pl in /usr/libexec/webmin/virtual-server/scripts/
  • Virtualmin > System Settings > Server Templates > Default Settings > Default Script Installers
    • Custom WordPress

 

Incoming search terms for the article:
Comments { 0 }

Punk Rock Music Community

Punktastic.com is a community powered site that covers punk music in Britain, but is poised to go worldwide. They cover punk and hardcore shows and festivals, and provide album reviews, video interviews and more.

With a growing audience and user base, Punktastic needed a more reliable and robust web server, so they made the move to a dedicated CentOS 5 series web server with 3GB RAM. While this is a relatively low-end box, it has plenty of horsepower for a single WordPress site and phpBB3 forum.

Punktastic.com web site

For this GIG, I soloed on…

  • transferring the site from a WAMP development server to the live LAMP server
  • configuring an active firewall to block the baddies
  • installing monitoring and administration tools
  • tuning Apache and MySQL for high traffic
  • integrating APC PHP Cache to speed up web pages and provide better concurrency

Loud Fast Rules.

Incoming search terms for the article:
Comments { 0 }

WordPress with W3 Total Cache on Nginx with APC (Virtualmin)

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 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 clean 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.

Testing the Virtualmin Nginx Modules

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.

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.

The Nginx modules are also available for the free Virtualmin GPL version. To install the modules, go to Virtualmin Package Updates (wbm-virtualmin-nginx and wbm-virtualmin-nginx-ssl).

WordPress Plugins for this Setup

  • W3 Total Cache — adds opcode cache, minification, browser cache and page cache capabilities to WordPress… 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… setting to file caching introduces URL rewrite errors… See W3TC Settings information below for instructions on how to implement File caching.
  • nginx Compatibility — makes WordPress more compatible with Nginx, allows use of permalinks without /index.php/

Configuring Nginx for WordPress pretty URL Permalinks

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… either by direct edit, or via URL Path Locations in Virtualmin > Services > Configure Nginx Website (see attached image…). 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.

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;
}

Adding APC Support for a Virtual Domain

Because Virtualmin’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)

Add the following to php.ini (adjust to your requirements)
[APC]
extension = apc.so
apc.enabled = 1
apc.shm_segments = 1
apc.shm_size = 32M
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 = 1
apc.filters = ""
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

Reloading PHP-fastcgi processes after changes to php.ini

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.

The service scripts are located in /etc/rc.d/init.d.

php-fcgi-domain1.com
php-fcgi-domain2.com

Script allows stop, start, restart
e.g.
service php-fcgi-domain2.com restart

The service may also be restarted via Webmin > Services > Bootup and Shutdown

Memory Considerations

PHP FCGId will launch the number of sub-processes you specify in Virtualmin > Server Configuration > 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’s memory and potential traffic.

Virtualmin explains: “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.”

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’s hope this rumor is true!

W3 Total Cache Settings

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 {…} directives in the nginx.conf created in your public_html root by W3TC, and add them after the location {…} directives described above.

You can do this either by copying the directives and pasting into /etc/nginx/nginx.conf, or (better) by using an include statement:

[...]
location ^~ /blogs.dir/ {
internal;
root /home/username/public_html/wordpress/wp-content;
}
include /home/username/public_html/nginx.conf;
[...]

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.

Conclusion

Sorry, no benchmarks. See my example/test site here.

Nginx support on Virtualmin is working well, though I don’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.

Incoming search terms for the article:
Comments { 11 }

Tuning Apache and MySQL for Best Performance in a Shared Virtual Hosting Environment

Web hosting has changed dramatically in the last few years. The majority of accounts are now running PHP scripts and MySQL, whereas in the past most accounts were only serving static HTML files. This presents challenges in security as well as performance tuning.

It is impossible to predict whether a certain configuration will work properly for a given server, unless the hardware, software, accounts, network and traffic are identical to a previously configured server… therefore it is impossible to give a configuration which will cover all applications.

Firewall Unnecessary Traffic from Affecting the Server

Before you begin performance tuning, please consider using a stateful packet inspection (SPI) firewall & login failure daemon (LFD) for your server: ConfigServer Firewall is an excellent free firewall & lfd. This will help prevent brute force probes, port flooding, DDOS, etc. If you have 600 virtual hosts running on a server, it is very likely that the server is experiencing constant malicious exploits, especially if you are also running email servers on the same IP addresses.

Tune Apache the Sane Way (Requires Basic Math Skills)

If you wish to tune your Apache MPM settings, you should consider following this method:
https://telvps.com/clients/knowledgebase/25/HOW-TO-Optimize-Apache-for-Low-Memory-Usage.html
(the formula works well for any level of traffic and memory).

MySQL Tuning Is More Difficult: Trial and Error

To test your MySQL cache variables, you may try mysqltuner: https://github.com/rackerhacker/MySQLTuner-perl

This script will analyze MySQL performance and make suggestions regarding your my.cnf configuration. If you are running MySQL 5 or later, the configuration statements can be in the following form (example from one of my servers):

[mysqld]
safe-show-database
net_buffer_length = 1M
max_allowed_packet = 4M
myisam_sort_buffer_size = 24M
sort_buffer = 8M
key_buffer = 32M
table_cache = 1000
query_cache_size = 128M
thread_cache_size = 8
innodb_buffer_pool_size = 22M
join_buffer_size = 12M
tmp_table_size = 64M
max_heap_table_size = 32M
max_connections = 85

This is for example only! table_cache should be set a little higher than the total number of tables (sum of MYISAM,INNODB,MEMORY etc.), as reported by mysqltuner. If you anticipate adding more virtual hosts, or clients adding more databases or tables, you will need to raise table_cache value.

Follow the recommendations from the Apache tuning, and then follow the recommendations of the mysqltuner script. The apache tuning will give you the number of maxclients, and from this you will know the appropriate beginning value for [mysqld] maxconnections. Begin with maxconnections set slightly higher than maxclients.

Take Time to Get a Realistic Assessment of MySQL Performance

If you have a PHP opcode and database caching strategy (such as APC) implemented on your web server and for your PHP script packages, you will be able to lower maxconnections, based on the information you receive from mysqltuner after 24-48 hours of steady traffic. For example, I have a server with Apache set to 256 maxclients, but the MySQL maxconnections set to 200, because many web requests do not require direct interaction with the MySQL server.

Take a look at “Highest usage of available connections”, and lower maxconnections accordingly. It is safe to lower maxconnections to a number slightly above the reported highest usage. Doing so will allow you to set higher values for the individual cache settings which affect the thread cache size, because the total thread buffer memory size is multiplied by maxconnections. Feedback is available in the reports for “Total buffers” and “Highest usage of available connections”.

After you have the proper settings for maxclients and maxconnections, restart httpd and mysqld. Wait 1 hour, and run mysqltuner to see if there are any recommended changes. Mysqltuner will show you the maximum memory which will be used by mysql. You should adjust config variables to take up no more than 60% of total RAM. Wait 24-48 hours and run mysqltuner again.

Example mysqltuner results:

-------- Storage Engine Statistics -------------------------------------------
[--] Status: -Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 2G (Tables: 748)
[--] Data in InnoDB tables: 20M (Tables: 76)
[--] Data in MEMORY tables: 1M (Tables: 1)
[!!] Total fragmented tables: 55

-------- Performance Metrics -------------------------------------------------
[--] Up for: 15h 7m 18s (1M q [31.195 qps], 105K conn, TX: 7B, RX: 285M)
[--] Reads / Writes: 63% / 37%
[--] Total buffers: 390.0M global + 18.6M per thread (200 max threads)
[OK] Maximum possible memory usage: 4.0G (66% of installed RAM)
[OK] Slow queries: 0% (13/1M)
[OK] Highest usage of available connections: 25% (51/200)
[OK] Key buffer size / total MyISAM indexes: 72.0M/1.1G
[OK] Key buffer hit rate: 99.9% (1B cached / 1M reads)
[OK] Query cache efficiency: 78.2% (967K cached / 1M selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 74K sorts)
[OK] Temporary tables created on disk: 20% (7K on disk / 38K total)
[OK] Thread cache hit rate: 99% (294 created / 105K connections)
[OK] Table cache hit rate: 84% (1K open / 1K opened)
[OK] Open file limit used: 71% (1K/2K)
[OK] Table locks acquired immediately: 99% (684K immediate / 686K locks)
[OK] InnoDB data size / buffer pool: 20.2M/28.0M

-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
MySQL started within last 24 hours - recommendations may be inaccurate
Enable the slow query log to troubleshoot bad queries

I suggest you NOT enable the slow query log unless the Slow Queries result is very high. Slow Queries result % will be somewhat high if MySQL has run for less than 24 hours.

Incoming search terms for the article:
Comments { 1 }

APC Cache Considerations for Virtual Hosting Environments

APC cache does not work well in a virtual hosting environment unless PHP is running as FCGID, and every individual virtual host has a unique PHP.ini and a unique fcgiwrapper. This is not the case with many virtual hosting environments because the memory and CPU requirements are too great.

I suggest using Virtualmin for a shared hosting environment with APC cache, because it does allow to set php.ini and fcgiwrapper for every individual virtual host, and so to set an individual configuration for APC per virtual server. However with 200+ virtual hosts all running PHP script packages, as is the case with a commodity shared hosting server, this will use a lot of memory, and you will need somewhere in the neighborhood of 10-30GB apc.shm_size if you attempt to configure a single APC cache for the entire server.

My web hosting server is for a small number of personal clients, so I adjust the APC settings for each individual account, depending on the number and type of PHP script packages running on the account. These accounts are all administered by myself, not by the clients.

I do not think APC is the correct cache for most shared web hosting servers, given the number of virtual hosts. You will probably have better results if you remove APC and concentrate on Apache performance tuning and MySQL cache.

If your clients are adamant in their requests to use APC cache, you may wish to move them to a different server which can properly handle their needs. Virtualmin is a very good choice for this, as it allows individual accounts to be configured with individual php.ini and fcgiwrapper, or even different versions of PHP. Of course, because this will require greater management, it should be charged as a premium service.

If you wish to enable APC on a commodity web hosting server, you may try the following method to selectively enable APC per directory:
http://www.php.net/manual/en/ini.php

Also see other recommendations in following comments… 

 

Incoming search terms for the article:
Comments { 2 }

Remote publishing to WordPress from Facebook via RSS

Most WordPress developers know you can use one of several plugins to publish from WordPress to a Facebook wall, app or fan page. Did you know you can also do the opposite? You can publish from Facebook to WordPress by using the FeedWordPress plugin and the RSS feed from your fan page. This can be handy for clients who want to keep their site updated with blog posts, or share links and information, but don’t necessarily want to spend the time to post with WordPress.

Let’s face it, Facebook is convenient to use to share a link, upload small photos and video, or write a brief update.

Your Blog is Hungry

FeedWordPress is a plugin that pulls content from an RSS feed and publishes articles as WordPress posts. It is somewhat complex to set up properly, so I won’t go into that here. It’s up to you to figure it out, but it is very useful for adding non-copyright or permitted content to your site or a client’s site. For instance, I use it to publish bicycle manufacturer’s RSS feeds to a local bike shop’s WordPress site. You can also use it to create a scraper site, but you wouldn’t do that, would you?

Connect WordPress to Facebook

Using the plugin Simple Facebook Connect, your client can publish WordPress posts to a Facebook fan page.  I suggest you install Simple Facebook Connect and learn how to set up a simple Facebook App using the plugin’s easy instructions. This will allow your website to use Facebook authentication to Publish to Facebook, allow comments by logged in Facebook users, etc.

Creating an App instead of a Fan Page or Business page may suit your needs. Give it a try if you have not already set up a Facebook Page. If you use SFC, don’t set it to automatically publish to Facebook, or you may create a publishing loop. Leave it set to manual publishing and you’ll have an extra Publish button in the post editor for that purpose.

Setting up the Facebook RSS Feed

If your client would like to use Facebook’s simple, highly available, multi-device platform to publish content to a WordPress website, you will need a Facebook page or app’s RSS feed.

Facebook Fan Pages or Business Pages are for groups or businesses. If you build websites, you have probably set these up for several clients already. But to make the RSS feed from the page available to RSS readers and aggregators, you must change a few settings:

  • Edit Page > Manage Permissions
  • Uncheck Only Admins can See Page
  • Age Restrictions: None
  • Country Restrictions: None

Uncheck All:

  • Users can write or post content on the wall
  • Users can add photos
  • Users can add tags to photos
  • Users can add videos

This will make your wall posts available to the general public, because users with restricted privacy settings cannot post to your wall (they can still comment on your posts).

Now you can click the Subscribe by RSS link on your page, and the RSS feed will not display the dreaded “Facebook Syndication Error”:

You probably reached this page by entering the guide of a syndicated error message into the location bar of your browser. This probably means that you can’t see the feed that you were trying to access. This is probably because the owner of the feed changed his or her privacy settings or deleted content on the feed. You may be able to get access to the feed by contacting the owner of the content being syndicated in that feed.

You will get a RSS URL: http://www.facebook.com/feeds/page.php?id=195534004499&format=rss20

If your feed’s language needs to be adjusted, for instance if your site is hosted in Netherlands but your audience is in U.S., you will need to add a locale parameter to the feed URL: http://www.facebook.com/feeds/page.php?id=195534004499&format=rss20&locale-en_US

Try it in Firefox or NetNewsWire or any RSS Reader to see if you get a valid feed. If you see Facebook Syndication Error, then go back and edit your page’s permissions (see above).

If your site is hosted in a locale different from the locale of your Facebook page (e.g. your host is located in Europe, but your Facebook page is for North America), then you should use the resolved IP address for Facebook for your locale. You can find this IP address from a terminal window with the ping command. Otherwise, Facebook.com will resolve to the IP address and language for your host server. This causes synchronization issues and may cause a sync timeout which can block your pages from loading.

FeedWordPress Syndication

OK, now you have a valid feed. Add it to FeedWordPress. The settings you may wish to change:

Posts & Links >

  • Permalinks point to: The local copy on this website
  • Relative URIs: leave relative URIs unresolved
  • Formatting filters: Expose syndicated posts to formatting filters

Now, you should have a valid RSS feed and a properly configured Syndication system.Log in to Facebook and go to the app or page (easy way is to type the name into Facebook search bar at top).Share a Link, paste the URL of the page you want to feature, e.g. http://www.extremevisionhomes.com/

Edit the fields in the Link content by clicking on them. Or, you can upload a photo or video. But be sure to add a tagline to “Say something about this…” This line becomes your Title in the RSS feed or WordPress post. Otherwise you will see a generic “Your Client’s Facebook Wall 07/12/2011 15:35:43″ as the title.

And on the client’s site, you will see this:

You may want to set up a WordPress Category for these posts. FeedWordPress can be configured to post to a specific Category, add Tags, etc. You might even separate these posts from the main blog page, or style them in your WordPress theme via CSS or a Category Template.

Incoming search terms for the article:
Comments { 3 }

Cpanel Mailman mailing lists: cannot manage lists after migrating to new host

We recently migrated 2 Cpanel servers to VPS. Most things migrated properly and without incident. However, Mailman mailing lists were the exception.

Mailing lists appear to have migrated properly, as they show up under WHM and Cpanel and usr/local/cpanel/3rdparty/mailman/bin/list_lists

However, when cpanel user clicks Manage link, the following message appears:

cpanel1.hosting.com mailing lists – Admin Links
No such list listname_domainname.com
There currently are no publicly-advertised Mailman mailing lists on cpanel1.hosting.com.To visit the administrators configuration page for an unadvertised list, open a URL similar to this one, but with a ‘/’ and the right list name appended. If you have the proper authority, you can also create a new mailing list.

This turned out to be a permissions issue:

root@cpanel1 [/usr/local/cpanel/3rdparty/mailman/bin]# ./check_perms

--snip--
directory permissions must be 02775: /usr/local/cpanel/3rdparty/mailman/.../list_domain.com/...
--snip--
Problems found: 2999

# ./check_perms -f

FIXED!!!

Incoming search terms for the article:
Comments { 2 }

Apache config for Worker MPM vs Prefork MPM

Some installations of Apache will have been compiled to work with either Prefork or Worker MPM, but most by default are compiled only to work with Prefork. Changing to Worker MPM may allow your server to handle much higher traffic, more user sessions, with less RAM use. Your site or server will not scale well if it is running Prefork MPM. Worker is a bit more difficult to set up properly, and has some restrictions regarding functionality of PHP scripts.

  • To determine which MPM is running:
    /usr/sbin/apachectl -l
    • If you see worker.c in the list of loaded modules, your Apache is running Worker MPM. If prefork.c, it is running prefork.
  • To determine if apache has Worker MPM compiled in:
    /usr/sbin/httpd.worker -l
    • If you see worker.c in the list of compiled-in modules, Apache can run Worker MPM.

Here is some useful info to help if your installation of Apache will work with Worker MPM:

  • Un-Comment HTTPD=/usr/sbin/httpd.worker in /etc/sysconfig/httpd
  • restart apache
  • do some performance testing and raise your worker server and thread limits to sane levels in httpd.conf

If you need to recompile Apache and PHP, then you should do more research. Recompiling is not a trivial process.

I found that my server had much better memory usage under Worker MPM, however:

  • some scripts (squirrelmail, phpmyadmin) do not work on a per-domain basis and must be run direct to the actual server process with symlinked directories. This is much more efficient but less convenient for virtual domain owners
  • some /dev processes took on strange group permissions, getting the gid of the first user in the apache group.
  • browser caching was not well supported… the dreaded “blank screen between page loads” occurred more frequently under Worker MPM than Prefork MPM… also login/logout was sketchy on some sites… not sure why but my guess is that sessions may not be quite persistent using Worker vs Prefork due to cookie confusion… possible that multi-threading does not track cookies well.
More testing will be necessary to determine whether Worker MPM is a benefit on my server.
Incoming search terms for the article:
Comments { 1 }

Recursive chmod Tricks

Recursively chmod only directories
find . -type d -exec chmod 755 {} \;

Similarly, recursively set the execute bit on every directory
chmod -R a+X *
The +X flag sets the execute bit on directories only

Recursively chmod only files
find . -type f -exec chmod 644 {} \;

Recursively chmod only PHP files (with extension .php)
find . -type f -name '*.php' -exec chmod 644 {} \;

Incoming search terms for the article:
Comments { 1 }