• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Problem with default domain on IP always www 301 redirect

zanedev

New Pleskian
---------------------------------------------------------------
PRODUCT, VERSION, MICROUPDATE, OPERATING SYSTEM, ARCHITECTURE
10.4.4 Update #47, last updated at Nov 4, 2012 03:20 AM
CloudLinux

PROBLEM DESCRIPTION
Every default domain for any shared ip has a redirect to from www to non www. Seems to have saved/cached an .htaccess file from a previously default domain for a shared ip. Refreshing all vhosts via command line fails. Seems to have started after latest micro update.

STEPS TO REPRODUCE
Create new domain on a shared IP then set as default for that ip, go to that ip in browser. Try to rectify by running /usr/local/psa/admin/sbin/websrvmng -v -a


ACTUAL RESULT
The server will respond with a 301 redirect to www.ip.address which doesn't resolve to the ip because it has the www in front of ip address.

Running websrvmng command above throws error: websrvmng: /usr/local/psa/admin/bin/httpdmng execution failed:
Unable to register configuration file: template=domainVhost, domain.id=174
PleskUtilException: /usr/local/psa/admin/bin/httpdmng '--reconfigure-domains' ' [list of all domains here]' failed with message: Empty error message from utility.
file: /usr/local/psa/admin/plib/common_func.php3
line: 1065
code: 0
trace: #0 /usr/local/psa/admin/plib/common_func.php3(983): util_exec('httpdmng', Array, Array, 'msg', NULL)
#1 /usr/local/psa/admin/plib/Os.php(17): smart_exec('httpdmng', Array, Array, 'msg')
#2 /usr/local/psa/admin/plib/Os.php(28): Os::exec('httpdmng', Array, 'msg')
#3 /usr/local/psa/admin/plib/api-common/Httpdmng.php(101): Os::execEx('httpdmng', Array)
#4 /usr/local/psa/admin/sbin/httpdmng(13): Httpdmng->__construct()
#5 {main}

Execution failed.
Command: httpdmng
Arguments: Array
(
[0] => --reconfigure-domains
[1] => [list of all domains here]
)

EXPECTED RESULT
Default domain should resolve to the ip in the browser and the websrvmng command should work.

ANY ADDITIONAL INFORMATION
It appears to be pulling in an .htaccess file that I recently added on a different default domain for a different shared ip because it was a command to redirect all non www traffic to the www version. I tailed the logs for all domains and can't figure out where it is getting this redirect from. Also appears to have just started after latest micro update.
--------------------------------------------------------------
 
Funny happened again a year later and no resolution

Googled the problem and found my old post. Now not sure how I fixed it before :( Anybody have any ideas?

Thanks

---------------------------------------------------------------
PRODUCT, VERSION, MICROUPDATE, OPERATING SYSTEM, ARCHITECTURE
10.4.4 Update #47, last updated at Nov 4, 2012 03:20 AM
CloudLinux

PROBLEM DESCRIPTION
Every default domain for any shared ip has a redirect to from www to non www. Seems to have saved/cached an .htaccess file from a previously default domain for a shared ip. Refreshing all vhosts via command line fails. Seems to have started after latest micro update.

STEPS TO REPRODUCE
Create new domain on a shared IP then set as default for that ip, go to that ip in browser. Try to rectify by running /usr/local/psa/admin/sbin/websrvmng -v -a


ACTUAL RESULT
The server will respond with a 301 redirect to www.ip.address which doesn't resolve to the ip because it has the www in front of ip address.

Running websrvmng command above throws error: websrvmng: /usr/local/psa/admin/bin/httpdmng execution failed:
Unable to register configuration file: template=domainVhost, domain.id=174
PleskUtilException: /usr/local/psa/admin/bin/httpdmng '--reconfigure-domains' ' [list of all domains here]' failed with message: Empty error message from utility.
file: /usr/local/psa/admin/plib/common_func.php3
line: 1065
code: 0
trace: #0 /usr/local/psa/admin/plib/common_func.php3(983): util_exec('httpdmng', Array, Array, 'msg', NULL)
#1 /usr/local/psa/admin/plib/Os.php(17): smart_exec('httpdmng', Array, Array, 'msg')
#2 /usr/local/psa/admin/plib/Os.php(28): Os::exec('httpdmng', Array, 'msg')
#3 /usr/local/psa/admin/plib/api-common/Httpdmng.php(101): Os::execEx('httpdmng', Array)
#4 /usr/local/psa/admin/sbin/httpdmng(13): Httpdmng->__construct()
#5 {main}

Execution failed.
Command: httpdmng
Arguments: Array
(
[0] => --reconfigure-domains
[1] => [list of all domains here]
)

EXPECTED RESULT
Default domain should resolve to the ip in the browser and the websrvmng command should work.

ANY ADDITIONAL INFORMATION
It appears to be pulling in an .htaccess file that I recently added on a different default domain for a different shared ip because it was a command to redirect all non www traffic to the www version. I tailed the logs for all domains and can't figure out where it is getting this redirect from. Also appears to have just started after latest micro update.
--------------------------------------------------------------
 
Back
Top