问题
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