掲示板
環境はubuntuです。上の掲示板を設置して、ドメインのほうも設置しまて、Encryptを使って暗号化しました。(仮にIPは123.45.6.789として、上の掲示板はポートは5000です。)
設置したドメインにアクセスしたら、"Apache2 Ubuntu Default Page"と表示されました。そのあとにapache2が動いていると思ったので、/etc/apache2/sites-enabled/000-default.conf と /etc/apache2/sites-enabled/000-default-le-ssl.confの所に
ProxyPass / http://123.45.6.789:5000/ ProxyPassReverse / http://123.45.6.789:5000/
と追記しました。
そしたら、サイトにアクセスできました。ホーム画面からちがうところにアクセスすることもd来ます。
できたと思ったら新しい問題が発生しました。スレッドを作ろうとしたら、’Error : mongodb exception : no variable id in line 24’と表示され、エラーが発生します。暗号化とドメインを設置する前は問題なくできていたのになぜでしょうか?
一応、ファイルの中身を載せておきます
/etc/apache2/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.conf Listen 80 <IfModule ssl_module> Listen 443 </IfModule> <IfModule mod_gnutls.c> Listen 443 </IfModule> # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
/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/ ProxyPassReverseCookieDomain IP:5000 domain # 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
<IfModule mod_ssl.c> <VirtualHost *:443> # 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://domain:5000 ProxyPassReverse / http://domain:5000 ProxyPassReverseCookieDomain IP:5000 domain # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg.
ちなみに、データベースに値がないと思い、以下のように入力したら、ちゃんとありました。
select * from boards; board | extra_text | display_name | settings -------------+------------+--------------+---------- board1 | | Board1 | board2 | | Board2 |
あなたの回答
tips
プレビュー