Answer the question
In order to leave comments, you need to log in
How to make a subdomain on a separate port in Ubuntu?
There is a site on the Jam.Python web framework , when it starts it takes the address 0.0.0.0 on port 8080 . There is also an Apache
web server with a PHP7 site available at 127.0.0.1 on port 80 .
In the /etc/hosts file, I added the address with the application port:
127.0.0.1 localhost
0.0.0.0:8080 crm.localhost
[email protected]:/var/www/crm$ python server.py
* Running on http://0.0.0.0:8080/ (Press CTRL+C to quit)
Answer the question
In order to leave comments, you need to log in
I solved everything many times easier, without installing anything extra, I posted the following code on a subdomain:
<!DOCTYPE html><html><head>
<meta charset="utf-8">
<title>TITLE</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
border: none;
}
</style>
</head><body>
<iframe src="<?php print($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].':8080'.$_SERVER['REQUEST_URI']) ?>"></iframe>
</body></html>
Understand first what 0.0.0.0 is and how /etc/hosts works before adding nonsense there.
you're doing nonsense. Leave hosts alone, take nginx, apache with PHP set to 8081 and configure the rest in nginx
1. On the second line, you entered fundamentally incorrect information into /etc/hosts.
There can be no ports and 0.0.0.0 to create DNS records also does not need to be done - use either 127.0.0.1 if you need access via localhost, or the ip address of the external interface if you need access over the network.
2. Create a separate VirtualHost in apache for your domain, or use default virtualhost if there is one site.
3. Everyone on the network who will access your domain - you also need to make entries in the local hosts file.
Make /etc/hosts:
127.0.0.1 localhost
127.0.0.1 crm.localhost
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question