Current time: 11-22-2024, 02:09 PM Hello There, Guest! (LoginRegister)


Post Reply 
 
Thread Rating:
  • 5 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ispCP & nginx
Author Message
koffu Offline
Junior Member
*

Posts: 80
Joined: Jan 2010
Reputation: 1
Post: #22
RE: ispCP & nginx
Есть, я! Big Grin Доделывать ещё буду, планирую добавить поддержку поддоменов, веб морду, персональные настройки для доменов в MySQL. Может что-то ещё, предлагайте. Все вопросы можно на форум, в личку или на мыло.
Новая версия, тестируем. Список изменений ниже, не айс, знаю, сессия.
*vhostconfig splitted by two subs - getparams, genvconf added a lot of comments *added cosmetical changes to generated files:
*changed -client_max_body_size 3M; due to "413 Request Entity too large" error
Собрал в кучу доку, если что-то неверно, просьба указать, кусок с mysql писал из головы.

Quote:Общие сведения и принцип работы:
nginx вешаем на 81, апач на 80 (чтобы не лазить ещё и в конфиг панели), поэтому переключаем через iptables.

Далее в скрипте в голове меняем параметры на свои, добавляем MySQL пользователя для доступа к базе ispcp. Лимиты установлены на "/" и ".php", которые дергают апач. Поставлены под себя на основании конфига сайта большого туроператора, которго часто DDOS-или. При желании менять строки - 70,71. Для фрей и линукса автоматом меняет use kqueue/epoll.

Ещё, в апач будут идти коннекты от 127.0.0.1, поэтому, нужно поставить mod-rpaf, который на основании заголовков nginx HOST будет ставить правильную инфу в access.log. Траффик через nginx панелью считаться НЕ БУДЕТ!

Порядок установки:
Установка nginx
aptitude install libpcre3-dev libssl-dev
./configure --with-http_realip_module --with-http_addition_module --with-http_gzip_static_module --with-http_stub_status_module && make -j2 && make install

После установки nginx создаём пользователя в MySQL базе.
# mysql -u root -p ispcp
mysql> grant all on ispcp.domain to 'nginx'@'localhost' identified by 'your password';
mysql> grant all on ispcp.subdomain to 'nginx'@'localhost' identified by 'your password';
mysql> flush privileges;

После запускаем скрипт
# ./ispcp-nginx.pl
Writing global nginx configuration...done
Writing nginx virtual hosts configuration...
Converting site1.com.ua
Converting site2.in.ua
done

Проверяем синтаксис файлов конфигурации
# /usr/local/nginx/sbin/nginx -t
the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
configuration file /usr/local/nginx/conf/nginx.conf test is successful

Если nginx работает, делаем так:
# killall -s HUP nginx

Переключаем входящий траффик на nginx
# iptables -t nat -A PREROUTING -s ! 127.0.0.1 -d 192.168.0.1 -p tcp --dport 80 -j REDIRECT --to-ports 81


Attached File(s)
.gz  ispcp-nginx.pl.gz (Size: 2.83 KB / Downloads: 21)
(This post was last modified: 01-26-2010 02:52 AM by koffu.)
01-26-2010 01:55 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
ispCP & nginx - data-stream_ru - 11-04-2009, 12:50 PM
RE: ispCP & nginx - server801 - 11-04-2009, 08:26 PM
RE: ispCP & nginx - data-stream_ru - 11-07-2009, 02:33 PM
RE: ispCP & nginx - server801 - 11-07-2009, 09:05 PM
RE: ispCP & nginx - koffu - 01-09-2010, 11:10 AM
RE: ispCP & nginx - data-stream_ru - 01-11-2010, 01:45 AM
RE: ispCP & nginx - server801 - 01-09-2010, 04:54 PM
RE: ispCP & nginx - koffu - 01-09-2010, 10:53 PM
RE: ispCP & nginx - koffu - 01-10-2010, 10:12 AM
RE: ispCP & nginx - server801 - 01-10-2010, 11:32 PM
RE: ispCP & nginx - koffu - 01-10-2010, 11:37 PM
RE: ispCP & nginx - server801 - 01-11-2010, 12:40 AM
RE: ispCP & nginx - koffu - 01-11-2010, 06:47 AM
RE: ispCP & nginx - server801 - 01-11-2010, 07:40 AM
RE: ispCP & nginx - koffu - 01-11-2010, 07:47 AM
RE: ispCP & nginx - koffu - 01-12-2010, 04:30 PM
RE: ispCP & nginx - data-stream_ru - 01-14-2010, 01:23 AM
RE: ispCP & nginx - data-stream_ru - 01-16-2010, 10:29 PM
RE: ispCP & nginx - koffu - 01-17-2010, 08:10 PM
RE: ispCP & nginx - Kursor - 01-26-2010, 12:30 AM
RE: ispCP & nginx - koffu - 01-26-2010 01:55 AM
RE: ispCP & nginx - koffu - 01-26-2010, 04:44 AM
RE: ispCP & nginx - marchaos - 01-26-2010, 04:58 AM
RE: ispCP & nginx - koffu - 01-26-2010, 05:02 AM
RE: ispCP & nginx - marchaos - 01-26-2010, 05:41 AM
RE: ispCP & nginx - Kursor - 01-26-2010, 06:07 AM
RE: ispCP & nginx - Kursor - 01-26-2010, 06:20 AM
RE: ispCP & nginx - koffu - 01-26-2010, 06:45 AM
RE: ispCP & nginx - Kursor - 01-26-2010, 07:15 AM
RE: ispCP & nginx - koffu - 01-26-2010, 07:23 AM
RE: ispCP & nginx - Kursor - 01-26-2010, 07:33 AM
RE: ispCP & nginx - koffu - 01-26-2010, 07:38 AM
RE: ispCP & nginx - koffu - 01-27-2010, 07:11 PM
RE: ispCP & nginx - koffu - 01-28-2010, 08:44 AM
RE: ispCP & nginx - data-stream_ru - 01-30-2010, 07:42 PM
RE: ispCP & nginx - koffu - 01-31-2010, 08:30 AM
RE: ispCP & nginx - data-stream_ru - 02-01-2010, 02:53 PM
RE: ispCP & nginx - koffu - 02-01-2010, 06:57 PM
RE: ispCP & nginx - data-stream_ru - 02-01-2010, 08:44 PM
RE: ispCP & nginx - koffu - 02-03-2010, 08:59 AM
RE: ispCP & nginx - data-stream_ru - 02-03-2010, 09:30 PM
RE: ispCP & nginx - koffu - 02-05-2010, 07:56 AM
RE: ispCP & nginx - data-stream_ru - 02-05-2010, 06:30 PM
RE: ispCP & nginx - data-stream_ru - 02-12-2010, 04:53 PM
RE: ispCP & nginx - data-stream_ru - 02-12-2010, 06:09 PM
RE: ispCP & nginx - data-stream_ru - 02-12-2010, 10:18 PM
RE: ispCP & nginx - data-stream_ru - 02-12-2010, 11:34 PM
RE: ispCP & nginx - koffu - 02-13-2010, 12:44 AM
RE: ispCP & nginx - data-stream_ru - 02-13-2010, 01:53 AM
RE: ispCP & nginx - koffu - 02-13-2010, 01:59 AM
RE: ispCP & nginx - data-stream_ru - 02-13-2010, 02:56 AM
RE: ispCP & nginx - data-stream_ru - 02-13-2010, 05:29 AM
RE: ispCP & nginx - data-stream_ru - 02-13-2010, 07:12 AM
RE: ispCP & nginx - data-stream_ru - 02-13-2010, 12:53 PM
RE: ispCP & nginx - koffu - 02-13-2010, 06:52 PM
RE: ispCP & nginx - data-stream_ru - 02-14-2010, 01:40 AM
RE: ispCP & nginx - data-stream_ru - 02-15-2010, 07:07 AM
RE: ispCP & nginx - data-stream_ru - 02-17-2010, 08:06 PM
RE: ispCP & nginx - koffu - 02-18-2010, 08:21 AM
RE: ispCP & nginx - data-stream_ru - 02-18-2010, 09:23 PM
RE: ispCP & nginx - koffu - 02-18-2010, 09:25 PM
RE: ispCP & nginx - data-stream_ru - 02-19-2010, 07:43 AM
RE: ispCP & nginx - data-stream_ru - 02-22-2010, 06:36 AM
RE: ispCP & nginx - data-stream_ru - 02-23-2010, 11:27 AM
RE: ispCP & nginx - marchaos - 02-26-2010, 04:48 AM
RE: ispCP & nginx - data-stream_ru - 02-26-2010, 07:49 AM
RE: ispCP & nginx - marchaos - 02-26-2010, 06:03 PM
RE: ispCP & nginx - server801 - 02-27-2010, 05:27 AM
RE: ispCP & nginx - koffu - 02-27-2010, 07:11 AM
RE: ispCP & nginx - SolarW - 02-27-2010, 07:29 AM
RE: ispCP & nginx - data-stream_ru - 02-27-2010, 09:05 AM
RE: ispCP & nginx - SolarW - 02-28-2010, 09:33 AM
RE: ispCP & nginx - marchaos - 02-27-2010, 10:14 AM
RE: ispCP & nginx - data-stream_ru - 02-27-2010, 10:56 AM
RE: ispCP & nginx - marchaos - 02-27-2010, 11:03 AM
RE: ispCP & nginx - data-stream_ru - 02-27-2010, 11:57 PM
RE: ispCP & nginx - data-stream_ru - 02-28-2010, 01:30 AM
RE: ispCP & nginx - koffu - 03-01-2010, 06:28 AM
RE: ispCP & nginx - server801 - 03-01-2010, 06:38 AM
RE: ispCP & nginx - data-stream_ru - 03-02-2010, 11:45 AM
RE: ispCP & nginx - data-stream_ru - 03-02-2010, 12:45 PM
RE: ispCP & nginx - data-stream_ru - 03-02-2010, 01:47 PM
RE: ispCP & nginx - data-stream_ru - 03-02-2010, 03:01 PM
RE: ispCP & nginx - data-stream_ru - 03-02-2010, 09:49 PM
RE: ispCP & nginx - server801 - 03-03-2010, 02:32 AM
RE: ispCP & nginx - data-stream_ru - 03-03-2010, 04:44 PM
RE: ispCP & nginx - data-stream_ru - 03-04-2010, 03:18 AM
RE: ispCP & nginx - data-stream_ru - 03-04-2010, 04:59 PM
RE: ispCP & nginx - data-stream_ru - 03-04-2010, 06:27 PM
RE: ispCP & nginx - koffu - 03-11-2010, 11:01 PM
RE: ispCP & nginx - data-stream_ru - 03-12-2010, 02:11 AM
RE: ispCP & nginx - GioMac - 03-16-2010, 07:31 AM
RE: ispCP & nginx - marchaos - 03-16-2010, 07:40 AM
RE: ispCP & nginx - GioMac - 03-16-2010, 08:19 AM
RE: ispCP & nginx - koffu - 03-18-2010, 10:19 PM
RE: ispCP & nginx - GioMac - 03-19-2010, 11:55 PM
RE: ispCP & nginx - data-stream_ru - 03-19-2010, 12:26 AM
RE: ispCP & nginx - data-stream_ru - 03-20-2010, 09:38 AM
RE: ispCP & nginx - data-stream_ru - 03-20-2010, 10:45 PM
RE: ispCP & nginx - data-stream_ru - 03-26-2010, 06:06 PM
RE: ispCP & nginx - GioMac - 03-28-2010, 10:57 AM
RE: ispCP & nginx - data-stream_ru - 03-28-2010, 06:44 PM
RE: ispCP & nginx - GioMac - 03-28-2010, 07:00 PM
RE: ispCP & nginx - server801 - 03-28-2010, 09:49 PM
RE: ispCP & nginx - data-stream_ru - 03-29-2010, 12:45 AM
RE: ispCP & nginx - GioMac - 03-29-2010, 05:21 AM
RE: ispCP & nginx - mad max - 03-29-2010, 05:15 AM
RE: ispCP & nginx - data-stream_ru - 03-29-2010, 09:31 AM
RE: ispCP & nginx - TTP - 05-04-2010, 10:02 PM
RE: ispCP & nginx - server801 - 03-29-2010, 07:26 AM
RE: ispCP & nginx - GioMac - 03-29-2010, 08:51 AM
RE: ispCP & nginx - data-stream_ru - 05-01-2010, 04:02 AM
RE: ispCP & nginx - server801 - 05-01-2010, 08:13 PM
RE: ispCP & nginx - data-stream_ru - 05-04-2010, 01:27 AM
RE: ispCP & nginx - data-stream_ru - 05-06-2010, 08:35 AM
RE: ispCP & nginx - TTP - 05-06-2010, 05:45 PM
RE: ispCP & nginx - koffu - 06-03-2010, 06:42 PM
RE: ispCP & nginx - koffu - 07-28-2010, 02:46 AM
RE: ispCP & nginx - data-stream_ru - 07-28-2010, 04:07 PM
RE: ispCP & nginx - DragonZX - 08-27-2010, 07:13 AM
RE: ispCP & nginx - data-stream_ru - 08-27-2010, 07:23 PM
RE: ispCP & nginx - koffu - 07-28-2010, 05:05 PM
RE: ispCP & nginx - koffu - 08-27-2010, 11:29 PM
RE: ispCP & nginx - koffu - 08-28-2010, 01:19 AM
RE: ispCP & nginx - DragonZX - 08-28-2010, 03:49 AM
RE: ispCP & nginx - koffu - 08-29-2010, 02:01 AM
RE: ispCP & nginx - koffu - 09-03-2010, 12:42 AM
RE: ispCP & nginx - server801 - 09-03-2010, 02:17 AM
RE: ispCP & nginx - koffu - 09-07-2010, 10:15 PM
RE: ispCP & nginx - DragonZX - 09-09-2010, 06:47 PM
RE: ispCP & nginx - koffu - 09-09-2010, 10:24 PM
RE: ispCP & nginx - koffu - 09-17-2010, 11:01 PM
RE: ispCP & nginx - Enkil - 09-21-2010, 06:08 AM
RE: ispCP & nginx - koffu - 09-21-2010, 06:48 AM
RE: ispCP & nginx - Enkil - 09-21-2010, 08:06 AM
RE: ispCP & nginx - Enkil - 09-21-2010, 09:47 AM
RE: ispCP & nginx - koffu - 09-21-2010, 04:19 PM
RE: ispCP & nginx - Enkil - 09-22-2010, 08:09 AM
RE: ispCP & nginx - koffu - 09-22-2010, 08:36 AM
RE: ispCP & nginx - server801 - 09-22-2010, 06:40 PM
RE: ispCP & nginx - DragonZX - 09-22-2010, 11:55 PM
RE: ispCP & nginx - koffu - 09-23-2010, 03:37 AM
RE: ispCP & nginx - Enkil - 09-26-2010, 06:34 AM
RE: ispCP & nginx - koffu - 09-30-2010, 04:33 AM
RE: ispCP & nginx - DragonZX - 09-30-2010, 05:50 AM
RE: ispCP & nginx - alt - 10-11-2010, 05:10 PM
RE: ispCP & nginx - data-stream_ru - 09-23-2010, 09:42 AM
RE: ispCP & nginx - Enkil - 09-30-2010, 05:53 AM
RE: ispCP & nginx - koffu - 09-30-2010, 06:48 AM
RE: ispCP & nginx - DragonZX - 09-30-2010, 07:37 AM
RE: ispCP & nginx - Enkil - 09-30-2010, 06:06 PM
RE: ispCP & nginx - DragonZX - 09-30-2010, 06:34 PM
RE: ispCP & nginx - Enkil - 09-30-2010, 07:21 PM
RE: ispCP & nginx - DragonZX - 09-30-2010, 09:40 PM
RE: ispCP & nginx - Enkil - 09-30-2010, 10:45 PM
RE: ispCP & nginx - koffu - 10-09-2010, 01:14 AM
RE: ispCP & nginx - DragonZX - 10-01-2010, 12:29 AM
RE: ispCP & nginx - Enkil - 10-01-2010, 02:22 AM
RE: ispCP & nginx - DragonZX - 10-01-2010, 02:38 AM
RE: ispCP & nginx - outbackdingo - 10-01-2010, 12:20 PM
RE: ispCP & nginx - DragonZX - 10-01-2010, 04:29 PM
RE: ispCP & nginx - alt - 10-08-2010, 09:06 PM
RE: ispCP & nginx - DragonZX - 10-12-2010, 10:25 PM
RE: ispCP & nginx - server801 - 10-12-2010, 11:42 PM
RE: ispCP & nginx - DragonZX - 10-13-2010, 12:32 AM
RE: ispCP & nginx - data-stream_ru - 10-25-2010, 02:49 PM
RE: ispCP & nginx - data-stream_ru - 02-21-2011, 11:37 PM
RE: ispCP & nginx - server801 - 02-23-2011, 07:41 AM
RE: ispCP & nginx - koffu - 03-01-2011, 10:18 PM
RE: ispCP & nginx - koffu - 09-21-2011, 10:13 PM
RE: ispCP & nginx - DragonZX - 09-22-2011, 12:39 AM

Forum Jump:


User(s) browsing this thread: 2 Guest(s)