Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2007
    Location
    In the middle of PiHKAL
    Posts
    15
    Plugin Contributions
    0

    Default Securing /includes/admin by renaming; problem with links

    I followed these directions in the tutorial, but there is a problem with the links in the admin control panel. They don't point to the new folder (the renamed admin folder)

    2. 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.
    https://www.zen-cart.com/tutorials/index.php?article=73



    Say I renamed my admin section to xyz123. Whenever I try to access anything it still points to admin instead of xyz123. I changed the following

    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/'); to
    define('DIR_WS_ADMIN', '/xyz123/');
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_ADMIN', '/xyz123
    /');
    define('DIR_WS_HTTPS_CATALOG', '/');

    And this section:
    define('DIR_FS_ADMIN', '/home/mystore.com/www/public/xyz123
    /');
    define('DIR_FS_CATALOG', '/home/mystore.com/www/public/');

    Is this correct? Why do all the hyperlinks in the admin section still have every link pointed to the admin directory instead of the
    xyz123 directory?

  2. #2
    Join Date
    Aug 2004
    Location
    New York City
    Posts
    7,174
    Plugin Contributions
    0

    Default Re: Securing /includes/admin by renaming; problem with links

    Anywhere you see admin in the config files, you should replace it with the admin's new name... and you need the closing / if you removed it, so

    Code:
    define('DIR_WS_ADMIN', '/admin/');
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_ADMIN', '/admin/');
    define('DIR_WS_HTTPS_CATALOG', '/');
    should be

    Code:
    define('DIR_WS_ADMIN', '/xyz123/');
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_ADMIN', '/xyz123/');
    define('DIR_WS_HTTPS_CATALOG', '/');
    Mary Ellen
    I came; I saw; I Zenned
    Taking over the world... one website at a time
    Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

    Holzheimer
    Fan Odyssey

  3. #3
    Join Date
    Feb 2007
    Location
    In the middle of PiHKAL
    Posts
    15
    Plugin Contributions
    0

    Default Re: Securing /includes/admin by renaming; problem with links

    I do have the closings. I don't know how those got posted there w/o them...

    this is what I have:
    define('DIR_WS_ADMIN', '/xyz123/');
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_ADMIN', '/xyz123/');
    define('DIR_WS_HTTPS_CATALOG', '/');

    Could this be what is needed?
    define('DIR_WS_XYZ123', '/xyz123/');
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_XYZ123
    ', '/xyz123/');
    define('DIR_WS_HTTPS_CATALOG', '/');
    Other than that, I don't know why this isn't working. Do I need to restart it or reboot it somehow?

  4. #4
    Join Date
    Aug 2004
    Location
    New York City
    Posts
    7,174
    Plugin Contributions
    0

    Default Re: Securing /includes/admin by renaming; problem with links

    Quote Originally Posted by caffiendo View Post
    I do have the closings. I don't know how those got posted there w/o them...

    this is what I have:
    define('DIR_WS_ADMIN', '/xyz123/');
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_ADMIN', '/xyz123/');
    define('DIR_WS_HTTPS_CATALOG', '/');

    Could this be what is needed?
    define('DIR_WS_XYZ123', '/xyz123/');
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_XYZ123
    ', '/xyz123/');
    define('DIR_WS_HTTPS_CATALOG', '/');
    Other than that, I don't know why this isn't working. Do I need to restart it or reboot it somehow?
    No, the second one is incorrect. The first change you made is right and it should be the only place you have to change aside from the DIR_FS_ADMIN.

    Here's a couple of silly questions... did you upload the changed file to your domain? Did you change the name of the folder in the url? (as in http://www.myzencart.com/xyz123/ instead of http://www.myzencart.com/admin/)
    Mary Ellen
    I came; I saw; I Zenned
    Taking over the world... one website at a time
    Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

    Holzheimer
    Fan Odyssey

  5. #5
    Join Date
    Feb 2007
    Location
    In the middle of PiHKAL
    Posts
    15
    Plugin Contributions
    0

    Default Re: Securing /includes/admin by renaming; problem with links

    I thought the DIR_WS_ADMIN was supposed to stay as-is. I just wanted to check on that.

    I did upload the changed files and set the permission to 444 (read-only). I also made the new directory (XYZ123) and copied everything to it with this:
    cp -rv * ~/sitename/zen/XYZ123

    I then checked the files and all copied correctly. I then renamed the admin folder as a backup folder.

    When I login to my admin account I goto: http://www.site.com/zc/xyz123/
    I then enter my admin user name and password. It logs in fine.

    When I go to the menus, like TOOLS -> DEVELOPER's TOOLS, the link still points to http://www.site.com/zc/admin/

    Is there something I'm missing here?

  6. #6
    Join Date
    Feb 2007
    Location
    In the middle of PiHKAL
    Posts
    15
    Plugin Contributions
    0

    Default Re: Securing /includes/admin by renaming; problem with links

    I just logged off my browser and restarted it and it still points to the admin page, not the new site.

    I then went into the cache and cleared it, restarted firefox and it now points to xyz123..

    Thanks for the help Afo!

  7. #7
    Join Date
    Aug 2004
    Location
    New York City
    Posts
    7,174
    Plugin Contributions
    0

    Default Re: Securing /includes/admin by renaming; problem with links

    No problem! Glad you got it sorted. Gee... closing the broswer and clearing the cache... how... simple.
    Mary Ellen
    I came; I saw; I Zenned
    Taking over the world... one website at a time
    Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

    Holzheimer
    Fan Odyssey

 

 

Similar Threads

  1. Problem with renaming Admin folder
    By TzuLady in forum Upgrading from 1.3.x to 1.3.9
    Replies: 7
    Last Post: 21 Apr 2010, 06:19 AM
  2. Securing my admin directory with .htpasswds produces a 404
    By corrado444 in forum General Questions
    Replies: 2
    Last Post: 31 Oct 2008, 01:22 AM
  3. Problem with Securing my site
    By peppyone in forum Installing on a Linux/Unix Server
    Replies: 5
    Last Post: 26 Jul 2007, 02:17 AM
  4. Problem renaming admin directory!
    By IronMan101 in forum General Questions
    Replies: 2
    Last Post: 15 Jul 2007, 08:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg