Redirect port 5000 OSRM a subdomain in Apache2
Little description:
Redirect port 5000 to a subdomain
Description:
Well I have a program, "supervisor" It has a OSRM (open street routing map), It is running in port 5000, I want to redirect that port to a subdomain example.mywebsite.com, all with Apache
My SO: is Ubuntu 14.04.4 LTS
Apache version: Apache/2.4.7 (Ubuntu)
I have a file for every subdomain in : /etc/apache2/sites-available/
I want a file for my problem there...
I don't know how to do It.
This will help another, and I'm doing a tuto of installing nominatim, and osrm, with apache...
server apache2 proxy port-forwarding reverse-proxy
add a comment |
Little description:
Redirect port 5000 to a subdomain
Description:
Well I have a program, "supervisor" It has a OSRM (open street routing map), It is running in port 5000, I want to redirect that port to a subdomain example.mywebsite.com, all with Apache
My SO: is Ubuntu 14.04.4 LTS
Apache version: Apache/2.4.7 (Ubuntu)
I have a file for every subdomain in : /etc/apache2/sites-available/
I want a file for my problem there...
I don't know how to do It.
This will help another, and I'm doing a tuto of installing nominatim, and osrm, with apache...
server apache2 proxy port-forwarding reverse-proxy
add a comment |
Little description:
Redirect port 5000 to a subdomain
Description:
Well I have a program, "supervisor" It has a OSRM (open street routing map), It is running in port 5000, I want to redirect that port to a subdomain example.mywebsite.com, all with Apache
My SO: is Ubuntu 14.04.4 LTS
Apache version: Apache/2.4.7 (Ubuntu)
I have a file for every subdomain in : /etc/apache2/sites-available/
I want a file for my problem there...
I don't know how to do It.
This will help another, and I'm doing a tuto of installing nominatim, and osrm, with apache...
server apache2 proxy port-forwarding reverse-proxy
Little description:
Redirect port 5000 to a subdomain
Description:
Well I have a program, "supervisor" It has a OSRM (open street routing map), It is running in port 5000, I want to redirect that port to a subdomain example.mywebsite.com, all with Apache
My SO: is Ubuntu 14.04.4 LTS
Apache version: Apache/2.4.7 (Ubuntu)
I have a file for every subdomain in : /etc/apache2/sites-available/
I want a file for my problem there...
I don't know how to do It.
This will help another, and I'm doing a tuto of installing nominatim, and osrm, with apache...
server apache2 proxy port-forwarding reverse-proxy
server apache2 proxy port-forwarding reverse-proxy
asked Jun 13 '16 at 19:19
DarckBlezzerDarckBlezzer
240411
240411
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Well you have the service running in port 5000, you want to show,proxy you service that is in 127.0.0.1:5000 or in mywebsite.com:5000 to a subdomain or domain like osrm.mywebsite.com or myosrmwebsite.com
You'll need to enable mod_proxy in Apache2 first. So run these commands as root, or sudo:
a2enmod proxy
a2enmod proxy_http
Edit your hosts file
# if you don't have access try with sudo
nano /etc/hosts
Add entry to your hosts file
# path /etc/hosts
127.0.0.1 subdomainname.mywebsite.com
87.164.25.1 subdomainname.mywebsite.com
The 87.164.25.1 is an example of ip public it isn't real
After this we need to go to /etc/apache2/sites-available
cd /etc/apache2/sites-available
Create a file *.conf for our subdomain or domain
nano subdomainname.mywebsite.com.conf
In this file we are going to create a config to proxy our port to servername
#filename 'subdomainname.mywebsite.com.conf'
#dir /etc/apache2/sites-available
<VirtualHost *:80>
ServerName osrm.website.com # my subdomain or website name server
ProxyPass / http://localhost:5000/
ProxyPassReverse / http://localhost:5000/
ProxyRequests Off
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
note: If when you try to see the website through the url, and nothing happened, try change <VirtualHost *:80> to <VirtualHost 87.164.25.1:80> the ip that server has.
Add the *.conf file to apache with this command, and check the list of commands.
To enable it
sudo a2ensite subdomainname.mywebsite.com.conf
To disable it
sudo a2dissite subdomainname.mywebsite.com.conf
To list all sites enables
# if you want to know what sites are enables.. or check if it is enable
apache2ctl -S
To reload apache or restart
# only reload the config files without restart
sudo service apache2 reload
# restart apache
sudo service apache2 restart
Websites of reference
- How to setup subdomain on Ubuntu Server 14.04
- Get a list of all virtual hosts which are defined in all apache configuration files
- Proxy port to site - example No. 1 - https://serverfault.com/a/140161
- Proxy port to site - example No. 2 - http://freedif.org/how-to-redirect-a-port-to-a-sub-domain-proxypass/
- Proxy port to site - example No. 3 - https://stackoverflow.com/a/8442270/5287072
- Proxy port to site - example No. 4 - https://stackoverflow.com/a/589479/5287072
* I put a title and url if for some reason it fail...
Thank you!!! I followed every step and it works like a charm. I was forwarding to my SpringBoot application running at port 9582. Just a side note though, make sure you put a forward slash in front of your 8080 otherwise the reverse proxy would struggle.
– kholofelo Maloma
yesterday
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f786564%2fredirect-port-5000-osrm-a-subdomain-in-apache2%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Well you have the service running in port 5000, you want to show,proxy you service that is in 127.0.0.1:5000 or in mywebsite.com:5000 to a subdomain or domain like osrm.mywebsite.com or myosrmwebsite.com
You'll need to enable mod_proxy in Apache2 first. So run these commands as root, or sudo:
a2enmod proxy
a2enmod proxy_http
Edit your hosts file
# if you don't have access try with sudo
nano /etc/hosts
Add entry to your hosts file
# path /etc/hosts
127.0.0.1 subdomainname.mywebsite.com
87.164.25.1 subdomainname.mywebsite.com
The 87.164.25.1 is an example of ip public it isn't real
After this we need to go to /etc/apache2/sites-available
cd /etc/apache2/sites-available
Create a file *.conf for our subdomain or domain
nano subdomainname.mywebsite.com.conf
In this file we are going to create a config to proxy our port to servername
#filename 'subdomainname.mywebsite.com.conf'
#dir /etc/apache2/sites-available
<VirtualHost *:80>
ServerName osrm.website.com # my subdomain or website name server
ProxyPass / http://localhost:5000/
ProxyPassReverse / http://localhost:5000/
ProxyRequests Off
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
note: If when you try to see the website through the url, and nothing happened, try change <VirtualHost *:80> to <VirtualHost 87.164.25.1:80> the ip that server has.
Add the *.conf file to apache with this command, and check the list of commands.
To enable it
sudo a2ensite subdomainname.mywebsite.com.conf
To disable it
sudo a2dissite subdomainname.mywebsite.com.conf
To list all sites enables
# if you want to know what sites are enables.. or check if it is enable
apache2ctl -S
To reload apache or restart
# only reload the config files without restart
sudo service apache2 reload
# restart apache
sudo service apache2 restart
Websites of reference
- How to setup subdomain on Ubuntu Server 14.04
- Get a list of all virtual hosts which are defined in all apache configuration files
- Proxy port to site - example No. 1 - https://serverfault.com/a/140161
- Proxy port to site - example No. 2 - http://freedif.org/how-to-redirect-a-port-to-a-sub-domain-proxypass/
- Proxy port to site - example No. 3 - https://stackoverflow.com/a/8442270/5287072
- Proxy port to site - example No. 4 - https://stackoverflow.com/a/589479/5287072
* I put a title and url if for some reason it fail...
Thank you!!! I followed every step and it works like a charm. I was forwarding to my SpringBoot application running at port 9582. Just a side note though, make sure you put a forward slash in front of your 8080 otherwise the reverse proxy would struggle.
– kholofelo Maloma
yesterday
add a comment |
Well you have the service running in port 5000, you want to show,proxy you service that is in 127.0.0.1:5000 or in mywebsite.com:5000 to a subdomain or domain like osrm.mywebsite.com or myosrmwebsite.com
You'll need to enable mod_proxy in Apache2 first. So run these commands as root, or sudo:
a2enmod proxy
a2enmod proxy_http
Edit your hosts file
# if you don't have access try with sudo
nano /etc/hosts
Add entry to your hosts file
# path /etc/hosts
127.0.0.1 subdomainname.mywebsite.com
87.164.25.1 subdomainname.mywebsite.com
The 87.164.25.1 is an example of ip public it isn't real
After this we need to go to /etc/apache2/sites-available
cd /etc/apache2/sites-available
Create a file *.conf for our subdomain or domain
nano subdomainname.mywebsite.com.conf
In this file we are going to create a config to proxy our port to servername
#filename 'subdomainname.mywebsite.com.conf'
#dir /etc/apache2/sites-available
<VirtualHost *:80>
ServerName osrm.website.com # my subdomain or website name server
ProxyPass / http://localhost:5000/
ProxyPassReverse / http://localhost:5000/
ProxyRequests Off
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
note: If when you try to see the website through the url, and nothing happened, try change <VirtualHost *:80> to <VirtualHost 87.164.25.1:80> the ip that server has.
Add the *.conf file to apache with this command, and check the list of commands.
To enable it
sudo a2ensite subdomainname.mywebsite.com.conf
To disable it
sudo a2dissite subdomainname.mywebsite.com.conf
To list all sites enables
# if you want to know what sites are enables.. or check if it is enable
apache2ctl -S
To reload apache or restart
# only reload the config files without restart
sudo service apache2 reload
# restart apache
sudo service apache2 restart
Websites of reference
- How to setup subdomain on Ubuntu Server 14.04
- Get a list of all virtual hosts which are defined in all apache configuration files
- Proxy port to site - example No. 1 - https://serverfault.com/a/140161
- Proxy port to site - example No. 2 - http://freedif.org/how-to-redirect-a-port-to-a-sub-domain-proxypass/
- Proxy port to site - example No. 3 - https://stackoverflow.com/a/8442270/5287072
- Proxy port to site - example No. 4 - https://stackoverflow.com/a/589479/5287072
* I put a title and url if for some reason it fail...
Thank you!!! I followed every step and it works like a charm. I was forwarding to my SpringBoot application running at port 9582. Just a side note though, make sure you put a forward slash in front of your 8080 otherwise the reverse proxy would struggle.
– kholofelo Maloma
yesterday
add a comment |
Well you have the service running in port 5000, you want to show,proxy you service that is in 127.0.0.1:5000 or in mywebsite.com:5000 to a subdomain or domain like osrm.mywebsite.com or myosrmwebsite.com
You'll need to enable mod_proxy in Apache2 first. So run these commands as root, or sudo:
a2enmod proxy
a2enmod proxy_http
Edit your hosts file
# if you don't have access try with sudo
nano /etc/hosts
Add entry to your hosts file
# path /etc/hosts
127.0.0.1 subdomainname.mywebsite.com
87.164.25.1 subdomainname.mywebsite.com
The 87.164.25.1 is an example of ip public it isn't real
After this we need to go to /etc/apache2/sites-available
cd /etc/apache2/sites-available
Create a file *.conf for our subdomain or domain
nano subdomainname.mywebsite.com.conf
In this file we are going to create a config to proxy our port to servername
#filename 'subdomainname.mywebsite.com.conf'
#dir /etc/apache2/sites-available
<VirtualHost *:80>
ServerName osrm.website.com # my subdomain or website name server
ProxyPass / http://localhost:5000/
ProxyPassReverse / http://localhost:5000/
ProxyRequests Off
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
note: If when you try to see the website through the url, and nothing happened, try change <VirtualHost *:80> to <VirtualHost 87.164.25.1:80> the ip that server has.
Add the *.conf file to apache with this command, and check the list of commands.
To enable it
sudo a2ensite subdomainname.mywebsite.com.conf
To disable it
sudo a2dissite subdomainname.mywebsite.com.conf
To list all sites enables
# if you want to know what sites are enables.. or check if it is enable
apache2ctl -S
To reload apache or restart
# only reload the config files without restart
sudo service apache2 reload
# restart apache
sudo service apache2 restart
Websites of reference
- How to setup subdomain on Ubuntu Server 14.04
- Get a list of all virtual hosts which are defined in all apache configuration files
- Proxy port to site - example No. 1 - https://serverfault.com/a/140161
- Proxy port to site - example No. 2 - http://freedif.org/how-to-redirect-a-port-to-a-sub-domain-proxypass/
- Proxy port to site - example No. 3 - https://stackoverflow.com/a/8442270/5287072
- Proxy port to site - example No. 4 - https://stackoverflow.com/a/589479/5287072
* I put a title and url if for some reason it fail...
Well you have the service running in port 5000, you want to show,proxy you service that is in 127.0.0.1:5000 or in mywebsite.com:5000 to a subdomain or domain like osrm.mywebsite.com or myosrmwebsite.com
You'll need to enable mod_proxy in Apache2 first. So run these commands as root, or sudo:
a2enmod proxy
a2enmod proxy_http
Edit your hosts file
# if you don't have access try with sudo
nano /etc/hosts
Add entry to your hosts file
# path /etc/hosts
127.0.0.1 subdomainname.mywebsite.com
87.164.25.1 subdomainname.mywebsite.com
The 87.164.25.1 is an example of ip public it isn't real
After this we need to go to /etc/apache2/sites-available
cd /etc/apache2/sites-available
Create a file *.conf for our subdomain or domain
nano subdomainname.mywebsite.com.conf
In this file we are going to create a config to proxy our port to servername
#filename 'subdomainname.mywebsite.com.conf'
#dir /etc/apache2/sites-available
<VirtualHost *:80>
ServerName osrm.website.com # my subdomain or website name server
ProxyPass / http://localhost:5000/
ProxyPassReverse / http://localhost:5000/
ProxyRequests Off
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
note: If when you try to see the website through the url, and nothing happened, try change <VirtualHost *:80> to <VirtualHost 87.164.25.1:80> the ip that server has.
Add the *.conf file to apache with this command, and check the list of commands.
To enable it
sudo a2ensite subdomainname.mywebsite.com.conf
To disable it
sudo a2dissite subdomainname.mywebsite.com.conf
To list all sites enables
# if you want to know what sites are enables.. or check if it is enable
apache2ctl -S
To reload apache or restart
# only reload the config files without restart
sudo service apache2 reload
# restart apache
sudo service apache2 restart
Websites of reference
- How to setup subdomain on Ubuntu Server 14.04
- Get a list of all virtual hosts which are defined in all apache configuration files
- Proxy port to site - example No. 1 - https://serverfault.com/a/140161
- Proxy port to site - example No. 2 - http://freedif.org/how-to-redirect-a-port-to-a-sub-domain-proxypass/
- Proxy port to site - example No. 3 - https://stackoverflow.com/a/8442270/5287072
- Proxy port to site - example No. 4 - https://stackoverflow.com/a/589479/5287072
* I put a title and url if for some reason it fail...
edited 6 hours ago
answered Jun 13 '16 at 19:19
DarckBlezzerDarckBlezzer
240411
240411
Thank you!!! I followed every step and it works like a charm. I was forwarding to my SpringBoot application running at port 9582. Just a side note though, make sure you put a forward slash in front of your 8080 otherwise the reverse proxy would struggle.
– kholofelo Maloma
yesterday
add a comment |
Thank you!!! I followed every step and it works like a charm. I was forwarding to my SpringBoot application running at port 9582. Just a side note though, make sure you put a forward slash in front of your 8080 otherwise the reverse proxy would struggle.
– kholofelo Maloma
yesterday
Thank you!!! I followed every step and it works like a charm. I was forwarding to my SpringBoot application running at port 9582. Just a side note though, make sure you put a forward slash in front of your 8080 otherwise the reverse proxy would struggle.
– kholofelo Maloma
yesterday
Thank you!!! I followed every step and it works like a charm. I was forwarding to my SpringBoot application running at port 9582. Just a side note though, make sure you put a forward slash in front of your 8080 otherwise the reverse proxy would struggle.
– kholofelo Maloma
yesterday
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f786564%2fredirect-port-5000-osrm-a-subdomain-in-apache2%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown