This is the new home for the quite popular nWeb script (formerly Ubinscripts). In the occasion of the new site I have rewritten more or less the whole script, making it more up to date and usable. It now also supports Debian Lenny.
What is it?
What it does is installing the lightweight Nginx web server with PHP support and MySQL. It’s intended for administrators who is repeating the task of setting up servers. This scripts allow you to install and configure a basic web server with almost no interaction (it only asks for a MySQL server root password at the very end).
Note: This script is not intended to be a replacement of learning how to do this yourself, but more as an time saver.
Requirements
The new version is officially tested, working and supported on fresh installs of the following platforms
- Ubuntu 9.04 (Jaunty Jackalope)
- Ubuntu 8.10 (Intrepid Ibex)
- Debian 5.0 (Lenny)
but should also work with most newer Debian / Ubuntu derivatives.
Installation
wget http://thehook.eu/downloads/nweb150.tgz tar xzvf nweb150.tgz cd nweb sudo sh nweb.sh
Notes
This script is not suited for use on small embedded systems.
after this install script, when changing php.ini settings, how should I restart fastcgi to have changes work? or it needs whole server to restart?
No you don’t need a complete server reboot. But I rewrote the whole script a couple weeks ago, and then I did not make a start/stop script for spawn-fcgi. I will add this in the next release, and write a post on how to add it later.
Until then you can use the following command as root to stop php
And start it again with the following command (same as found in /etc/rc.local)
Thanks fort this great work , I tried it on one of my servers. works like a charm
Don’t try this on small embedded systems, it brings in tonnes of dependancies, and needs to compile stuff…
Not great. Should have said that. It killed my Sheevaplug by filling it with crap. Had to reinstall from fresh.
nginx is a lightweight server, but this does not suit the application.
Yeah, I’ll make a note of that.
This script was never intended for use on such embedded systems, but rather on VPS’ with limited resources.
This script will only assist you in installing the nginx web server and set it up using PHP and MySQL. Unfortunately it also requires to compile the spawn-fcgi as there are no separate package for that.
Yeah it works well, i just modified this script to make it less bloated, removed the mysql part and some php-extensions that you dont really need.. Made it ALOT smaller, works liek a charm tho!
That sounds good! I am wondering of writing a new version soon, and would really like some help with the changes you want to be done.
One of my goals with the script is making it very easy for the user without being too bloated. Since you want have a LEMP server without MySQL I cannot remove that part, but I would like some feedback on which extensions are most used and which is not.
I will also add make the newer versions install phpmyadmin, maybe optionally with an parameter or something?
I used your script, works like a charm, however when using proxy_cache I get an “unknown directive “proxy_cache”. Is there another step during installation to get caching to work?
proxy_buffering on;
proxy_cache /var/cache/nginx.cache levels=1:2 keys_zone=one:10m;
#proxy_buffers 8 16k;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k;
proxy_set_header Cache_Control: max-age=7776000;
5 minutes after downloading your script I had what appears to be a perfectly running LNMP server on my Karmic Koala AMD64 laptop.
The only error in the error.log refers to a duplicate MIME declaration: “2009/11/06 15:05:25 [warn] 16831#0: duplicate MIME type “text/html” in /etc/nginx/nginx.conf:28″
Now for phpMyadmin and Drupal 7… I shall let you know.
Thanks for a great script for busy people…
hello
script modified
http://demo.ovh.pl/download/1f1c2b81a8f887d0c371c44685b1dd59/nweb.tgz
ajout script start/stop php in init.d and startboot
remove start php rc.local
tested on debian lenny
thank for the script
Thank you, I will look into it soon
What is the license on this script? GPL/BSD?
Not so long ago I decided to put a GPLv2 license on the project, and I also made a Google Code project of it that you can find on http://code.google.com/p/nwebscript/
Unfortunately I have not got to edit this page yet to reflect it as I have been very busy lately.
My main goal is to make it as easy for everyone to participate and develop it further.
hi
thanks for this script… i used it on jaunty
it finished ok.. html files work ok… i tried a sample info.php and get an empty screen (meaning nothing happens and no error msg) i can follow instructions but i do not have enough skills to troubleshoot. i really do NOT want to use lamp and so on. my first goal is to make a localhost environment to learn more … thanks for putting effort into this project.
ok… i copied this from another website…
i changed mine according to the below
if i use 127.0.0.1 instead of localhost the info.php works
http://chrisjohnston.org/2009/setting-up-a-lemp-stack-ubuntu-904
Hello cJ,
I have one remark. I used your installation guide, which words great but i have made one minor alteration:
file /etc/default/php-fastcgi
>FCGI_HOST=localhost
Change this to FCGI_HOST=127.0.0.1 when php-fastcgi fails to run/start.
Thanks
Thanks again
Hi, will it work smoothly on a server with 256mb RAM?
Bonjour !
merci pour ce script qui m’a bien aidé a installer WordPress par la suite malgré quelques petites erreurs (spwawn-fcgi on line 108 is funny ^^ – entre autre -) dans le script, que j’ai moi-même modifié pour mes besoins.
c’est du bon boulot ^^
Bye !
Great work man!
But, “This script is not suited for use on small embedded systems.”.
You can be more specifc ?
Thanks!
I have never had any problems running it, but Mark commented above that his Sheevaplug couldn’t handle it.
The smallest system i have ran it on was a first generation eeePC, and it is still running today as a web-, print-, and fileserver with nginx as a base.
Thanks for taking the time to compile this script. I wanted to try nginx but the lack of native support for PHP and the whole compiling and configuring spawn-fcgi is a bit much for me right now.
Thanks to you I can skip all that nasty stuff and jump straight to trying nginx out.
[...] kann mit dem “nWeb” Bash Script PHP & MySQL automatisch installiert und für den Nginx konfiguriert [...]
Hi, thanks for your effort! One question: why do you compile spawn-fcgi and do not use packages provided with the distros? Are there any problems with the spawn-fdgi packages that come with debian / ubuntu? Thanks!
Thanks for your feedback! The main reason has been to remain backward compatible, spawn-fcgi is now split apart from lighttpd and only the newest version(s) of Ubuntu has a package for spawn-fcgi.
Don’t hesitate to give me feedback / suggestions for the next version, it’s been a long time and probably will be some more but I’m expecting to update/rewrite the script sometime towards the summer.
suggest make php-fastcgi as a service item, so we can start,stop and restart by ourself.
below is the file: /etc/init.d/php-fastcig used in my 512M memory VPS:
“PATH=/sbin:/bin:/usr/sbin:/usr/bin
case “$1″ in
start)
# Start.
echo -n “Starting $DESC: … ”
/usr/local/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 8 -u www-data -g www-data -f “/usr/bin/php5-cgi -d /var/www”
echo “done”
;;
stop)
# Stop.
echo -n “Shutting down $DESC: … ”
killall -9 php5-cgi
echo “done”
;;
restart)
# Restart.
$0 stop
sleep 1
$0 start
;;
*)
echo “Usage: php5-fastcgi {start|stop|restart}”
exit 1
;;
esac
exit 0 “
Thank you very much for the script.
I wanted to know if the tasks can be done selectively. Like, is it possible to just install nginx and php and configure nginx for php. And may be at a later stage I could install MySql and FastCGI. Can the script be easily modified to do that?
Regards,
Srirang
(Brahmana)
Worked great on 9.10. Can you update the script for Ubuntu 10.04 now that it’s out?
Hi David,
the script is working on 10.04 as well using the -nocheck attribute..
I will release a new version at the end of the summer I hope, but I am really busy with a lot of other projects right now..
Everyone is free to help develop the script, so if someone have time to look into it I will upload the changes
Интересно. Подпишусь-ка я на РСС пожалуй.