Wordpress Install on Litespeed

#1
I know this must be really easy, and that is why prolly there aren't any howto's out there, but It's one of my stupid spells, so I'm really stumped.

Is there a howto out there that i can use? I had Wordpress installed and working with apache 1.3 on a debian sarge box. I saw the litespeed announcement on the Rubyon rails forum, and 30 minutes later, I had a working RoR app moved!

Brilliant I says! Now I completely want to get rid of Apache, but I've been struggling with it almost all day and can't google it to save my life.

I have looked at the wiki. And it says create an external app and then create a handler. Well how do i do that? I ran an apimport.sh and it barfed my suexec vh templates.

I know I shouldn't have treated Litespeed as a toy, but all I want to do is get my wordpress blog running..

Can someone please give me some info on what steps I need to take? I'm at the end of my rope here.

thanks much,

Amr
 
#3
Thanks!

Thanks so much for the pointer,I didn't realize I could look at the ocnfiguration parameters. I will try that today.

Cheers!

-Amr
 
#4
Amr,

You can take a look at the configuration of our demo Wordpress site.
http://www.litespeedtech.com/products/webserver/demo/

No need to run apimport.sh now, just let LSWS use Apache httpd.conf directly.
http://www.litespeedtech.com/docs/webserver/config/general/#loadApacheConf
hrrrrummmm... I took off my rant.. these two things didn't work. Does anyone else know how I can get a wordpress install to work with litespeed? like a general a,b,c,d guide?

I'm not looking for handholding, just a couple helpful hints in terms of general steps would really help.

Thanks

amr
 
Last edited:

xing

LiteSpeed Staff
#5
The only thing you need to config for wordpress is an PHP external application and binding that application to a script suffix .php.

Since you have had a tough time trying to use an apache config? Just try the easy route of running wordpress via a native litespeed config.

1) http://www.litespeedtech.com/products/webserver/demo/

View admin gui.

2) Your litespeed server should already have a php 4.4.4 external application and have it bound to .php. If not, copy the demo admin.

3) Create a LiteSpeed vhost and install wordpress there.

4) Check /logs/error.log and stderr.log for any php errors.

Check documentation for wordpress specific config files:

http://codex.wordpress.org/Installing_WordPress
 
Last edited:
#6
The only thing you need to config for wordpress is an PHP external application and binding that application to a script suffix .php.

Since you have had a tough time trying to use an apache config? Just try the easy route of running wordpress via a native litespeed config.

1) http://www.litespeedtech.com/products/webserver/demo/

View admin gui.

2) Your litespeed server should already have a php 4.4.4 external application and have it bound to .php. If not, copy the demo admin.

3) Create a LiteSpeed vhost and install wordpress there.

4) Check /logs/error.log and stderr.log for any php errors.

Check documentation for wordpress specific config files:

http://codex.wordpress.org/Installing_WordPress
thanks for responding Xing, first I'll describe my setup, then I will address the numbered points you have mentioned.

This is mysetup:

ip1.187 -> blogdomain.com
ip2.186 -> railsdomain.com

I have the dns setup and resolving to the above domains (ips are on same physical box).

I did a clean install of litespeed 2.2
Followed the wiki document: http://www.litespeedtech.com/support/wiki/doku.php?id=litespeed_wiki:ruby_rails_easy

this works fine, I can get to my rails app on railsdomain.com (on port 3000 btw)

Now, I'm trying to use the PHPsuExec to get my wordpress going.

my wordpress is supposed to run off of the ip1.187 (blogdomain.com). I have the wordpress files in /var/www/ and this is where apache is reading them from.

I want to use the PHPsuExec to get my blog to run, is that the right way?

Now regarding your points here are my comments:

1. I don't know which gui you are talking about, the one you guys have posted twice now has NO php setup. When I login to that gui, this is what I see under the virtual hosts:
PHP/Perl/Java/Python Demo
PhpMyAdmin
RubyDemo

Notice the first VHost says "PHP" ?? well, take a look at the general tab. There is NOTHING to follow there. There is only, perl/java/python ScriptHandler definitions. Can you please take a look and let me know what I'm missing there? I think I am, i just don't know what. should there not be a php handler there?

2. my ls2.2 install does have a LSAPI app external app setup. yes. what to do with it? how does this know where to go look for my blog? My guess is that it is done in the context tab? is this true?

3. why can't I just point the VHOST to the wordpress install I already got?

btw, if google can't find me stuff from the socalled wordpress codex, I don't know if I can do much better trudging through it.

WP doc recommends LITESPEED, but no one can tell me exactly how to do it.
apparently it is so obvious, that no-one has been bothered to actually document it. It is like the Fermat's last theorem. He thought it was so obvious, he couldn't justify wasting precious paper for it. The mathematicials
pissed around for 300 years to prove it.

but I digress.

also, please don't be offended, if this is how long it takes for cutomers to understand what you're talking about, there is a serious documentation problem.

I would urge you to try to do a wordpress install and pleast post _that_ config. The page you pointed me to has a demo install, but that is probably NOT the isntall that the wordpress demo blog is running under (for obvious reasons). (the wordpress blog demo is using php5 i think?)

maybe you can post that blog's config .xml file.. or just tell me what I'm doing wrong here?

something is not right here.. I shouldn't have to go through this much stuff to setup PHP.. there is something NOT RIGHT with the documentation.

now about the very first statement you made.

The only thing you need to config for wordpress is an PHP external application and binding that application to a script suffix .php.
so now, tell me this, I got a PHP_suEXEC, it has an lsapi php installed. I did the lsws/fcgi-bin/lsphp -v and it tells me its version 4.4.4 (litespeed) and all that good stuff. How do i "bind" this "application" to a script suffix? and WHERE do I do that? i mean which tab??

I tried running it with the CGI context and it crapped out. do i create an fcgi context handler. I'm sure it is clear as day to you, but believe me, I'm very very frustrated with this and I'm usually pretty okay following docs.

if you have read through this rant, let me know where I'm going off the tracks here..

when I get this SOB working, I'll sure submit a howto. NOTHING should be this convoluted and counter-intuitive. I don't care how cool and fast the guts are.

thanks so much,

Amr
 
#7
quick update, looked at the admin gui (context tab) again, and there is /php/ static handler there, so I copied that, and added index.php under the general tab. At this point, after graceful restart, I can see a wordpress error page.

this tells me now I'm getting the PHP executed, but now it says it can't connect to the database. I had the apache running under user www-data etc. LiteSpeed runs under nobody/nogroup. Do you think it could be this?

I checked commandline mysql and the database is fine the password is fine and the tables are there. no changes to wp-config.php were made and the user/pass are the same pointing to the "localhost" do I need to give it the IP (ip2.187 for my blogdomain.com) ?? it should be fine without it..

sorry for the rants, its getting late in the evening I suppose.

-Amr
 

xing

LiteSpeed Staff
#8
Amr,

No problem. We're here to help. I think this is the classic problem of "what've got here...is a failure to communicate." Can't help the guns-n-roses quote.

1) We need to make an distinction between the way PHP scripts work and how Ruby on Rails work. A Rail app is an request router which can take in ALL requests. PHP scripts are just files that individually executed by an script handler. So don't think about Rails when configuring php. Two different beast.

2) http://www.litespeedtech.com/products/webserver/demo/

Login. Go to "Server -> External Apps" and "Server -> Script Handler". You will see that PHP is configured at the "Server" level and the php executable is bound to execute all files ending with .php.

You should also see this in your own local lsws 2.2 setup. PHP 4.4.4 with LSAPI is preconfigured for you.

3) To install WordPress, just copy over the files to a VHOST docroot of your choice. You don't have to create a new one or create any "external app"s under that vhost. The PHP script handler is already defined at Server level so it applies to all vhosts.

4) Setup suEXEC.

http://www.litespeedtech.com/support/wiki/doku.php?id=litespeed_wiki:cgi_fcgi_lsapi_php_suexec

Refer to above wiki. In summary, click on the "Virtual Hosts" link at the left menu of your local lsws web admin. Yes, the "Virtual Hosts" label is a link though not too obvious. We will fix this in our 3.0 release where the UI is going to be revampeld. Now that you are in "Vritual Hosts", edit the one that host your wordpress files and set "CGI Set UID Mode” to “Docroot UID”. Even though it's labeled "CGI...", it actually applies to all external applications/scripts. We'll fix the misnomer in the 2.2.1 release.

5) Restart and your're done. =)
 
Last edited:
#9
Hey Xing, thanks for hanging in there, really appreciate it. This is incredible customer support!

I tried this, and now I think things are much clearer after your excellent explanation. To paraphrase the big lebowski, "My thinking had become all uptight ..." regarding this whole thing .. Thanks for explaining it.

Well, now I'm still getting the db login error, but I think I understand the process much better as to what is happening, so I'm not freakign out as much. I think my error is because my server is installed under nobody/nogroup. Apache was running under www-data/www-data.

"Error establishing a data connection"

maybe this is not a question for you, but does this ring a bell at all? should I try re-installing lsws under www-data to see if it will get over the mysql problem.

again, thanks so much for your patience, and all the help, that is totally cool!

-Amr
 

xing

LiteSpeed Staff
#10
If you are getting mysql error on the php pages, that means at least everything is "almost" working. =) Thankfully, mysql error has little to do with litespeed.

Since you mentioned that you didn't change the mysql server or config files for wordpress, and it was working before the move to litespeed, I'm a bit stumped.

Finding out the exact mysql error code is the next step. Are you getting authentication error or can't connect to mysql error? PHP should spit those out to the error logs at logs/stderr.log or logs/error.log under the lsws install.

Check wordpress config to see if your connection mysql through TCP or UNIX domain socket. If it is the later, PHP and the user running it, must have permission for that socket file location.

I would just double check the user/password combo for mysql in the wordpress file by going "mysql -umyuser -pmypassword" and see if you connect.

Reinstalling lsws wouldn't help since this is no longer a lsws issue but a php/mysql config one.
 

mistwang

LiteSpeed Staff
#11
Amr,

I think to build your own lsphp binary is more likely fix the problem.
The MySQL client in the pre-built lsphp binary does not compatible with the new authentication method used by MySQL 4.1 and above. If you are using MySQL 4.1+, you definitely should rebuild you own lsphp binary.
 
#12
thank you both kind sirs, I will follow your sage advices, and see where that takes me. eventually I think I'm looking at a recompile because everything else has stayed exactly the same and I can use mysql to connect from commandline.. (unless it is the way i'm defining the VHost which shouldn't really effect php->mysql interactions. The only new variable here is the precompiled lsphp.

thnaks! I'll post back my progress, and definitely a howto with screen shots.. so other litespeed noobs don't have to go through this pain (of their own creation mostly)

-Amr
 
#13
Bingo!!!!!!!!!!

Amr,

I think to build your own lsphp binary is more likely fix the problem.
The MySQL client in the pre-built lsphp binary does not compatible with the new authentication method used by MySQL 4.1 and above. If you are using MySQL 4.1+, you definitely should rebuild you own lsphp binary.

BINGO!!

this worked! i got my wordpress working.. yay! :)

thanks to both you and xing! for helpful hints. I'm going to document it and submit it back as a howto or something.

I used your wiki php guide (in the sticki post) to compile the php, but used 4.4.4 instead of 5.1.x as is described. also, compiled the 2.2 version of the lsapi instead of 2.1 which the wiki entry talks about.

the secret was to not get too complicated in my own thinking.. litespeed already does everything.. just don't confuse litespeed rails setup with a simple php + wordpress setup.

Thanks Xing!
Thanks mistwang!

you guys are awesome!

-Amr
 
#14
Quick Start Guide

great thread... almost exactly what I need. Is there a quick start guide anywhere?

I'm specifically looking to do a clean install of litespeed and wordpress mu on an intel box. Soo glad I found this post...
 
Top