ServerWizard
03-13-2007, 04:49 AM
I was getting a bit annoyed with apache and the amount of ram it was using on my 256mb VPS so decided to remove it and heres what I did to make my VPS fly :)
Firstly remove apache:
yum remove httpd
It will ask you to remove php also, you need todo this so choose yes.
Then, We need to install lighttpd:
yum install lighttpd lighttpd-mod_mysql_vhost lighttpd-fastcgi
To start lighttpd:
/etc/rc.d/init.d/lighttpd start
Now try pull up your website or Ip address, it should now greet you with the default lighttpd page.
If this has worked we now need to install PHP so:
cd /tmp
wget http://uk2.php.net/get/php-4.4.6.tar.gz/from/uk.php.net/mirror
tar zxvf php-4.4.6.tar.gz
cd php-4.4.6
./configure --enable-fastcgi --enable-discard-path --enable-force-redirect --with-gd --with-gettext=/usr --enable-safe-mode --with-exec-dir=/usr/bin --with-zlib --enable-magic-quotes --with-regex=system --with-ttf --with-db --enable-mbstring --enable-mbstr-enc-trans --enable-track-vars --enable-wddx=shared --enable-mm=shared --enable-xml --enable-ftp --disable-debug --with-libdir=/usr/lib
make
make install
Run the above commands in the above order too install PHP 4.4.6
Now you need to find the following in /etc/lighttpd/lighttpd.conf:
#fastcgi.server = ( ".php" =>
# ( "localhost" =>
# (
# "socket" => "/tmp/php-fastcgi.socket",
# "bin-path" => "/usr/local/bin/php-cgi"
# )
# )
# )
Change it to look like this:
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/tmp/php-fastcgi.socket",
"bin-path" => "/usr/local/bin/php"
)
)
)
Also make sure that mod_fastcgi is uncommented also.
Now restart lighttpd:
/etc/rc.d/init.d/lighttpd restart
now to test cd to:
cd /srv/www/lighttpd/
Create a file called info.php with the following:
<?php
phpinfo();
?>
Save and visit: http://yourip.com/info.php
That's it you've replaced apache :)
Firstly remove apache:
yum remove httpd
It will ask you to remove php also, you need todo this so choose yes.
Then, We need to install lighttpd:
yum install lighttpd lighttpd-mod_mysql_vhost lighttpd-fastcgi
To start lighttpd:
/etc/rc.d/init.d/lighttpd start
Now try pull up your website or Ip address, it should now greet you with the default lighttpd page.
If this has worked we now need to install PHP so:
cd /tmp
wget http://uk2.php.net/get/php-4.4.6.tar.gz/from/uk.php.net/mirror
tar zxvf php-4.4.6.tar.gz
cd php-4.4.6
./configure --enable-fastcgi --enable-discard-path --enable-force-redirect --with-gd --with-gettext=/usr --enable-safe-mode --with-exec-dir=/usr/bin --with-zlib --enable-magic-quotes --with-regex=system --with-ttf --with-db --enable-mbstring --enable-mbstr-enc-trans --enable-track-vars --enable-wddx=shared --enable-mm=shared --enable-xml --enable-ftp --disable-debug --with-libdir=/usr/lib
make
make install
Run the above commands in the above order too install PHP 4.4.6
Now you need to find the following in /etc/lighttpd/lighttpd.conf:
#fastcgi.server = ( ".php" =>
# ( "localhost" =>
# (
# "socket" => "/tmp/php-fastcgi.socket",
# "bin-path" => "/usr/local/bin/php-cgi"
# )
# )
# )
Change it to look like this:
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/tmp/php-fastcgi.socket",
"bin-path" => "/usr/local/bin/php"
)
)
)
Also make sure that mod_fastcgi is uncommented also.
Now restart lighttpd:
/etc/rc.d/init.d/lighttpd restart
now to test cd to:
cd /srv/www/lighttpd/
Create a file called info.php with the following:
<?php
phpinfo();
?>
Save and visit: http://yourip.com/info.php
That's it you've replaced apache :)
