| [FORK] Nginx, Nginx-proxy and Lighttpd-proxy [message #95665] |
Thu, 01 March 2012 12:12  |
|
Discussion about Kloxo-MR already move to forum.mratwork.com.
This thread closed. Continue to http://forum.lxcenter.org/index.php?t=msg&th=18842
Related to http://forum.lxcenter.org/index.php?t=msg&th=18021
Install to production system is your own risk.
Already on github as fork by me.
How to install this version: --> not accurate info; go to http://forum.lxcenter.org/index.php?t=msg&goto=98906
1. Make Kloxo pack
cd /
# update centos to latest version
yum update -y
# install some packages like package-cleanup, etc
yum install yum-utils yum-priorities vim-minimal subversion curl zip unzip -y
yum install telnet -y
setenforce 0
echo 'SELINUX=disabled' > /etc/selinux/config
# create custom repo
echo '[kloxo-centalt]' > /etc/yum.repos.d/kloxo-custom.repo
echo 'name=kloxo-centalt - $basearch' >> /etc/yum.repos.d/kloxo-custom.repo
echo 'baseurl=http://centos.alt.ru/repository/centos/5/$basearch/' >> /etc/yum.repos.d/kloxo-custom.repo
echo 'enabled=1' >> /etc/yum.repos.d/kloxo-custom.repo
echo 'gpgcheck=0' >> /etc/yum.repos.d/kloxo-custom.repo
echo 'includepkgs=nginx mod_rpaf' >> /etc/yum.repos.d/kloxo-custom.repo
echo ' ' >> /etc/yum.repos.d/kloxo-custom.repo
echo '[kloxo-rpmforge]' >> /etc/yum.repos.d/kloxo-custom.repo
echo 'name=kloxo-rpmforge - $basearch' >> /etc/yum.repos.d/kloxo-custom.repo
echo 'baseurl=http://apt.sw.be/redhat/el5/en/$basearch/rpmforge' >> /etc/yum.repos.d/kloxo-custom.repo
echo 'enabled=1' >> /etc/yum.repos.d/kloxo-custom.repo
echo 'gpgcheck=0' >> /etc/yum.repos.d/kloxo-custom.repo
echo 'includepkgs=mod_fastcgi' >> /etc/yum.repos.d/kloxo-custom.repo
# delete if exist
rm -rf /tmp/kloxo
# create kloxo temp dir
mkdir /tmp/kloxo ; cd /tmp/kloxo
# get kloxo packer from github
wget https://github.com/mustafaramadhan/kloxo/raw/dev/kloxo-install/kloxo-packer.sh --no-check-certificate
2.a For fresh install (Kloxo no exist) or your current version already 6.2.0
# get kloxo fork from github
sh kloxo-packer.sh --fork=mustafaramadhan --branch=dev
# install kloxo
sh kloxo-installer.sh --type=master
# better reboot
reboot
2.b. Or, For patch to current install - only from 6.1.x - copy-paste line-by-line to ssh console
# not testing for older then version 6.1.11 and then run update
sh /script/upcp
# copy old kloxo for backup purpose
yes|cp -rf /usr/local/lxlabs /usr/local/lxlabs.bck
yes|cp -rf /var/lib/mysql/kloxo /var/lib/mysql/kloxo.bck
# get kloxo fork from github (just kloxo core)
sh kloxo-packer.sh --fork=mustafaramadhan --branch=dev --part=core
# create dir
mkdir ./patch
mkdir ./patch/kloxo
# process for kloxo core
mv kloxo-current.zip ./patch/kloxo
cd ./patch/kloxo
unzip -oq kloxo-current.zip
rm -rf kloxo-current.zip
cd ..
# process for kloxo install
mv ../kloxo-install.zip ./
unzip -oq kloxo-install.zip
rm -rf kloxo-install.zip
cd ..
# copy kloxo patcher script
yes|cp -rf ./patch/kloxo-install/kloxo-patcher.sh ./
# create patch version that match with current version
# run 'sh /script/version' for to know the current version
# if your version is 6.2.0 and then want patch, 6.1.12 to 6.2.0
echo '6.1.12' > ./patch/kloxo-patch-version
# run patcher -- type is master or slave
sh kloxo-patcher.sh --type=master
# better reboot
reboot
Features:
1. Template-based config
2. Only with 2 directories (defaults and domains) instead 5 directories on old version
3. Nginx with php-fpm
4. Lighttpd with php-fpm
5. Lighttpd-proxy
6. Nginx-proxy
7. New php-type (php-fpm_worker and php-fpm_event) for Apache
8. Prepare for Apache 2.4.1
9. Add 'no fix config' on 'switch program' -- importance > 500 domains hosting
10. Minimize DDOS attack for nginx/nginx-proxy
Fixed old issues and enchanced:
1. Use php-cgi_pure (without php-fpm patch to php) for suphp transparently - [TIP] Temporary solution for Kloxo after update php to 5.1.17-13
2. Enhanced DJBdns - [FIX] DJBDNS not work
3. No need reboot when selinux not installed or status as 'on'
4. Reinstall without destroy kloxo setting
5. Fixed for awstats and webalizer config
6. Fixed for 'switch program' which no automaticly running fixweb/fixmail/fixdns
7. Fixed for 'php-type' which sometimes show 'httpd_failed_start'
8. Remove 'safecat' from package install
9. Kloxo packer change target from svn to git.
10. Fixed permalink for Lighttpd
11. Fixed awstats for httpd-itk
12. Use domain as default class on fixtraffic
13. All files inside /cgi-bin automaticly set to 755 with fix-chownchmod
14. Fixed pointing to subdirectory for redirect domain
15. Fixed blank page for 'remote mail' and 'webmail applications'
16. Implementing logrotate
17. Fixed permalink issue for wordpress multisite
18. Fixed suphp for ip/~client access
19. Fixed issue when using kloxo-packer because unzip uninstalled
20. Fixed issue related permalink with html suffix for nginx-proxy
21. Fixed redirect (also www redirect) for nginx-proxy
Unfinished works:
1. stats issue - fixed awstats except for 'pure' nginx
2. wildcards still not work for lighttpd (want as the same as apache and nginx)
3. Some hiddens maybe implementing (like enable cache for apache; suphp for lighttpd)
4. perl still not work for nginx (where awstats use perl)
5. Fixed fix-chownchmod and fix-userlogo for slave
6. Redefine fastcgi_children of lighttpd to switch for php-fpm
7. Using php-fpm for apache not work if .htaccess exist - mod_fastcgi problem
Changed:
1. Change version identity from 6.1.11 to 6.2.0 to prevent update from next release of 6.1.x
2. Instead using 1.2.3.4:80, change to *:80 - it's work and resolve issue like wrong/unidentify ip when using Apache/Nginx
TRICK: After reinstall with the latest patch, if some have issue with nginx-proxy (for example), try switch to another web server and then switch back to previous.
[Updated on: Wed, 30 January 2013 07:43] Report message to a moderator
|
|
|
|
|
|
| Re: [FORK] Nginx, Nginx-proxy and Lighttpd-proxy [message #96103 is a reply to message #96102] |
Wed, 07 March 2012 11:26   |
|
marid wrote on Wed, 07 March 2012 23:16When I select 'optimize' on 'webserver config' when select apache and nginx/lighttpd-proxy is it only set half of values on nginx/lighttpd-proxy or also optimize apache?
For example, if select apache only say it when running optimize will be set maxspare as 10. So, when select nginx-proxy this value is 5.
i'ts enough because nginx handling static files task and apache handling php only. Other effect, redure memory usage.
[Updated on: Wed, 07 March 2012 11:28] Report message to a moderator
|
|
|
|
|
| Re: [FORK] Nginx, Nginx-proxy and Lighttpd-proxy [message #96159 is a reply to message #96153] |
Thu, 08 March 2012 09:47   |
|
it's easy to change port for my kloxo fork. Because change port just enough change in template file(s). Every webservers (Apache and others) have 2 template (defaults.conf.tpl and domains.conf.tpl). User enough copy this template to custom.defaults.conf.tpl and custom.domains.conf.tpl and then modified the content.
When Kloxo found this custom file and then kloxo use them instead 'original'.
That it.
it's possible with scenario like nginx-varnish-apache, varnish-nginx-apache or others.
[Updated on: Thu, 08 March 2012 09:50] Report message to a moderator
|
|
|
|
| Re: [FORK] Nginx, Nginx-proxy and Lighttpd-proxy [message #96185 is a reply to message #96182] |
Thu, 08 March 2012 18:04   |
|
How can we secure the apache-ngix proxy with mod_evasive ? If i use apache only and compile mod evasive it works but when i change to apache-nginx proxy it removes the line "LoadModule evasive20_module /usr/lib/httpd/modules/mod_evasive20.so" from the http.conf but even when i put it manually there with the mod setings it doesnt work.. At least on test.pl it gives me 200 http ok rather than 403 forbiden so it doesnt work...
Also mod_Security will work with this setup ?
============================================
After a couple of tests with this setup i must admin that i never saw my sites so fast.. Before with default apache worker, loadimpact gave me 40 sec average load and now i have 8.9 sec on a heavy site i host.. Really amazing setup.
Great work Mustafa
|
|
|
| Re: [FORK] Nginx, Nginx-proxy and Lighttpd-proxy [message #96188 is a reply to message #96185] |
Thu, 08 March 2012 20:06   |
|
@djscooby,
Instead add to httpd.conf, better create /etc/httpd/conf.d/evasive.conf with content 'LoadModule evasive20_module /usr/lib/httpd/modules/mod_evasive20.so'. Kloxo always override httpd.conf because need special setting for nginx-proxy.
Or move 'LoadModule evasive20_module /usr/lib/httpd/modules/mod_evasive20.so' to something like mod_evasive.conf, evasive20.conf or other possibilities (because maybe evasive have their own conf file).
[Updated on: Thu, 08 March 2012 20:20] Report message to a moderator
|
|
|
|
| Re: [FORK] Nginx, Nginx-proxy and Lighttpd-proxy [message #96197 is a reply to message #96193] |
Fri, 09 March 2012 01:40   |
|
mustafaramadhan wrote on Fri, 09 March 2012 08:26In my queue job, fixed fix-chownchmod and fix-userlogo problem for slave and fixed change code for how to kloxo create kloxo database (it's make possible kloxo can be reinstall without override kloxo database). And then preparing kloxo to apache 2.4.1.
Now, reinstall already safe!.
|
|
|
| Re: [FORK] Nginx, Nginx-proxy and Lighttpd-proxy [message #96202 is a reply to message #96188] |
Fri, 09 March 2012 04:02   |
|
mustafaramadhan wrote on Fri, 09 March 2012 03:06@djscooby,
Instead add to httpd.conf, better create /etc/httpd/conf.d/evasive.conf with content 'LoadModule evasive20_module /usr/lib/httpd/modules/mod_evasive20.so'. Kloxo always override httpd.conf because need special setting for nginx-proxy.
Or move 'LoadModule evasive20_module /usr/lib/httpd/modules/mod_evasive20.so' to something like mod_evasive.conf, evasive20.conf or other possibilities (because maybe evasive have their own conf file).
With Apache web server :
=========================
I removed the code from httpd.conf and created a file as you suggested in conf.d .
Mod evasive works..
Then i deleted the conf fle from the conf.d folder and (as it supposed) it didn't work so everything OK.
- - - - - - - - - - -
With Nginx Apache Proxy
========================
Then i create again the file in conf.d folder and changed to apache-ngix configuration..
Ufortunately the evasive wont work no matter how i name the .conf file (inside conf.d folder)
- - - - - - - - - - -
Doesn't the apache in apache-nginx proxy template load the httpd.conf file and all the ".conf" files in conf.d folder ?
PS : Mod evasive configuration is this
LoadModule evasive20_module /usr/lib/httpd/modules/mod_evasive20.so
<IfModule mod_evasive20.c>
DOSHashTableSize 2048
DOSPageCount 10
DOSSiteCount 50
DOSPageInterval 1
DOSSiteInterval 1
DOSBlockingPeriod 30
</IfModule>
And its compiled inside the httpd.conf file as default, but its also working correctly if i remove the code from httpd.conf and load it as "any-name.conf" file in conf.d folder-But with ngix apache proxy don't load it...
.............................................
Update:
=======
IF i reload the above code in another conf file like !lxcenter.conf inside conf.d folder and restart httpd service it says " [warn] module evasive20_module is already loaded, skipping
"
So mod evasive is loading but its not working...
Any other idea would be greatly appreciated thanks you for your help.
[Updated on: Fri, 09 March 2012 04:25] Report message to a moderator
|
|
|
|
| Re: [FORK] Nginx, Nginx-proxy and Lighttpd-proxy [message #96210 is a reply to message #96204] |
Fri, 09 March 2012 05:22   |
|
ok now i understand why its not working.
For wordpress hosting mostly what would you suggest for best performance?
nginx + apache proxy or nginx only server ?
Also where can i put nginx rewrite rules ? i have never used nginx before so i am a bit lost here..
BTW i found this : www.anilcetin.com/convert-apache-htaccess-to-nginx/
Its an online .htacess to ngix rewrite rules , some people claim it works...
Thanks you again for helping me.
|
|
|
|
|
| Re: [FORK] Nginx, Nginx-proxy and Lighttpd-proxy [message #96217 is a reply to message #96214] |
Fri, 09 March 2012 06:25   |
|
It's related template files. Look at insidde /home/nginx/tpl/defaults.conf.tpl and /home/nginx/tpl/domains.conf.tpl.
Sorry, I will not explain too much for code inside this template files.
When my fork finished (I hope still in March 2012) I will declare as 'stable' and then make tutorial how to exploring all potentials of this template files. Also tutorial for other features.
|
|
|
|
|
|
|
|
|
|
|
|
| Re: [FORK] Nginx, Nginx-proxy and Lighttpd-proxy [message #96467 is a reply to message #96446] |
Tue, 13 March 2012 02:18   |
|
unfortunately with fresh install of centos 5.8 in a vm, it seems the installations instructions not working at all...
I think, your script needs some fixings... (im guessing only)
[root@zeus setup]# sh kloxo-packer.sh --fork=mustafaramadhan --branch=dev
Start pack...
Download kloxo git from mustafaramadhan/kloxo/zipball/dev
--2012-03-13 08:22:40-- https://github.com/mustafaramadhan/kloxo/zipball/dev
Resolving github.com... 207.97.227.239
Connecting to github.com|207.97.227.239|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://nodeload.github.com/mustafaramadhan/kloxo/zipball/dev [following]
--2012-03-13 08:22:41-- https://nodeload.github.com/mustafaramadhan/kloxo/zipball/dev
Resolving nodeload.github.com... 207.97.227.252
Connecting to nodeload.github.com|207.97.227.252|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 21634164 (21M) [application/octet-stream]
Saving to: `dev'
100%[=====================================================================================================================================================================>] 21,634,164 964K/s in 22s
2012-03-13 08:23:07 (973 KB/s) - `dev' saved [21634164/21634164]
kloxo-packer.sh: line 62: unzip: command not found
mv: cannot stat `./mustafaramadhan*': No such file or directory
cp: cannot stat `./current/*': No such file or directory
cp: cannot stat `./patch/*': No such file or directory
Download kloxo-install.zip from http://download.lxcenter.org/download/
--2012-03-13 08:23:07-- http://download.lxcenter.org/download/kloxo-install.zip
Resolving download.lxcenter.org... 66.197.145.24
Connecting to download.lxcenter.org|66.197.145.24|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 49400 (48K) [application/zip]
Saving to: `kloxo-install.zip'
100%[=====================================================================================================================================================================>] 49,400 70.4K/s in 0.7s
2012-03-13 08:23:08 (70.4 KB/s) - `kloxo-install.zip' saved [49400/49400]
kloxo-packer.sh: line 79: unzip: command not found
Download kloxo-installer.php from http://download.lxcenter.org/download/kloxo/production/
--2012-03-13 08:23:08-- http://download.lxcenter.org/download/kloxo/production/kloxo-installer.php
Resolving download.lxcenter.org... 66.197.145.24
Connecting to download.lxcenter.org|66.197.145.24|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2012-03-13 08:23:09 ERROR 404: Not Found.
mv: cannot stat `kloxo-installer.php': No such file or directory
zip warning: name not matched: ./kloxo-install
zip error: Nothing to do! (try: zip -r9y kloxo-install.zip . -i ./kloxo-install)
mv: cannot stat `kloxo-install.zip': No such file or directory
kloxo-packer.sh: line 98: cd: ./kloxo/src: No such file or directory
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.ntua.gr
* extras: ftp.ntua.gr
* updates: ftp.ntua.gr
Reducing kloxo-centalt - i386 to included packages only
Finished
Reducing kloxo-rpmforge - i386 to included packages only
Finished
Setting up Install Process
Package gcc-4.1.2-52.el5.i386 already installed and latest version
Package automake-1.9.6-2.3.el5.noarch already installed and latest version
Package autoconf-2.59-12.noarch already installed and latest version
Package libtool-1.5.22-7.el5_4.i386 already installed and latest version
Package 1:make-3.81-3.el5.i386 already installed and latest version
Nothing to do
make: *** No targets specified and no makefile found. Stop.
zip warning: name not matched: ./bin
zip warning: name not matched: ./cexe
zip warning: name not matched: ./file
zip warning: name not matched: ./httpdocs
zip warning: name not matched: ./pscript
zip warning: name not matched: ./sbin
zip warning: name not matched: ./RELEASEINFO
zip warning: name not matched: ./src
zip error: Nothing to do! (kloxo-current.zip)
mv: cannot stat `kloxo-current.zip': No such file or directory
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 5 0 5 0 0 10 0 --:--:-- --:--:-- --:--:-- 0
--2012-03-13 08:23:13-- http://download.lxcenter.org/download/kloxo-thirdparty.2019.zip
Resolving download.lxcenter.org... 66.197.145.24
Connecting to download.lxcenter.org|66.197.145.24|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12849941 (12M) [application/zip]
Saving to: `kloxo-thirdparty.2019.zip'
100%[=====================================================================================================================================================================>] 12,849,941 1.10M/s in 12s
2012-03-13 08:23:26 (1012 KB/s) - `kloxo-thirdparty.2019.zip' saved [12849941/12849941]
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 5 0 5 0 0 11 0 --:--:-- --:--:-- --:--:-- 0
--2012-03-13 08:23:27-- http://download.lxcenter.org/download/kloxophp4382.tar.gz
Resolving download.lxcenter.org... 66.197.145.24
Connecting to download.lxcenter.org|66.197.145.24|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6843455 (6.5M) [application/x-gzip]
Saving to: `kloxophp4382.tar.gz'
100%[=====================================================================================================================================================================>] 6,843,455 1.13M/s in 7.0s
2012-03-13 08:23:34 (960 KB/s) - `kloxophp4382.tar.gz' saved [6843455/6843455]
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 5 0 5 0 0 11 0 --:--:-- --:--:-- --:--:-- 0
--2012-03-13 08:23:35-- http://download.lxcenter.org/download/kloxophpsixfour4392.tar.gz
Resolving download.lxcenter.org... 66.197.145.24
Connecting to download.lxcenter.org|66.197.145.24|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6775666 (6.5M) [application/x-gzip]
Saving to: `kloxophpsixfour4392.tar.gz'
100%[=====================================================================================================================================================================>] 6,775,666 1.13M/s in 6.9s
2012-03-13 08:23:42 (953 KB/s) - `kloxophpsixfour4392.tar.gz' saved [6775666/6775666]
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 5 0 5 0 0 11 0 --:--:-- --:--:-- --:--:-- 0
--2012-03-13 08:23:43-- http://download.lxcenter.org/download/lxwebmail4374.tar.gz
Resolving download.lxcenter.org... 66.197.145.24
Connecting to download.lxcenter.org|66.197.145.24|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 32796622 (31M) [application/x-gzip]
Saving to: `lxwebmail4374.tar.gz'
100%[=====================================================================================================================================================================>] 32,796,622 1.13M/s in 32s
2012-03-13 08:24:15 (1006 KB/s) - `lxwebmail4374.tar.gz' saved [32796622/32796622]
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 5 0 5 0 0 11 0 --:--:-- --:--:-- --:--:-- 0
--2012-03-13 08:24:16-- http://download.lxcenter.org/download/lxawstats4401.tar.gz
Resolving download.lxcenter.org... 66.197.145.24
Connecting to download.lxcenter.org|66.197.145.24|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1246184 (1.2M) [application/x-gzip]
Saving to: `lxawstats4401.tar.gz'
100%[=====================================================================================================================================================================>] 1,246,184 590K/s in 2.1s
2012-03-13 08:24:18 (590 KB/s) - `lxawstats4401.tar.gz' saved [1246184/1246184]
cp: cannot stat `./combo/kloxo-install/kloxo-installer.sh': No such file or directory
Do you delete temporal dirs (patch, current and combo)? [Y/n]: Y
Now you can run 'sh ./kloxo-installer.sh' for installing
... the end
zip rpm, is installed...
When I close my eyes, I hear your velvet wings and cry, I'm waiting here with open arms, Oh can't you see, Angel shine your light on me...
[Updated on: Tue, 13 March 2012 02:30] Report message to a moderator
|
|
|
| Re: [FORK] Nginx, Nginx-proxy and Lighttpd-proxy [message #96471 is a reply to message #96446] |
Tue, 13 March 2012 04:17   |
|
mustafaramadhan wrote on Mon, 12 March 2012 22:14No comment about your situation. My fork still 'developing step'. If I think stable enough I will declare as 'stable'. My target is 'stable' at the end of this March 2012.
Yes i know that from the begining i tried the new version.. I just want someone to test the remote mail button inside the cp and see if my problem is related to the update or not, if its not too much trouble..
Thanks in advance
@DaveMurray
I think you may be right i also tried as a fresh install a couple of days ago and it wasnt working so i installed normal kloxo version and then apply the patch/upgrade with the instuctions Mustafa provided. I hope this helps you..
[Updated on: Tue, 13 March 2012 04:42] Report message to a moderator
|
|
|
| Re: [FORK] Nginx, Nginx-proxy and Lighttpd-proxy [message #96472 is a reply to message #96471] |
Tue, 13 March 2012 04:44   |
|
djscooby wrote on Tue, 13 March 2012 15:17mustafaramadhan wrote on Mon, 12 March 2012 22:14No comment about your situation. My fork still 'developing step'. If I think stable enough I will declare as 'stable'. My target is 'stable' at the end of this March 2012.
Yes i know that from the begining i tried the new version.. I just want someone to test the remote mail button inside the cp and see if my problem is related to the update or not, if its not too much trouble..
Thanks in advance
@DaveMurray
I think you may be right i also tried as a fresh install a couple of days ago and it wasnt working so i installed normal kloxo version and then apply the patch/upgrade with the instuctions Mustafa provided. I hope this helps you..
Yes, I found the same issue. But, on my latest upload this issue was fixed.
|
|
|
|
|
|
| Re: [FORK] Nginx, Nginx-proxy and Lighttpd-proxy [message #96492 is a reply to message #96491] |
Tue, 13 March 2012 10:44   |
|
But, i found another issue on centos 5.8 where creating domain skeleton.zip no unzipped to domain directory. And the effect is your domain website will be appear 'apache page' becuase index.html not exist. It's ok when we create index.html or index.php.
This is make me confuse because not all centos 5.8 os-template have the same behaviour. So, still investigation.
|
|
|
|
|
|
|
|