Vanilla 1.1.8 is a product of Lussumo. More Information: Documentation, Community Support.
Hi everyone!
I have a problem which I hope you can help with.
I've been having problems with Apache using up memory and also using up swap.
I have a 256MB slice, with Ubuntu 6.06 installed and use Apache 2 with php and mysql to run my Drupal website. I've read other discussions on this forum (found 2), and also did some reading on the Internet. I've tried to tune my Apache configuration and change maxClients, etc., which has helped to some degree but not much. In the end I've resorted to (for now anyway) restarting apache every few hours. Recently, I had around 90 visitors to my site at around the same time, which caused Apache to use swap, which in turn I was emailed about through Slicehost. (second time this has happened)
I'm worried that I'll have problems later on, if I have even a modest burst of traffic. I also previously thought I could run at least 2-3 websites on my slice, but it doesn't look possible right now.
So I had a couple of questions:
Thank you for you time in reading and replying to my questions.
The .htaccess rewrite is easily translated in to the nginx config. The config for nginx is just…
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 last;
}
You don’t have to remove apache and php, but I would recommend it. You’ll want to install nginx and php-cgi. I’m totally sure if Ubuntu 6.06 has a package for nginx. I know it’s available in 8.04. But you could build from source, if you’re feeling adventurous.
Cool. Let me know if you need any of my configs. There are some php=fcgi init scripts out there but most use lighttp’s spawn program, which you don’t need to use.
Soroush. Sorry I was not at my computer yesterday. I’m very glad you got nginx and php working. The 403 message is probably going to be the permissions on the phpmyadmin directory. Make sure the nginx user (e.g. www-data) has read access to the files.
FWIW, another option is lighttpd + php-fastcgi, which I’ve used for Drupal with success.
Basic config:
$HTTP["host"] == "www.yoursite.com" {
server.document-root = "/var/www/yoursite"
index-file.names = ("index.php")
fastcgi.server = (".php" => ((
"socket" => "/tmp/php-fastcgi.sock",
"bin-path" => "/usr/bin/php-cgi",
)))
}
Clean URLs can be implemented too. More info here.
server {
listen 80;
server_name site.com;
rewrite ^/(.*) http://www.site.com/$1 permanent;
}
server {
listen 80;
server_name www.site.com;
client_max_body_size 16m;
access_log /path/to/logs/access.log;
location / {
root /path/to/site;
index index.php;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 last;
}
}
# .php, .php3, .php4 and .php5 sent to php5
location ~ .*\.php[345]?$ {
include /etc/nginx/fcgi.conf;
fastcgi_pass 127.0.0.1:10005;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /path/to/site$fastcgi_script_name;
}
}
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
$ free -m
total used free shared buffers cached
Mem: 256 252 3 0 19 49
-/+ buffers/cache: 183 72
Swap: 511 0 511