Forums / Upgrading to 1.5.x / Renaming Admin - instructions are different than what's in the files

Renaming Admin - instructions are different than what's in the files

Locked

Views: 2,288

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
1 Jan 2012, 9:46 PM
#1
alyssakay avatar

alyssakay

New Zenner

Join Date:
Oct 2009
Posts:
15
Plugin Contributions:
0

Renaming Admin - instructions are different than what's in the files

Okay so I'm doing searches for this as it MUST be in this forum SOMEwhere and I am just not finding it yet!

(It seems to me that maybe this is also a small bug, and it should have a different tutorial link in the installs for the newer versions)

I'm trying to secure a brand new install of the latest release (1.5.0)

I wish to rename the admin dir ... as i normally do.

The instructions that you find on THIS page: zc_install/index.php?main_page=finished

...say the following:

**NEXT STEPS
For security, YOU NEED TO RENAME your /admin/ folder to a name less likely to be 'guessed' by someone probing your site for illegitimate access. There's an FAQ article on Renaming Your Admin Folder which will guide you through the simple steps.

Also for security, you will need to reset permissions on your configure.php files located in the /admin/includes/ and /includes/ folders back to read-only mode before allowing people to access your store.**

when you click on the link for the instructions: https://www.zen-cart.com/tutorials/index.php?article=33 it says there:

**Change ONLY THE WORD admin, in 3 places, AS SHOWN HERE:

Change this section:

define('DIR_WS_ADMIN', '/admin/');
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_ADMIN', '/admin/');
define('DIR_WS_HTTPS_CATALOG', '/');

And this section:

define('DIR_FS_ADMIN', '/home/mystore.com/www/public/admin/');
define('DIR_FS_CATALOG', '/home/mystore.com/www/public/');

You will end up with something that looks like this:

define('DIR_WS_ADMIN', '/mysecretadminarea/');
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_ADMIN', '/mysecretadminarea/');
define('DIR_WS_HTTPS_CATALOG', '/');

And:

define('DIR_FS_ADMIN', '/home/mystore.com/www/public/mysecretadminarea/');
define('DIR_FS_CATALOG', '/home/mystore.com/www/public/');**

However the configure.php file on MY server after install says:

define('DIR_WS_ADMIN', preg_replace('#^' . str_replace('-', '-', $p1) . '#', '', dirname($_SERVER['SCRIPT_NAME'])) . '/');
define('DIR_WS_CATALOG', '//');
define('DIR_WS_HTTPS_ADMIN', preg_replace('#^' . str_replace('-', '-', $p2) . '#', '', dirname($_SERVER['SCRIPT_NAME'])) . '/');
define('DIR_WS_HTTPS_CATALOG', '/
/');

And

define('DIR_FS_ADMIN', realpath(dirname(FILE) . '/../') . '/');
define('DIR_FS_CATALOG', '/home//public_html//');

And

define('DIR_FS_ADMIN', realpath(dirname(FILE) . '/../') . '/');
define('DIR_FS_CATALOG', '/home/alyssak/public_html/****/');

Soooooooooo should I replace ...

preg_replace('#^' . str_replace('-', '-', $p1) . '#', '', dirname($_SERVER['SCRIPT_NAME'])) . '

and

preg_replace('#^' . str_replace('-', '-', $p2) . '#', '', dirname($_SERVER['SCRIPT_NAME'])) . '

and

realpath(dirname(FILE) . '/../') . '

... with '/NewSecretAdminDirName

Just seems like those are instructions for an older configure.php file that was a bit simpler ... and not for what is actually included in the new installations, so it left me a little unsure of how to best proceed without breaking the store right out the gate. lol

I'll keep searching to see if I can find the answer myself, I'm SURE this HAS to have been addressed at leas a few times already by now!

Oh and I wasn't really quite sure where the best place to post this question would be (as this isn't an upgrade install, but a fresh install of 1.5.0) if it needs to be moved I understand and sorry if I guessed incorrectly!

1 Jan 2012, 9:48 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Renaming Admin - instructions are different than what's in the files

You'll also note that in the article 33 tutorial, the whole step about editing configure.php is prefaced with a note to skip that step if you're using v1.5.0

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

1 Jan 2012, 9:53 PM
#3
alyssakay avatar

alyssakay

New Zenner

Join Date:
Oct 2009
Posts:
15
Plugin Contributions:
0

Re: Renaming Admin - instructions are different than what's in the files

Aw hell. You are so right! Somehow my eye skimmed RIGHT over that purple bolded text even though it was RIGHT there!

I am ashamed! :blush:

Thank you!

1 Jan 2012, 11:31 PM
#4
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: Renaming Admin - instructions are different than what's in the files

This is one of the sweet things about 1.5. No more futzing with the configure.php files when renaming the admin. I also love the fact that it won't even let you login to admin until you do.

The best way to learn is to try stuff. But, back it up first.

2 Jan 2012, 4:55 PM
#5
wmorris avatar

wmorris

Totally Zenned

Join Date:
Aug 2007
Location:
Amarillo, Tx
Posts:
1,683
Plugin Contributions:
0

Re: Renaming Admin - instructions are different than what's in the files

On the same subject... Do I have to rename the admin as it was in 1.3.9 versions or does it done automatically?

2 Jan 2012, 5:37 PM
#6
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: Renaming Admin - instructions are different than what's in the files

In 1.39 you need to rename the admin folder and edit the configure.php files to reflect the new name.

The best way to learn is to try stuff. But, back it up first.

2 Jan 2012, 7:16 PM
#7
wmorris avatar

wmorris

Totally Zenned

Join Date:
Aug 2007
Location:
Amarillo, Tx
Posts:
1,683
Plugin Contributions:
0

Re: Renaming Admin - instructions are different than what's in the files

RescoCCC:

In 1.39 you need to rename the admin folder and edit the configure.php files to reflect the new name.

That is not what I am asking.... I am asking on the new version 1.5 do I need to rename the admin folder just like I did in 1.3.9 version for security?

2 Jan 2012, 7:42 PM
#8
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: Renaming Admin - instructions are different than what's in the files

bkeaton:

That is not what I am asking.... I am asking on the new version 1.5 do I need to rename the admin folder just like I did in 1.3.9 version for security?

You still need to rename it. In fact, you can't login until you do.

The best way to learn is to try stuff. But, back it up first.

2 Jan 2012, 7:43 PM
#9
wmorris avatar

wmorris

Totally Zenned

Join Date:
Aug 2007
Location:
Amarillo, Tx
Posts:
1,683
Plugin Contributions:
0

Re: Renaming Admin - instructions are different than what's in the files

RescoCCC:

You still need to rename it. In fact, you can't login until you do.

That is what I thought

4 Jan 2012, 2:43 AM
#10
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Renaming Admin - instructions are different than what's in the files

A curious chicken-and-egg situation: You can't login to the admin until its folder name is changed (and zc_install deleted), but the admin link from the installation success page doesn't work after the folder is renamed.

The installation success link should reflect something of this so that new users aren't faced with a predictable error or scary warning as their first interaction with their new admin. Something to think about for the next update...