Устанавливал nginx+apache на одной машине, всё прекрасно работало, появилась возможность перенести nginx на отдельное железо, вот тут всё моё незнание и вылезло
локальные ip 192.168.100.1 у nginx 192.168.100.100 - apache, друг друга видят
nginx слушает 80 порт (Ubuntu server 14.04)
Код: Выделить всё
netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN 1075/php5-cgi
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1071/nginx
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1027/sshd
tcp6 0 0 :::22 :::* LISTEN 1027/sshdapache соответственно 8000 ( Kubuntu 14.04)
Код: Выделить всё
netstat -tnlp
Активные соединения с интернетом (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1380/mysqld
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 853/smbd
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN 1660/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1271/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 16973/cupsd
tcp 0 0 127.0.0.1:8089 0.0.0.0:* LISTEN 18463/banshee
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 853/smbd
tcp6 0 0 :::139 :::* LISTEN 853/smbd
tcp6 0 0 :::22 :::* LISTEN 1271/sshd
tcp6 0 0 ::1:631 :::* LISTEN 16973/cupsd
tcp6 0 0 :::8091 :::* LISTEN 1755/java
tcp6 0 0 :::445 :::* LISTEN 853/smbd
tcp6 0 0 :::8000 :::* LISTEN 32499/apache2на java крутится YaCy на порту 8091
по доменному имени mysites.com выводит приветствие nginx-а по mysites.com:8091 открывает то, что нужно, но извне не видно.
.htaccess
Код: Выделить всё
RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html .phtml
Redirect /index.html http://mysite.com:8091Перепробывал методом тыка смена локальных ip в конфигах, так и остался ни с чем.
Просьба помочь разобраться.
Имеется машина с nginx
nginx.conf:
Код: Выделить всё
user nobody;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}/etc/nginx/sites-available/mysites.com
Код: Выделить всё
events {
worker_connections 1024;
}
http {
server {
listen 80 default_server;
listen [::]:80;
root /usr/share/nginx/html;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name mysites;
location / {
proxy_pass http://127.0.0.1:8091/;
proxy_redirect off;
include /etc/nginx/proxy_params;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
location ~* .(txt|jpg|jpeg|gif|mpg|mpeg|avi|png|css|swf|ico|zip|rar|sdt|js|bmp|wav|mp3|mmf|mid|vkp|sisx|sis|exe|jar|thm|nth|doc)$ {
root /var/www/mysites/;
expires 2d;
}
}
}вторая машина с apache2 +mod_rpaf
ports.conf
Код: Выделить всё
Listen 8000
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>/etc/apache2/sites-available/mysites.com
Код: Выделить всё
<VirtualHost 127.0.0.1:8000>
ServerName mysites.com
DocumentRoot /var/www/mysites
ServerAlias www.mysites.com mysites.com
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>