Forums / Basic Configuration / Renaming Admin Folder

Renaming Admin Folder

Locked
Results 1 to 20 of 33
This thread is locked. New replies are disabled.
27 Sep 2006, 19:24
#1
bgroup99 avatar

bgroup99

Zen Follower

Join Date:
Aug 2006
Posts:
197
Plugin Contributions:
0

Renaming Admin Folder

Hi,

In the process of securing my site I tried to rename the /admin folder as per instructions on the Wiki. I changed all instances of admin to my new name in configure.php. The problem I think is I am unsure of where to save the new configure.php file. I am using the over ride system so should I save the new file as includes/templates/MYTEMPLATE/admin/includes/configure.php?

I don't think so... as it doesn't work. If anyone could advise me on the right path I would greatly appreciate it. Thanks,

Nate
27 Sep 2006, 20:15
#2
tinas avatar

tinas

Totally Zenned

Join Date:
Jan 2005
Posts:
1,090
Plugin Contributions:
0

Re: Renaming Admin Folder

you have a custom template for admin also ? I haven't ever worried about customizing the back end other than logo and email header.

I would assume you put it back where it started at, which in standard zen installs is admin(or new folder name)/includes/

But I guess I can't be positive as I said, I never bother to over ride the admin area.
27 Sep 2006, 21:12
#3
bgroup99 avatar

bgroup99

Zen Follower

Join Date:
Aug 2006
Posts:
197
Plugin Contributions:
0

Re: Renaming Admin Folder

This is directly from the Wiki Docs (see the parts underlined in bold):

"Rename your /admin folder

It is recommended for additional security that you rename your admin directory after installation. This way, it will be significantly harder for hackers to find your admin area or attempt any attack on breaking into it.


(Before making the following changes, make sure to have a current backup of your files and your database.)


A - Open your admin/includes/configure.php, using a simple text editor like notepad. Change all instances of admin to your chosen new admin folder-name. For maximum security, you may want to consider that new folder name should include numbers and a combination of upper and lower case letters. The longer you make this folder's name the more secure it will be. Make sure you leave all the / intact.


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/');


B - Find your Zen Cart™ /admin/ directory, using your FTP software or your webhost File Manager. Rename the directory to match the settings you just made in step A.


C - To login to your admin system you will now have to visit a new URL that matches the new name used in steps A and B above. For example instead of visiting http://www.example.com/admin/ visit http://www.example.com/NeW_NamE4u/. Use of SSL is highly recommonded to protect your and your customers information. To protect the new admin folder name from packet sniffers, use https in the example link above (this of course depends on your server having an SSL certificate installed).


D - You should also protect your admin area by using an .htaccess file similar to the one shown below, and placing it into /admin/includes. This should already exist in Zen Cart™ versions 1.2.7 and greater."

Any ideas? I'd like to get my site secured.

Thanks,

Nate
27 Sep 2006, 22:11
#4
Join Date:
Jul 2005
Posts:
694
Plugin Contributions:
0

Re: Renaming Admin Folder

You're reading too much into it.

Simply rename the admin folder itself to whatever (instead of /admin it can be /myverysecureadminfoldersohackerscantfinditblah if you like) and make the appropriate changes in the mentioned config files.
28 Sep 2006, 13:48
#5
bgroup99 avatar

bgroup99

Zen Follower

Join Date:
Aug 2006
Posts:
197
Plugin Contributions:
0

Re: Renaming Admin Folder

aPurpleMonkey.com:

You're reading too much into it.

Simply rename the admin folder itself to whatever (instead of /admin it can be /myverysecureadminfoldersohackerscantfinditblah if you like) and make the appropriate changes in the mentioned config files.


Are you saying that I don't need to use the over ride system? Just change the configure file and over write it?

Thanks,

Nate
15 Nov 2006, 01:01
#6
loriw avatar

loriw

New Zenner

Join Date:
Nov 2006
Posts:
62
Plugin Contributions:
0

Re: Renaming Admin Folder

Bumping this back up as I have some questions on this that I hope someone will be able to answer.

I am at the point where I have renamed all my admin folders. Now when I go to rename the configure.php when I hit save it gives me the following error message.
[a fatal error or timeout occurred while processing this directive]

What am I doing wrong and did I get to far ahead of myself?

ps. Please talk slow to me as I have never done this type of stuff before. lol
03 Aug 2008, 23:20
#7
dontknowwhatimdoing avatar

dontknowwhatimdoing

Zen Follower

Join Date:
Aug 2008
Posts:
131
Plugin Contributions:
0

Re: Renaming Admin Folder

Sorry to revive a dead topic, but I'm having this same issue... (and this thread didn't help)

I renamed admin in the 3x suggested places in the admin/includes/config.php file.

I also made sure this was identical to the admin directory.

However, every time I try to log into admin after doing this, it says something about Zen Cart not being installed correctly...

Now, I can rename the folder back to "admin" (exactly as the original was).. AND I can put the settings back to "admin".. (instead of the new name I gave)...

i.e. I simply restore the old settings...

and I still get the error page which says that zen cart is not installed correctly/ or theres an error in my config file!

the only way to get things back to normal is to re-install at that point!

PLEASE NOTE! -- the normal store remains unaffected by this... it functions perfectly regardless of these changes.

This doesn't make sense to me... and I can't seem to figure out why I can't change my admin folder... I think this is very important for security--

Unfortunately, the faq mentions nothing about my sitaution, and I don't see an answer for this on google.
04 Aug 2008, 04:18
#8
johnd avatar

johnd

Zen Follower

Join Date:
Oct 2006
Posts:
119
Plugin Contributions:
0

Re: Renaming Admin Folder

dontknowwhatimdoing:

Sorry to revive a dead topic, but I'm having this same issue... (and this thread didn't help)

I renamed admin in the 3x suggested places in the admin/includes/config.php file.

There are 6 places mentioned to replace admin with your new admin folder name in your emails. Did you miss any?
04 Aug 2008, 04:21
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: Renaming Admin Folder

If it's saying it's not installed correctly, after editing your configure.php file, then you've made an error in your changes.

Here's a more up-to-date FAQ which talks about renaming the admin folder: https://www.zen-cart.com/tutorials/index.php?article=73


You did make a backup of that configure.php file before you made any changes to the original right? That way you can go back to the previous settings easily if one of your edits doesn't work the way you desired.
04 Aug 2008, 04:25
#10
johnd avatar

johnd

Zen Follower

Join Date:
Oct 2006
Posts:
119
Plugin Contributions:
0

Re: Renaming Admin Folder

johnd:

There are 6 places mentioned to replace admin with your new admin folder name in your emails. Did you miss any?


Sorry -- I take back what I said in my last post. You are correct. There are 3 places to change admin to the new folder name.
04 Aug 2008, 04:31
#11
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
1

Re: Renaming Admin Folder

the best way to do this

1 rename folder

2 highlight copy the name of the new folder

3 open the configure.php file in your favorite text editor

4 use your search replace utility to find /admin/ and replace it with /whatever/

takes about 20 seconds totall

by using the copy paste you know that they are exactly the same
04 Aug 2008, 18:04
#12
dontknowwhatimdoing avatar

dontknowwhatimdoing

Zen Follower

Join Date:
Aug 2008
Posts:
131
Plugin Contributions:
0

Re: Renaming Admin Folder

Ok--it worked fine this time, I did the exact same thing as before! (exactly the same as you experienced guys instructed)

BUT.. there's one critical difference.

I re-installed zen cart, and I didn't turn on the automatic file based cacheing function.

I'm guessing having this option on somehow prevented me from using the newly created admin area--I only say this because leaving it off, somehow let me make this change that had me stumped yesterday.

I hopefully I can turn on the file based cache module on later--I want my site to run fast :)

Anyway, I'm happy to say my admin area is now secure, thanks for the help :)
06 Aug 2008, 07:31
#13
bjams1974 avatar

bjams1974

New Zenner

Join Date:
Jul 2008
Posts:
2
Plugin Contributions:
0

Re: Renaming Admin Folder

I've encounted a stange sort of side issue. I didn't have any trouble renaming the folders or the files, but apparently I've done something to the paths that the links follow in the admin home.

So you've got the top nav with all the drop down menus...the paths should be something like /configuration.php or /categories.php. That's how the links should be formed.

Somehow I have changed the path so all of the link on the admin home page are misformed/broken and follow the convention:

mysite.comdir_ws_admincategories.php/

I can't seem to find any reference here or the wiki to this issue. I know it's gotta be silly. Any suggestions?
06 Aug 2008, 08:43
#14
higherselfgifts avatar

higherselfgifts

New Zenner

Join Date:
Aug 2008
Posts:
16
Plugin Contributions:
0

Re: Renaming Admin Folder

I really jacked something up? I followed the wiki on renaming your admin for security, everything was fine, then as i was editing all of the page 2 and page 3 .php I could find and still no change on the "more information" box, then I noticed my CUSTOM template was not available? Only the green classic.

So I checked all of the template files and made sure my CUSTOM folders were all in the correct places, everything looked as it should, but my CUSTOM template disappeared from the tools>template selector, but was on the server in the includes/templates folder along with classic and default.

so I took my newly renamed local store/admin file and uploaded all of it to the server. To check and see if my template came back I was surprised to see that my whole admin was not accessible error message "ERROR: admin/includes/configure.php file not found. Suggest running zc_install/index.php?"
I can plainly see that the admin/includes/configure.php is on the server exactly where it should be.

So then I renamed all of the /admin directory back to admin, changed the config.php back to reflect the original admin.
Still receiving "ERROR: admin/includes/configure.php file not found. Suggest running zc_install/index.php?" with the file there staring at me.

how do I run zc_install/index.php? and will it fix this w/o significant data loss?



http://higherselfgifts.com/store do not know what other info I can give to draw this picture?

Thank you in advance
appreciation = bliss
06 Aug 2008, 08:54
#15
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Posts:
4,572
Plugin Contributions:
0

Re: Renaming Admin Folder

bjams1974 & higherselfgifts, it would seem you have both made changes to your Admin 'configure.php' that are incorrect, as far as correct paths go.

The following is from the default file, compare to what your's is.

define('HTTP_SERVER', 'http://localhost');
define('HTTPS_SERVER', 'https://localhost');
define('HTTP_CATALOG_SERVER', 'http://localhost');
define('HTTPS_CATALOG_SERVER', 'https://localhost');

// secure webserver for catalog module and/or admin areas?
define('ENABLE_SSL_CATALOG', 'false');
define('ENABLE_SSL_ADMIN', 'false');

// NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!

// * DIR_WS_* = Webserver directories (virtual/URL)
// these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
define('DIR_WS_ADMIN', '/admin/');
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_ADMIN', '/admin/');
define('DIR_WS_HTTPS_CATALOG', '/');
06 Aug 2008, 15:57
#16
bjams1974 avatar

bjams1974

New Zenner

Join Date:
Jul 2008
Posts:
2
Plugin Contributions:
0

Re: Renaming Admin Folder

Thanks for the help. I guess I need to stop making changes at 1 in the morning. For some reason there was a duplicate folder created with a duplicate config file.
07 Aug 2008, 15:27
#17
higherselfgifts avatar

higherselfgifts

New Zenner

Join Date:
Aug 2008
Posts:
16
Plugin Contributions:
0

Re: Renaming Admin Folder

ok I have checked the code and it looks the same, still getting error messege that
"ERROR: admin/includes/configure.php file not found. Suggest running zc_install/index.php?"
http://www.higherselfgifts.com/store/admin/login.php

I have not seen duplicates of any folders and I can see the admin/includes/configure.php file?


Here is that file.



// Use secure webserver for catalog module and/or admin areas?
define('ENABLE_SSL_CATALOG', 'false');
define('ENABLE_SSL_ADMIN', 'false');

// NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
// * DIR_WS_* = Webserver directories (virtual/URL)
// these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
define('DIR_WS_ADMIN', 'store/admin/');
define('DIR_WS_CATALOG', 'store/');
define('DIR_WS_HTTPS_ADMIN', 'store/admin/');
define('DIR_WS_HTTPS_CATALOG', 'store/');

define('DIR_WS_IMAGES', 'images/');
define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
define('DIR_WS_CATALOG_IMAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'images/');
define('DIR_WS_CATALOG_TEMPLATE', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/templates/');
define('DIR_WS_INCLUDES', 'includes/');
define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
define('DIR_WS_CATALOG_LANGUAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/languages/');

// * DIR_FS_* = Filesystem directories (local/physical)
//the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
define('DIR_FS_ADMIN', 'homepages/36/d246218842/htdocs/store/admin/');
define('DIR_FS_CATALOG', 'homepages/36/d246218842/htdocs/store/');
07 Aug 2008, 15:52
#18
higherselfgifts avatar

higherselfgifts

New Zenner

Join Date:
Aug 2008
Posts:
16
Plugin Contributions:
0

Re: Renaming Admin Folder

Suggest running zc_install/index.php?


what will I loose if anything and how do I run ?
07 Aug 2008, 16:13
#19
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Posts:
4,572
Plugin Contributions:
0

Re: Renaming Admin Folder

"ERROR: admin/includes/configure.php file not found.

If you know the file is there then perhaps it is a permission problem.

Use your FTP program to see what the permissions are; should be 644 or you can do the following.


Make a blank file and inside put the following code:

<?php
chmod("includes/configure.php", 0444);
chmod("admin/includes/configure.php", 0444);
echo 'Completed'
?>


Note: if you renamed the 'admin' directory then change "admin" to whatever you renamed it to and you're good to go.

Save the file as chmod.php and upload it to the same directory where these files are:
index.php - ipn_main_handler.php - nddbc.html

Now load the URL into your Browser: http://yoursite.com/chmod.php
You will see the 'Completed' msg. and can then load your Zen Cart "index" page to verify Error msg. is gone.

Any Admin login problems should also be gone.

Now delete the 'chmod.php' page.
07 Aug 2008, 17:21
#20
higherselfgifts avatar

higherselfgifts

New Zenner

Join Date:
Aug 2008
Posts:
16
Plugin Contributions:
0

Re: Renaming Admin Folder

<?php
chmod("includes/configure.php", 0444);
chmod("admin/includes/configure.php", 0444);
echo 'Completed'
?>

Note: if you renamed the 'admin' directory then change "admin" to whatever you renamed it to and you're good to go.

Save the file as chmod.php and upload it to the same directory where these files are:
index.php - ipn_main_handler.php - nddbc.html

Now load the URL into your Browser: http://yoursite.com/chmod.php
You will see the 'Completed' msg. and can then load your Zen Cart "index" page to verify Error msg. is gone.

Any Admin login problems should also be gone.

Now delete the 'chmod.php' page.


I followed your instructions, I saw the "completed" msg. still no admin access and now the site is not showing up at all, there is now a blank page? even after I deleted the chmod.php file http://www.higherselfgifts.com/store/