Jump to content
The Uniform Server Community

Redirects to localhost:127 instead of localhost:80


huw
 Share

Recommended Posts

Hi

 

Am running Coral on a USB stick in windows. I previously had 3.5 working fine. Coral is working well except for a url problem.

 

When I start the server or try to open phpmyadmin I get redirected to localhost:127/us_...etc and get an "Unable to connect". When I change the :127 to :80 it connects fine.

 

Apache port is 127.

 

I can't find where the urls in redirect.html get generated. I did find "This part of the URL http://localhost:80/ is automatically adjusted to match the server port configuration" (start_user_configuration.html#Change Splash Page).

 

Why is this happening?

Link to comment
Share on other sites

Great question! I haven't a clue yet as to why. If it's only phpMyAdmin that gives you the quirky problem, I'd say that something got messed up when the location edits were done during your transfer to the USB stick.

 

It's more likely that you have a config file error. Take a look at lines 569-576 in core_functions_inc.vbs. It calls us_get_apache_port(), which reads the httpd.conf file (lines 218-222) to get the port number. The port number is identified by the "Listen" directive.

If you have more than one "Listen" line active in the httpd.conf, this could be the trouble.

 

Regards,

BobS

Link to comment
Share on other sites

Then again...

There SEEMS to be a BUG in the vhosts setup. :)

 

Looks like a bad regression when we went to version 8.2.0. :(

A problem we had with the port-setting routines has MAY have crept back in.

More checking in progress.... :blink:

 

{edited} This isn't related to vhosts. Sorry, red herring.

 

Regards,

BobS

Link to comment
Share on other sites

Thanks for the speedy replies, BobS.

If it's only phpMyAdmin...

It's not - its's also the splash page, server-status, ...
Take a look at lines 569-576 in core_functions_inc.vbs. It calls us_get_apache_port(), which reads the httpd.conf file (lines 218-222) to get the port number. The port number is identified by the "Listen" directive.

If you have more than one "Listen" line active in the httpd.conf, this could be the trouble.

There's only one listen in httpd. The core_functions_inc.vbs file includes:

port = us_get_apache_port()

I'm sorry but my knowledge of Apache is extremely limited, but the server status shows Apache port as 127, but Listen in httpd refers to 80 and I can access phpmyadmin, etc., and my pages in \www if I use 80. Shouldn't these be the same?

 

I also notice that Apache Virtual Hosts gives G:\UniServer\vhosts\*** as the Document Root but this vhosts folder does not exist.

Link to comment
Share on other sites

  • 2 months later...

Great question! I haven't a clue yet as to why. If it's only phpMyAdmin that gives you the quirky problem, I'd say that something got messed up when the location edits were done during your transfer to the USB stick.

 

It's more likely that you have a config file error. Take a look at lines 569-576 in core_functions_inc.vbs. It calls us_get_apache_port(), which reads the httpd.conf file (lines 218-222) to get the port number. The port number is identified by the "Listen" directive.

If you have more than one "Listen" line active in the httpd.conf, this could be the trouble.

 

Regards,

BobS

 

It seems to be assuming the Listen only specifies the port.

The replacement below gets stuff working for Listen 127.0.0.1:whateverport

 

 

' Returns port number configured in httpd.conf

Function us_get_apache_port()

us_get_apache_port = us_get_port("^Listen\s+(?:\S+:)?(\d+)", USF_APACHE_CNF)

End Function

Link to comment
Share on other sites

I thought 127 was rather suspect!. Thanks, psinnot! Since the Listen directive CAN have both IP and port, your code change may be important.

 

OTOH, using Listen 127.0.0.1:80 will restrict the server to requests ONLY from the localhost, which may be confusing if, for example, you want to allow intranet access (from 192.168.x.x). There are other features that RELY on the Listen directive specifying ONLY the port.

 

huw, it seems that you have used

Listen 127.0.0.1:80

Don't do that! :)

Change it to

Listen 80

 

ALSO, while it is permissible to have more than one Listen directive in the httpd.conf, The Uniform Server support code assumes there will ONLY be one. Let's say you have set your main server for port 83 (Listen 83). That should be the only line. If you have two Listen directives, which should be the primary?

 

Other ports can be specified for vhosts, but that's a separate matter.

 

Regards,

BobS

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...