Lots of questions!

ngix proxy and apache, is this easy to setup? Is this a "Preferred" method? Not sure why people hate apache that much, or why most servers focus on using MPM, where PHP says in it's readme, do NOT use MPM (with ISAPI I believe..)

Failover .. what's the best way to do this for file structure (svn?), mysql (replication option in mysql?), and routing (heartbeat?).. with two ips since the servers will be located several hundred miles apart.

Can I setup a entire webserver/mailserver/database through a jailed user? Is there a major performance hit when doing it this way?

The last thing.. is how do I get Qmail to mirror the same version used in parallels plesk 9? I could not find this anywhere.. I assume maybe.. if I got a parallels' trial, then copied it.. no idea.

4 Replies

@superfastcars:

ngix proxy and apache, is this easy to setup? Is this a "Preferred" method? Not sure why people hate apache that much, or why most servers focus on using MPM, where PHP says in it's readme, do NOT use MPM (with ISAPI I believe..)

… which MPM?

The problem with PHP, or at least Apache with mod_php, is that it is not safe in multi-threaded situations. This means that you are stuck with one simultaneous request per process. This isn't a huge deal, except there might be requests that don't need PHP processing (like images, stylesheets, static HTML pages, etc) but the web server doesn't know that until it has already dispatched the connection to a handler.

> Failover .. what's the best way to do this for file structure (svn?), mysql (replication option in mysql?), and routing (heartbeat?).. with two ips since the servers will be located several hundred miles apart.

It depends a lot on your application. If you can enforce a good split between application and data, life will be a lot better. How easy it is to do this also depends on how write-intensive your application is.

> Can I setup a entire webserver/mailserver/database through a jailed user? Is there a major performance hit when doing it this way?

chroot() is just one more syscall. It's not a performance hit as much as it is a significant burden to get going. Some packages in some distributions make it easier than others.

> The last thing.. is how do I get Qmail to mirror the same version used in parallels plesk 9? I could not find this anywhere.. I assume maybe.. if I got a parallels' trial, then copied it.. no idea.

… people still use qmail?! Woah.

Ummm… well, why do you need that exact MTA? Much of the world has moved on since the turn of the century. (But people still use sendmail to this day; your kink is OK, I suppose.)

@hoopycat:

@superfastcars:

Is ngix proxy and apache backend a good setup? and what is the deal with PHP saying MPM is bad? … which MPM?

The problem with PHP, or at least Apache with mod_php, is that it is not safe in multi-threaded situations. This means that you are stuck with one simultaneous request per process. This isn't a huge deal, except there might be requests that don't need PHP processing (like images, stylesheets, static HTML pages, etc) but the web server doesn't know that until it has already dispatched the connection to a handler. Okay, I'm talking about this from the php.net site.. which says in linux environments, MPM is not "thread safe". I ran "httpd -l" and got this;

Compiled in modules:

core.c

prefork.c

http_core.c

mod_so.c

So it sounds like I'm using PHP5 in a CGI, and if I want ISAPI, it will require installing from source.. which I'd prefer, but I'm using CentOS cause my job uses it.. and CentOS is pro-rpm! However! My point is.. since I use CGI, I shouldn't need to worry about MPM, moot point.. but the other question about setting up a ngix proxy being a good idea for high number of requests??@hoopycat:

@superfastcars:

Failover; file structure (svn?), mysql (replication option in mysql?), and routing (heartbeat?).. It depends a lot on your application. If you can enforce a good split between application and data, life will be a lot better. How easy it is to do this also depends on how write-intensive your application is. I write my own applications, and I could easily write in my own api with fallback for inserting/retrieving data from two locations.. however, I want the replication to be both seamless, and transparent.. I do realize that there is a likelyhood of a mismatch.. I guess my real question here, is what is the best way? I've never done a failback before.. :P I purchased 2 years of hosting with linode after doing 2 weeks of research on what VPS. And I was a bit horrified after (1) month my VPS was down for 3-4 hours. So.. this is why I'm now very interested in failback technology. But I'm not spending anything till I can verify failover works.

@hoopycat:

@superfastcars:

Jailed user for apache/ngix, mysql, and Qmail causing performance issues and/or difficult? chroot() is just one more syscall. It's not a performance hit as much as it is a significant burden to get going. Some packages in some distributions make it easier than others. So your saying.. it can work, but it might not work well depending on each application? That makes alot of sense, and I can probably look to find jail-friendly apps in the mean time to see if it's even worth it really. I want to use my router as a failover, but I don't want to leave it completely open, that's why I ask about jailed environments.

@hoopycat:

@superfastcars:

Best way to replicate Qmail from the latest version of Plesk 9?

… people still use qmail?! Woah.

Ummm… well, why do you need that exact MTA? Much of the world has moved on since the turn of the century. (But people still use sendmail to this day; your kink is OK, I suppose.) I got a VPS specifically to learn more about linux, and web hosting technologies. I personally think that Citadel is designed for newbies, Exim/Postfix are more accepted/updated/mainstream, and Qmail is crap. I want to use Qmail because Plesk 9 uses it.. and where I work we use Plesk.

@superfastcars:

Okay, I'm talking about this from the php.net site.. which says in linux environments, MPM is not "thread safe". I ran "httpd -l" and got this;

Compiled in modules:

core.c

prefork.c

http_core.c

mod_so.c

So it sounds like I'm using PHP5 in a CGI, and if I want ISAPI, it will require installing from source.. which I'd prefer, but I'm using CentOS cause my job uses it.. and CentOS is pro-rpm! However! My point is.. since I use CGI, I shouldn't need to worry about MPM, moot point.. but the other question about setting up a ngix proxy being a good idea for high number of requests??

They are specifically referring to threaded MPMs, specifically not mpm-prefork. If you're using mpm-prefork, you will be OK, because it won't run into PHP's shortcomings.

I don't know enough about CentOS to give specific recommendations, but I generally avoid premature optimization. Outside of a few specific cases (like adjusting MaxClients in apache's configuration), it's difficult to know what problems you're going to have before you have them. Best to dive in and get started.

> I write my own applications, and I could easily write in my own api with fallback for inserting/retrieving data from two locations.. however, I want the replication to be both seamless, and transparent.. I do realize that there is a likelyhood of a mismatch.. I guess my real question here, is what is the best way? I've never done a failback before.. :P I purchased 2 years of hosting with linode after doing 2 weeks of research on what VPS. And I was a bit horrified after (1) month my VPS was down for 3-4 hours. So.. this is why I'm now very interested in failback technology. But I'm not spending anything till I can verify failover works.

Everything I know about MySQL replication I learned from MySQL High Availability… it is a pretty good read on the techniques and tools of replication in MySQL.

My other secret tool is Chef. MySQL will keep your data synchronized between locations (you DO store all of your data in your database, right?), and Chef will keep your configuration and operational state synchronized among your servers. SVN or git are excellent for keeping your code straight, too.

(There are things other than Chef, too, like Puppet… we just use Chef because we use Chef. Anything is better than nothing.)

The other problem is how to direct traffic to the right location. Multiple A records in the DNS will do the trick, but it doesn't automagically withdraw the downed site when it goes away. You can either wing something yourself (the Linode API can help with this), or go with something like DNS Made Easy.

> So your saying.. it can work, but it might not work well depending on each application? That makes alot of sense, and I can probably look to find jail-friendly apps in the mean time to see if it's even worth it really. I want to use my router as a failover, but I don't want to leave it completely open, that's why I ask about jailed environments.

A chroot jail only limits the damage after a security breach, and arguably not that much. Not my first choice of ways to spend my securing time :-)

> I got a VPS specifically to learn more about linux, and web hosting technologies. I personally think that Citadel is designed for newbies, Exim/Postfix are more accepted/updated/mainstream, and Qmail is crap. I want to use Qmail because Plesk 9 uses it.. and where I work we use Plesk.

Best of luck to thee!

I personally use Exim for most servers (the ones that just need to send mail out), Postfix for more robust needs, and Google Apps (or sometimes just Gmail) for receiving mail. This seems a decent combo.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct