Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 26th September 2010, 18:14
macguru macguru is offline
Member
 
Join Date: May 2007
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Question Wordpress Permissions/Permalinks/mod_rewrite

Hi !

I have installed WordPress 3 on ISPConfig 2 & SuSE 11.2 (with several domains). WP runs just on one domain, with some problems:

1) WP runs hell slow, despite CPU load barely reaches 4 - 8%. I have Joomla installed on the same server (on another domain), and it is lightning fast. Server is Intel Quad-Core, with 4GB RAM, and Escalade Level 5 RAID. I suspect this is problem with caching which is related to problem #2.

2) ISPConfig 2 have created setup with all files/folders in this particular web directory as user/group "web14_info / web14". However, server runs as user/group "wwwrun / www", and thus, WordPress caching dirs need tb be chmod 777 which is not acceptable in terms of security..

I looked through posts and there seem to be 2 solutions - php safe mode (depreciated) and suphp (too cumbersome).

May be just change group from "web14" to "www" and make chmod g+rw?

3) Custom permalinks don't work despite mod_rewite have been installed/activated and all changes in ".htaccess" made according to changes propsed by WP.


I think a lot of people should have resolved these problems somehow. Any suggestion9s) are greatly appreciated. Thanks in advance.
Reply With Quote
Sponsored Links
  #2  
Old 26th September 2010, 19:14
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,461
Thanks: 813
Thanked 5,240 Times in 4,108 Posts
Default

Quote:
May be just change group from "web14" to "www" and make chmod g+rw?
Will not give you any real security benefit over doing a chmod 777 as almost all hacks occur trigh cms systems.

Using safemode is ok. Marking a function as deprecated in PHP means that it will get removed in future versions. Current PHP versions have still safemode builtin and it works fine, so there is no reason to not use it.

To speed up wordpress you normally use a caching extension. It might be that joomla has a static file cache builtin, for wordpress you install a plugin for that.

The steps to speedup a wordpress install are:

1) install a php binary cache like xcache:

apt-get install php5-xcache
/etc/init.d/apache2 restart

2) Install a wordpress caching extension like "W3 toatl cache"

If you use ispconfig 3 instead of 2, then you are able to run php as fcgi with suexec. But that option is not available in ispconfig 2.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 13th December 2011, 11:31
talkingnews talkingnews is offline
Member
 
Join Date: Jan 2011
Posts: 65
Thanks: 15
Thanked 5 Times in 5 Posts
Default

I've got extremely slow Wordpress under ISPConfig 3.0.4.1, but unlike the post above, it's the back end only. I updated to WP 3.3 this morning, but still the same.

The strange thing is, I'm running a personal WP install on a free "tiny" instance on Amazon S3 with a similar config and low memory, and it flies along. Which is what makes it even more difficult to diagnose.

Anyway, here's a whole load of details:

Ubuntu 11.10
Nginx 1.0.10
php5-fpm 5.3.8

I've got a 256Mb VPS running a Zen Cart store and phpbb3, both in different php-fpm pools. There's hardly anything running except the essentials and both those sites absolutely rocket along. As does the front end of the Wordpress site, when W3TC accelerated.

BUT.... the admin side takes 6-10 seconds to do anything.
There's nothing in the mysql slow log, or the php-fpm error log, the load doesn't spike, and the memory usage doesn't shoot up (but see below about memory).

The first time it loads, at wp-admin/options.php it shows a very long page that looks wrong, with line after line of stuff like...

active_plugins SERIALIZED DATA

Here's the main items from ps_mem.py

Code:
732.0 KiB +  87.5 KiB = 819.5 KiB       bash
  2.1 MiB + 369.0 KiB =   2.4 MiB       fail2ban-server
  1.8 MiB +   2.0 MiB =   3.9 MiB       nginx (5)
  5.1 MiB +  12.8 MiB =  17.9 MiB       php5-fpm (29)
 87.8 MiB + 149.0 KiB =  88.0 MiB       mysqld
---------------------------------
                        116.2 MiB
=================================
Here's the load average pretty much all the time:
load average: 0.48, 0.53, 0.51

And here's the output from free -m

Code:
             total       used       free     shared    buffers     cached
Mem:           241        202         38          0          3         49
-/+ buffers/cache:        149         92
Swap:          511         29        482
Here's the nginx.conf, including the cloudflare real_ip settings (tried without cloudflare too), and also the rewrite required to make permalinks work under nginx:

Code:
server {
        listen 31.172.x.x:80;
		
        
        server_name mysite.co.uk www.mysite.co.uk www.my-site.co.uk my-site.co.uk;

        root   /var/www/mysite.co.uk/web;
				
        index index.html index.htm index.php index.cgi index.pl index.xhtml;
		
        error_page 400 /error/400.html;
        error_page 401 /error/401.html;
        error_page 403 /error/403.html;
        error_page 404 /error/404.html;
        error_page 405 /error/405.html;
        error_page 500 /error/500.html;
        error_page 502 /error/502.html;
        error_page 503 /error/503.html;
		
        error_log /var/log/ispconfig/httpd/mysite.co.uk/error.log;
        access_log /var/log/ispconfig/httpd/mysite.co.uk/access.log combined;

        ## Disable .htaccess and other hidden files
        location ~ /\. {
            deny all;
            access_log off;
            log_not_found off;
        }
		
        location = /favicon.ico {
            log_not_found off;
            access_log off;
        }

        location = /robots.txt {
            allow all;
            log_not_found off;
            access_log off;
        }
		
        location /stats {
            index index.html index.php;
            auth_basic "Members Only";
            auth_basic_user_file /var/www/clients/client3/web9/.htpasswd_stats;
        }

        location ~ \.php$ {
            try_files $uri =404;
            include /etc/nginx/fastcgi_params;
            fastcgi_pass unix:/var/lib/php5-fpm/web9.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param PATH_INFO $fastcgi_script_name;
            fastcgi_intercept_errors on;
        }
	
         set_real_ip_from   204.93.240.0/24;
          set_real_ip_from   204.93.177.0/24;
          set_real_ip_from   199.27.128.0/21;
          set_real_ip_from   173.245.48.0/20;
          set_real_ip_from   103.22.200.0/22;
          set_real_ip_from   141.101.64.0/18;
          set_real_ip_from   108.162.192.0/18;
          real_ip_header     CF-Connecting-IP;
        client_max_body_size 28M;
        client_body_buffer_size 128k;
        
        if (!-e $request_filename) {
                rewrite  ^(.*)$  /index.php?q=$1  last;
                break;
            }
        #include /var/www/mysite.co.uk/web/nginx.conf;     	
}

Here's the php5-fpm pool conf for that site:

Code:
[web9]

listen = /var/lib/php5-fpm/web9.sock
listen.owner = web9
listen.group = client3
listen.mode = 0660

user = web9
group = client3

pm = dynamic
pm.max_children = 4
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 2

chdir = /

php_admin_value[open_basedir] = /var/www/clients/client3/web9/web:/var/www/clients/client3/web9/tmp:/var/www/mysite.co.uk/web:/srv/www/mysite.co.uk/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin
php_admin_value[session.save_path] = /var/www/clients/client3/web9/tmp
php_admin_value[upload_tmp_dir] = /var/www/clients/client3/web9/tmp

php_admin_value[date.timezone] = "UTC"
php_admin_value[post_max_size] = 28M
php_admin_value[session.gc_maxlifetime] = 604800
php_admin_value[upload_max_filesize] = 28M
php_admin_flag[display_errors] = off
php_admin_flag[display_startup_errors] = off
php_admin_flag[log_errors] = off
php_admin_flag[ignore_repeated_errors] = off
php_admin_flag[ignore_repeated_source] = off
php_admin_value[memory_limit] = 32M
That last line about memory limit is new, but made no difference either.

I had to make changes to /etc/php5/conf.d/suhosin.ini as advised by phpmyadmin, and also upped the memory limit for WP as I was getting
"ALERT - script tried to increase memory_limit to 268435456 bytes which is above the allowed value".

Code:
; configuration for php suhosin module
extension=suhosin.so
suhosin.executor.include.whitelist="phar"
suhosin.request.max_vars=2048
suhosin.post.max_vars=2048
suhosin.request.max_array_index_length=256
suhosin.post.max_array_index_length=256
suhosin.request.max_totalname_length=8192
suhosin.post.max_totalname_length=8192
suhosin.get.max_value_length=1024
suhosin.memory_limit=128M
I reduced the memory limit in wp-config.php as shown below.

Code:
define('WP_MEMORY_LIMIT', '32M');
define('WP_MAX_MEMORY_LIMIT', '32M');
Although, I've changed these limits from 256 to 128 to 64 to 32 and it makes NO difference to the front or back end speeds.

I changed the theme to default, turned off all the plugins, changed all the mysql tables to to innodb and followed the recommendations of mysqltuner (even though, as I said, there's nothing about slow mysql in the logs I can see).

I've tried changing php-fpm from socket to port and back, and so on and so forth. Not really sure what else to do now - can anyone spot anything here or advise?

And yes, I might be running a bit tight on memory, but then why does Zen Cart and phpbb running with a big DB load pages sub 200ms?
Reply With Quote
  #4  
Old 13th December 2011, 11:44
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,461
Thanks: 813
Thanked 5,240 Times in 4,108 Posts
Default

You posted here in a thread for ISPConfig 2. ISPConfig 2 is a different controlpanel software which uses apache as http server and the setup is completely different to your ispconfig 3 nginx setup. You might want to make a new thread in the ispconfig 3 forum for your problem instead.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 13th December 2011, 12:05
talkingnews talkingnews is offline
Member
 
Join Date: Jan 2011
Posts: 65
Thanks: 15
Thanked 5 Times in 5 Posts
 
Default

Thanks Till, sorry, I only searched and didn't spot the forum I was in.

I've not posted in http://www.howtoforge.com/forums/sho...506#post269506 so you can either delete my post above, or maybe change to be the link to the new post? Thanks!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ISPConfig 3.x - First Steps (Creating Web Sites, Email Addresses, Etc.) sighkick Suggest HOWTO 18 7th October 2010 00:12
Problems with wordpress on new server running ISPConfig 3 ashleykaryl General 9 28th July 2010 02:28
ispconfig wordpress and directory/file permissions willebanks Installation/Configuration 4 9th March 2010 21:52
wordpress u Amorphous Installation/Configuration 2 10th July 2009 10:00
wordpress MU and ISPconfig .htaccess isues palkat General 4 18th October 2006 11:57


All times are GMT +2. The time now is 14:31.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.