Jump to content
View in the app

A better way to browse. Learn more.

The Uniform Server Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Redirects to localhost:127 instead of localhost:80

Featured Replies

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?

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

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

  • Author

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.

  • 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

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

  • 4 weeks later...
  • Author

I have finally got round to implementing this and... you guys are stars!

 

Thanks for this. It now works perfectly.

 

:)

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...

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.