Config Node JS in GoDaddy with a Domain and SSL

☆樱花仙子☆ 提交于 2021-01-29 12:00:39

问题


Hi I bougth a VPS in GoDadddy, a domanin(example.com) and add a SSL in this domain,

I configured the domain with the IP of my VPS, I can open a demo page successfully .

But I have a page in Node JS in the same VPS in other port, 192.168.0.2:3000(the ip is an example); I can open this page if in the browser use the IP, my page is running in the VPS successfully

GoDaddy Install apache by default to can access to cPanel and WHM, so...

My Questions is

How Can I configure httpd.conf from Apache to redirect to port :3000 alwas that get the domain.

example.com --> Open Page in NodJS

I opened the httpd.conf (Path: "usr/local/apache/conf/httpd.conf") And the file doesn't recommend editing manually

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
#   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#   DO NOT EDIT. AUTOMATICALLY GENERATED.  USE INCLUDE FILES IF YOU NEED TO MAKE A CHANGE
#   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#
#   Direct modifications to the Apache configuration file WILL be lost upon subsequent
#   regeneration of this configuration file, or an Apache update.
#
#   To have your modifications retained, you should create/edit administrator-specific
#   include files:
#
#       /etc/apache2/conf.d/includes/pre_main_global.conf
#       /etc/apache2/conf.d/includes/pre_virtualhost_global.conf
#       /etc/apache2/conf.d/includes/post_virtualhost_global.conf
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

##################################################
##################################################
#
# cPanel & WHM controlled Apache configuration
#
##################################################
##################################################

Include "/etc/apache2/conf.modules.d/*.conf"

# Administrator locations for safely altering httpd.conf
Include "/etc/apache2/conf.d/includes/pre_main_global.conf"

# These are hard-coded values that are required by cPanel & WHM
PidFile /run/apache2/httpd.pid
User nobody
Group nobody
ExtendedStatus On
LogLevel warn
SymlinkProtect Off
SymlinkProtectRoot /var/www/html

So, Acording with the next line

Include "/etc/apache2/conf.modules.d/*.conf"

I created a file "/etc/apache2/conf.modules.d/mydomain_virtualHost.conf"

:) but I don´t sure whath write here.

来源:https://stackoverflow.com/questions/60643469/config-node-js-in-godaddy-with-a-domain-and-ssl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!