Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I hired a sysadmin to set up a VPS server for me and, unfortunately, it looks like things were not set up correctly. When trying to install and update plugins, I run into permissions errors all the time. WP Super Cache is the main issue as it causing my readers to run into 502 errors. Currently, my site does not load pagination (no Page 2, Page 3, etc..).

12/1 Update: The apache server has restarted itself multiple times today and in the past 3 hours since my request to the host provider, all I've got so far is that they are monitoring it. And it has restarted since they began monitoring too...

The sysadmin that set up the server mentioned that in order for it to work properly under DSO mode, wp-admin, wp-content and wp-plugins folders would need to be changed to 777 permissions. The only problem is that I still couldn't get a 3.0.2 upgrade to work under those settings today (504 timeout nginx error this time) so I'm still concerned about running it that way for many reasons.

I've been told that if I run under PHP mode though (think that's right?), that I will hog up more RAM with queries, etc and I'm already at 60% usage in DSO mode. This doesn't make any sense to me because my blog ran a little slow but still ok without any downtime on shared hosting. I'm now on a very reputable VPS w/ 512MB ram and my site only gets 10-12k pageviews a day.

The host said that they have tweaked the config to optimize ram so I don't think anything is set incorrectly. Still trying to figure out what is going on here.

Developing.....

share|improve this question
    
Updated: seem to have fixed the WP Super Cache errors for now and can now view my whole site again. Still, it's a valid question albeit a loaded one. –  Adam Nov 30 '10 at 4:31

4 Answers 4

up vote 5 down vote accepted

It's a very loaded question, I'll try my best here, keep in mind it's 4am, so I'm just giving you highlights, not detailed explanations.

Linux I'm assuming you're using a recent version of Ubuntu

  1. Change the default SSH port from 22, to something else (/etc/ssh/sshd_config).
  2. Either enable AllowGroups or AllowUser in the sshd_config,
  3. Install fail2ban (apt-get install fail2ban)
  4. Install apache2, php5, and mysql-server
  5. Edit /etc/apache2/conf.d/security.conf and make appropriate changes for a production server.
  6. Disable the slow query log in MySQL (you don't want this on in production, especially on a VPS)
  7. Configure your system timezone (dpkg-reconfigure tzdata)
  8. Make sure your php.ini reflects the same time zone
  9. Add a new virtualhost in /etc/apache2/sites-available/ (leave the default one alone)
    1. Enable this virtual host by: a2ensite nameofnewvhostfile
    2. Enable mod-rewrite (a2enmod rewrite)
    3. Restart apache2 /etc/init.d/apache2 restart

You can do some other things as well, like install Shorewall, or UFW for better firewall management, install Nginx as a reverse proxy to apache, tweaking the query cache, but this really depends on a whole bunch of other things, and you should tweak mysql settings after being in production mode for a few days.

share|improve this answer
    
DSO mode was horrendous but it has been virtually 100% smooth sailing since we switched to suphp. I've been quite happy with the level of managed VPS support from Knownhost. –  Adam Jan 26 '11 at 1:42
1  
Changing the SSH port is not necessary if you are using a strong form of authentication such as certificates. The only benefit is cutting out the number of drive by attempts that will show up in your logs. It doesn't make the server more secure, just more obscure. –  dunxd Feb 16 '11 at 9:59

At the risk of not answering the question (which Vid did quite well), may I suggest that you switch to a VPS host that offers to do the system administration for you (usually at no charge).

I'm thinking of http://hub.org specifically. Marc (the guy who runs it, and one of the original four who created PostgreSQL) is the best system admin I've ever come across.

Hub's control panel (it's not CPanel) is being redone as I'm writing this; its merit is to feature only what end users are supposed to be worrying about. The rest, in essence, is subject to opening a support ticket and requesting that it be taken care of. (Of course, you can do whatever you feel like it as root if you know your way around the shell...)

Oh, and... I should mention that Marc is the kind of guy who actually digs into your scripts and points the bug out if he suspects that is what is triggering server issues. I know of no other host who does that...

share|improve this answer
    
As far as I know there is usually considerable difference in price between managed and unmanaged VPS/dedicated/whatever. So it's hardly "no charge". I do agree that managed hosting makes life easier. :) –  Rarst Nov 30 '10 at 10:33
    
Indeed. Which is why I'm highly recommending Marc's hub.org. You essentially get a managed VPS for the price of an unmanaged one. The only time I've seen him charge for his time was when I asked him to pull out a bunch of tasks that were clearly out of scope. –  Denis de Bernardy Nov 30 '10 at 17:37

Some Ideas:

I don't like WP-Super-Cache because it does not really solve the problem of slow dynamic page generation times.

If you have a dedicated server only for wordpress I would not make any compromises:

nginx+php-fpm (you can also use Apache with fcgid and suexec (this also solves most of the permission problems)

Install the APC opcode cache

Use the apc cache backend: http://wordpress.org/extend/plugins/apc/

Install batcache for a page-cache it will use the apc backend. . Configure the MySQL query cache and take a look the key_buffer value if you are using MyISAM tables or the innodb_buffer_pool_size. If you are having a lot of comments/updates to your blog consider using InnoDB as a storage engine.

On a heavy used VPS I have about 150ms page generation time for dynamic pages (not cached before) and if batcache delivers the page it is only 1ms. So you can serve up to 200-300req/s with a "normal" VPS.

share|improve this answer

When trying to install and update plugins, I run into permissions errors all the time.

This is a common problem when running PHP as a DSO or mod_php. When running this setup the WordPress files must be owned by the same user PHP is running under. Usually it will be nobody or for Debian / Ubuntu www-data.

To fix chown the whole WordPress directory by running the following from the command line:

$ chown nobody:nobody blog/ -R

If WordPress is installed in your root public directory then it would be:

$ chown nobody:nobody public_html/ -R

You can set your file permissions at 644 and directories at 755

share|improve this answer
    
Chris, I would recommend you install the itk mpm, and then use AssignUserId username groupname (apt-get install apache2-mpm-itk) this makes it so that you don't need to change ownership of things when you FTP in etc. –  Vid Luther Dec 1 '10 at 2:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.