@Toronto

Связка nginx+apache2 + ispmanager не работает, что я делаю не так?

Здравствуйте!

Суть проблемы такая:

На сервере debian 7 (x64) установлен IspMgr, с панельки которого были установлены apache2 и nginx

Изначально apache2 висит на 81 порту
Nginx же, висит на 443

И это все на внешнем IP.

Так вот, как заставить работать apache2 на 127.0.0.1:8080 а nginx на 80 и при этом закрыть порт 81 и 443
И так же, когда добавлялись домены в IspMgr виртуальные хосты создаются не совсем корректно.

Конфиг apache2 стандартный как его установил IspMgr:
# This is the main Apache server

# Include module configuration:
Include mods-enabled/*.load
Include mods-enabled/*.conf

# Include list of ports to listen on and which to use for name based vhosts
Include ports.conf

#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
# If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# Include of directories ignores editors' and dpkg's backup files,
# see the comments above for details.

# Include generic snippets of statements
Include conf.d/

# Include the virtual host configurations:
Include sites-enabled/

Include /usr/local/ispmgr/etc/ispmgr.inc

php_admin_flag engine off

ports.conf
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz

NameVirtualHost *:80
Listen 81

# If you add NameVirtualHost *:443 here, you will also have to change
# the VirtualHost statement in /etc/apache2/sites-available/default-ssl
# to
# Server Name Indication for SSL named virtual hosts is currently not
# supported by MSIE on Windows XP.
Listen 443

Listen 443


Виртуальные хосты IspMgr создает в самих nginx.conf и apache2.conf

А вот так у меня в ispmgr.conf
Service "HTTP" {
Confname apache2
Monitored NO
Process apache2
Start /etc/init.d/apache2 start
Stop /etc/init.d/apache2 stop
Type www
Ip xx.xx.xx.xx 81
}
Service "FTP" {
Confname proftpd
Monitored NO
Process proftpd
Start /etc/init.d/proftpd start
Stop /etc/init.d/proftpd stop
Type ftp
}
Service "MySQL" {
Confname mysql
Monitored NO
Process mysqld
Start /etc/init.d/mysql start
Stop /etc/init.d/mysql stop
Type mysql
Ip /var/run/mysqld/mysqld.sock
}
Service "DNS" {
Confname bind9
Monitored NO
Process named
Start /etc/init.d/bind9 start
Stop /etc/init.d/bind9 stop
Type dns
}
Service "Nginx" {
Confname nginx
Monitored NO
Process nginx
Start /etc/init.d/nginx start
Stop /etc/init.d/nginx stop
Type process
}
nginx.domain
server {
listen xx.xx.xx.xx:443;
server_name xx.xx.xx.xx;
ssl on;
ssl_certificate /usr/local/ispmgr/etc/manager.crt;
ssl_certificate_key /usr/local/ispmgr/etc/manager.key;
include /usr/local/ispmgr/etc/nginx.inc;
location / {
proxy_pass $mgr_proxy;
proxy_redirect $mgr_proxy /;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Secret 22Vz/Qkjps6tjJ97ExT6zPum;
chunked_transfer_encoding off;
}
location ~* ^/(webstat|awstats|webmail|myadmin|pgadmin)/ {
proxy_pass http://xx.xx.xx.xx:81;
proxy_redirect xx.xx.xx.xx:81 /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Secret 22Vz/Qkjps6tjJ97ExT6zPum;
}
}

и
nginx.inc
set $mgr_proxy "xx.xx.xx.xx:1500";
location ^~ /manimg/ {
alias /usr/local/ispmgr/skins/;
}
location ^~ /manager {
proxy_pass $mgr_proxy;
proxy_redirect $mgr_proxy /;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Manager-Path /manager;
proxy_set_header X-Secret 22Vz/Qkjps6tjJ97ExT6zPum;
chunked_transfer_encoding off;
}
location ^~ /mancgi/ {
proxy_pass $mgr_proxy;
proxy_redirect $mgr_proxy /;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Secret 22Vz/Qkjps6tjJ97ExT6zPum;
chunked_transfer_encoding off;
}


Я всяко разно пытался менять порты, ни чего не выходит, nginx отказывается работать, а создавая виртуальные хосты ispmgr задает такие параметры:

location ~* ^/(webstat|awstats|webmail|myadmin|pgadmin)/ {
proxy_pass http://xx.xx.xx.xx:81;
proxy_redirect xx.xx.xx.xx:81 /;

Уже какой день бьюсь, не как не могу забить их в нужные мне порты, да еще что бы это все корректно работало
  • Вопрос задан
  • 4390 просмотров
Пригласить эксперта
Ответы на вопрос 1
меняйте шаблоны. Все записи в ваших файлах делаются с шабонов, вот в них и прописан 81й порт.
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы