• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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