How to disable redirection 80 to 5000

Questions and mods regarding system management may go here
Forum rules
We've moved! Head over to Synology Community (community.synology.com) to meet up with our team and other Synology enthusiasts!
proxy64
Trainee
Trainee
Posts: 12
Joined: Sun Sep 13, 2009 11:56 am

How to disable redirection 80 to 5000

Unread post by proxy64 » Tue Feb 02, 2010 12:59 pm

Hi ,
How can I disable auto redirection from port 80 to port 5000?
When I type http://mydomian.com there is an auto redirection to http://mydomian.com:5000

thanks

User avatar
HarryPotter
Honorary Moderator
Honorary Moderator
Posts: 19674
Joined: Mon Oct 23, 2006 12:48 pm
Location: Switzerland

Re: How to disable redirection 80 to 5000

Unread post by HarryPotter » Tue Feb 02, 2010 6:40 pm

Enable Web Station and put an index.htm, index.html or index.php file to the web folder.
*Please do not Private Message me for support questions; leave it on the forum so all members can learn. Thanks!*

DS718+ / DSM 6.2-23511 / ST4000VN000-2AH166 / SA400S37120G SSD cache /16 GB RAM
DS415+ / DSM 6.2-23511

LMS 7.9.1-166, 2 Squeezebox 3 + Boom

APC Smart UPS SUA750i

dwallace
I'm New!
I'm New!
Posts: 1
Joined: Wed Feb 23, 2011 7:21 pm

Re: How to disable redirection 80 to 5000

Unread post by dwallace » Wed Feb 23, 2011 7:40 pm

Seriously there has to be a better way than this. To solve a a stupid security flaw in the management Service you have to turn ON the web server and create content?

This redirect has to be driven by a conf file or a .htaccess file directive. Surely someone from Synology can shed some light on this as to how do this.

The 511+ is supposed to be a SME device, and it redirects every fool who can't tell the difference between //192.168.123.50 and \\192.168.123.50 into the admin page?

User avatar
axj
Specialist
Specialist
Posts: 1059
Joined: Fri Jan 02, 2009 10:59 am
Location: Esbjerg, Danmark

Re: How to disable redirection 80 to 5000

Unread post by axj » Wed Mar 09, 2011 9:11 am

@dwallace wrote
This redirect has to be driven by a conf file or a .htaccess file directive.
If you don't have anything to use your internet for, you can have an index.php with this content:

Code: Select all

<?
header('Location: http://jp.dk/');
?>
Instead of a danish newspaper, you may put whatever you like!!
That's effectively: no web-site here!!
DS509+ 4*1TB Raid+1TB DSM 4.0-2219. Logitech BOOM+Duet 7.6.1, WebCam: Linksys WVC54GCA + TrendNet TV-IP121
DS212+ 1TB & D-Link DIR-685, HP C7280, Dell 3100cn. iPad3, Programming Pascal, Clarion 5.5, html/php. http://axj.dk

budul
I'm New!
I'm New!
Posts: 1
Joined: Sat Apr 23, 2011 3:25 pm

Re: How to disable redirection 80 to 5000

Unread post by budul » Sat Apr 23, 2011 3:41 pm

I was, as well, looking for this "hardcoded" feature...
Spent few hours to find out where this configuration reside.
And finally got it:
vi /usr/syno/synoman/phpsrc/web/sample.php
navigate to the end of file and comment out "else" statement:

Code: Select all

#else {             
#       header("Location: ".$admin_link); 
#}
save the file (you has to be root)
and restart Apache:
/usr/syno/etc/rc.d/S97apache-user.sh restart

fands
I'm New!
I'm New!
Posts: 5
Joined: Sat Apr 30, 2011 2:39 pm

Re: How to disable redirection 80 to 5000

Unread post by fands » Sun May 01, 2011 12:28 pm

budul wrote:I was, as well, looking for this "hardcoded" feature...
Spent few hours to find out where this configuration reside.
And finally got it:
vi /usr/syno/synoman/phpsrc/web/sample.php
navigate to the end of file and comment out "else" statement:

Code: Select all

#else {             
#       header("Location: ".$admin_link); 
#}
save the file (you has to be root)
and restart Apache:
/usr/syno/etc/rc.d/S97apache-user.sh restart
I have the same issue, which is driving me crazy, why can't we simply turn this off????
With no index.php/html in the webroot it redirects to port 5000.
With this file it works, BUT when I add a htaccess with htpasswd it redirects me again to port 5000....

I tried to uncomment the line above in sample.php, this works without a htpasswd.
But with a htpasswd is causes a internal server error (500) so I cant access my files anymore :(

How can I turn this redirection off and have a htpasswd in place????

fands
I'm New!
I'm New!
Posts: 5
Joined: Sat Apr 30, 2011 2:39 pm

Re: How to disable redirection 80 to 5000

Unread post by fands » Sun May 01, 2011 6:03 pm

I found my problem with htpasswd redirecting to 5000, the permissions were not set correctly on the htpasswd causing an internal server error. (Apache had no read permissions)

It seems that the synology is redirecting to port 5000 when Apache-user instance is giving errors (like with errors in htaccess/htpasswd), I would prefer seeing these errors so I know my htaccess is failing.
Redirecting can be disabled by using advice from budul, or rename the entire sample.php to sample.php.BAK.

moudsen
Trainee
Trainee
Posts: 10
Joined: Fri Oct 11, 2013 12:26 pm

Re: How to disable redirection 80 to 5000

Unread post by moudsen » Fri Oct 11, 2013 12:32 pm

Removing the sample.php file is actually "cheating" a little, and does not really solve the issue in its root. Better is to edit the persistent Apache configuration file to prevent recreation of sample.php when an update is installed.

Goto /usr/syno/apache/conf
Edit httpd.conf-user
Look for "sample"
Comment out the error handlers
Save the file
restart Apache "/usr/syno/etc/rc.d/S97apache-user.sh httpd restart"
Done.

Code: Select all

<IfDefine HAVE_PHP>
#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
# Forbidden (eg. list files in a directory)
#ErrorDocument 403 /webdefault/sample.php?status=403&from=user
# Page not found in apache
#ErrorDocument 404 /webdefault/sample.php?status=404&from=user
# Page not found in thttpd
#ErrorDocument 500 /webdefault/sample.php?status=500&from=user
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#
</IfDefine>

realjobe
Experienced
Experienced
Posts: 108
Joined: Tue Nov 17, 2009 7:02 am

Re: How to disable redirection 80 to 5000

Unread post by realjobe » Mon Nov 06, 2017 3:43 pm

This does not apply to DSM 6.x?
I really need to free synology's port 80 being forwarded to 5000 automatically, because I need it to free for OpenVPN for TCP 80.

Locked

Return to “System Managment Mods”