設置した掲示板
環境はubuntuです。上の掲示板を設置して、ドメインのほうも設置しました。
(仮にIPは123.45.6.789として、上の掲示板はポートは5000です。)
設置したドメインにアクセスしたら、"Apache2 Ubuntu Default Page"と表示されました。そのあとにapache2が動いていると思ったので、/etc/apache2/sites-enabled/000-default.conf の所に
ProxyPass / http://123.45.6.789:5000
ProxyPassReverse / http://123.45.6.789:5000
と追記しました。
そしたら、サイトにアクセスできました。しかし、ここから違うところにアクセスしたら以下のように表示されました。どうすれば直りますか?
Proxy Error The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET /sample/. Reason: DNS lookup failure for: 123.45.6.789:5000sample Apache/2.4.18 (Ubuntu) Server at domain Port 443
どうしたら表示されますか?
一応、/etc/apache2/ports.conf の中身をかいときます
ports.conf
1# If you just change the port or add more ports here, you will likely also 2# have to change the VirtualHost statement in 3# /etc/apache2/sites-enabled/000-default.conf 4 5Listen 80 6 7<IfModule ssl_module> 8 Listen 443 9</IfModule> 10 11<IfModule mod_gnutls.c> 12 Listen 443 13</IfModule> 14 15# vim: syntax=apache ts=4 sw=4 sts=4 sr noet 16
/etc/apache2/sites-enabled/000-default.confないです
<VirtualHost *:80> # The ServerName directive sets the request scheme, hostname and port t$ # the server uses to identify itself. This is used when creating # redirection URLs. In the context of virtual hosts, the ServerName # specifies what hostname must appear in the request's Host: header to # match this virtual host. For the default virtual host (this file) this # value is not decisive as it is used as a last resort host regardless. # However, you must set it for any further virtual host explicitly. #ServerName www.example.com ServerAdmin webmaster@localhost DocumentRoot /var/www/html ProxyPass / http://IP:5000/ ProxyPassReverse / http://IP:5000/ # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # It is also possible to configure the loglevel for particular
/etc/apache2/sites-enabled/000-default-le-ssl.conf内は
000
1<IfModule mod_ssl.c> 2<VirtualHost *:443> 3 # The ServerName directive sets the request scheme, hostname and port t$ 4 # the server uses to identify itself. This is used when creating 5 # redirection URLs. In the context of virtual hosts, the ServerName 6 # specifies what hostname must appear in the request's Host: header to 7 # match this virtual host. For the default virtual host (this file) this 8 # value is not decisive as it is used as a last resort host regardless. 9 # However, you must set it for any further virtual host explicitly. 10 #ServerName www.example.com 11 12 ServerAdmin webmaster@localhost 13 DocumentRoot /var/www/html 14 ProxyPass / http://domain:5000 15 ProxyPassReverse / http://domain:5000 16 ProxyPassReverseCookieDomain IP:5000 domain 17 18 # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, 19 # error, crit, alert, emerg. 20

