1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Node.js app Apache2下で起動

Posted at

Node.jsアプリをApacheサーバのVirtualHostにて、ドメインを割り当て、更にアプリを起動し、Proxy設定にて、起動したlocalportを指定し、80のPortとして、アクセスさせる。
下記にその手順を記載します。
1、nodeの環境に、foreverモジュールをInstallしてあること。

2、httpd.confのVirtualHost設定例を下記に示します。

<VirtualHost *:80>
    ServerAdmin webmaster@mail.example.com
    DocumentRoot /var/www/html/example
    ServerName message.example.com
    ErrorLog logs/example.com-error_log
    CustomLog logs/example.com-access_log common
   ProxyRequests off

    <Proxy *>
            Order deny,allow
            Allow from all
    </Proxy>

    <Location />
            ProxyPass http://localhost:3000/
            ProxyPassReverse http://localhost:3000/
    </Location>

</VirtualHost>

Appの直下に移動、foreverモジュールにて下記の様に実行、
forever start server.js
起動停止。
forever stop server.js

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?