I just made a fresh install of OpenCart and need to change the name of the admin folder to another name for improving my online shop's security. I noticed several config.php files in various locations. Which of these config.php files needs to be edited to indicate the correct file path and location, and exactly what lines in the file need to be edited?
Thanks,
Mark
Thanks,
Mark
v.3.0.2.0
-------------
also v.1.5.6
with vqmod 2.5.1
that's a good plan.
Change in your admin config.php everything what's called admin to your admin dir name.
sample
to
to
Beware if you want to use VqMod. You have to chance it in the VqMod to.
Change in your admin config.php everything what's called admin to your admin dir name.
sample
Code: Select all
define('HTTP_SERVER', 'http://localhost/1551/admin/');
Code: Select all
define('HTTP_SERVER', 'http://localhost/aldoc1551/yourdir/');
Code: Select all
define('DIR_APPLICATION', 'C:\Program Files (x86)\Zend\Apache2\htdocs\1551/admin/');
Code: Select all
define('DIR_APPLICATION', 'C:\Program Files (x86)\Zend\Apache2\htdocs\1551/yourdir/');
Yes, if you have VQmod you are only supposed to have to change the path redirect file, however, for some reason this has never worked for us, have tried numerous times on 1.5.5.1, so in the end resorted to changing all refs to admin in vqmod xml files to the new file name
Running OC 1.5.5.1 with vqmods.
http://www.aislings.co.uk
http://www.lovers-paradise-toys.co.uk
If you have vqmod you have to change the path to.
sample:
to
If you have good editor than it is now problem.
Also clear ( delete al files in) the vqcache
sample:
Code: Select all
<file name="admin/controller/sale/order.php">
Code: Select all
<file name="yourdirname/controller/sale/order.php">
Also clear ( delete al files in) the vqcache
I installed vqmod because I think I will upgrade to newer versions of OpenCart as it is developed, and I don't want to lose the website that I build.
I still need to change the admin folder names to improve security. I do have a good editor but I don't have a lot of experience coding or changing code. Is there a way to batch process the necessary files to modify them, or am I going to have to go through the files one at a time?
If I have to go through the files one at a time, then can any of you tell me ALL the files I will need to modify? Do I only have to modify these files?...
admin/config.php
vqmod/install/index.php
In the file vqmod/pathReplaces.php there is the following code...
/**
* File for path replacements in xml paths. Examples:
*
* $replaces[] = array('~^admin\b~', 'admin123'); // This replaces the admin folder name for use when admin folder's renamed
* $replaces[] = array('~\btheme/default\b~', 'theme/my-theme-name'); // Theme name replace to apply mods to your theme
*
* Place your replaces between the START and END lines below
**/
// START REPLACES //
// END REPLACES //
Do I need to modify anything in this file?
I still need to change the admin folder names to improve security. I do have a good editor but I don't have a lot of experience coding or changing code. Is there a way to batch process the necessary files to modify them, or am I going to have to go through the files one at a time?
If I have to go through the files one at a time, then can any of you tell me ALL the files I will need to modify? Do I only have to modify these files?...
admin/config.php
vqmod/install/index.php
In the file vqmod/pathReplaces.php there is the following code...
/**
* File for path replacements in xml paths. Examples:
*
* $replaces[] = array('~^admin\b~', 'admin123'); // This replaces the admin folder name for use when admin folder's renamed
* $replaces[] = array('~\btheme/default\b~', 'theme/my-theme-name'); // Theme name replace to apply mods to your theme
*
* Place your replaces between the START and END lines below
**/
// START REPLACES //
// END REPLACES //
Do I need to modify anything in this file?
v.3.0.2.0
-------------
also v.1.5.6
with vqmod 2.5.1
It is already running. If you rename the directory /admin/ to /othername/, then both the file /config.php and the file /othername/config.php need to know about it. Inside both of those, change every instance of "admin" to "othername". (In a decent text editor that would be change all in all files, one pass, done.)
You can then simply replace both /index.php and /admin/index.php with the original virgin index.php files (from the OC .zip file's /upload/ directory, then in the browser address and fire /vqmod/install/index.php, whereupon a moment later vqmod will have instantly rewritten its own stuff. (You do not even need a decent text editor, let vqmod do it.)
You can then simply replace both /index.php and /admin/index.php with the original virgin index.php files (from the OC .zip file's /upload/ directory, then in the browser address and fire /vqmod/install/index.php, whereupon a moment later vqmod will have instantly rewritten its own stuff. (You do not even need a decent text editor, let vqmod do it.)
butte wrote: If you rename the directory /admin/ to /othername/, then both the file /config.php and the file /othername/config.php need to know about it.
Is the first config.php file you mention found in the main OpenCart directory? I see one there but there are no instances of "admin" in this particular config.php file.
However, I do see instances of "admin" in the /othername/config.php file.
Is the first config.php file you mention found in the main OpenCart directory? I see one there but there are no instances of "admin" in this particular config.php file.
However, I do see instances of "admin" in the /othername/config.php file.
v.3.0.2.0
-------------
also v.1.5.6
with vqmod 2.5.1
I just made a mistake and now I can't log in to my admin panel. I enabled SSL for the storefront by going to System → Settings and Edit for the default store. Under the Server tab I set Use SSL to Yes. How do I go about repairing this since I can't log in?
I was using the information from this article to upgrade security when I made the above mistake:
http://opencarthelp.com/a/?q=improve-opencart-security
Apparently my host doesn't have a shared ssl layer. I edited the admin config.php file located at:
/admin/config.php
These are the lines I changed...
// HTTPS
define('HTTPS_SERVER', 'http://mystoreurl.com/admin/');
define('HTTPS_CATALOG', 'http://mystoreurl.com/image/');
Change http: to https: in the path:
// HTTPS
define('HTTPS_SERVER', 'https://mystoreurl.com/admin/');
define('HTTPS_CATALOG', 'https://mystoreurl.com/image/');
I "think" I'm going to have to make an .htaccess file. Is this correct? If so, is there an .htaccess file I can download somewhere, or am I going to have to create one?
I was using the information from this article to upgrade security when I made the above mistake:
http://opencarthelp.com/a/?q=improve-opencart-security
Apparently my host doesn't have a shared ssl layer. I edited the admin config.php file located at:
/admin/config.php
These are the lines I changed...
// HTTPS
define('HTTPS_SERVER', 'http://mystoreurl.com/admin/');
define('HTTPS_CATALOG', 'http://mystoreurl.com/image/');
Change http: to https: in the path:
// HTTPS
define('HTTPS_SERVER', 'https://mystoreurl.com/admin/');
define('HTTPS_CATALOG', 'https://mystoreurl.com/image/');
I "think" I'm going to have to make an .htaccess file. Is this correct? If so, is there an .htaccess file I can download somewhere, or am I going to have to create one?
Last edited by markz on Wed Aug 21, 2013 12:13 am, edited 2 times in total.
v.3.0.2.0
-------------
also v.1.5.6
with vqmod 2.5.1
Yes, one is in the OC root (same directory as index.php), the other one is in the administrative directory one step up, in /admin/ where the other index.php sits. Cart and admin each have a config.php and an index.php (OC sits in / or /ocdir/ and admin sits in /admin/ or /ocdir/admin/).
When you find that pair of config.php (one a step above the other in the tree), then both need to know where OC and admin sit, such as /othername/ and /othername/admin/. You're not snowed, you're just becoming familiar with the directory structure. Slow and easy, putter a bit, you'll see it.
When you find that pair of config.php (one a step above the other in the tree), then both need to know where OC and admin sit, such as /othername/ and /othername/admin/. You're not snowed, you're just becoming familiar with the directory structure. Slow and easy, putter a bit, you'll see it.
I just edited them via the Cpanel at my webhost but it didn't work. I still can't get in, so I just downloaded them as per your suggestion. Now what?
Yes...I'm learning (and today I'm learning a LOT!)
Yes...I'm learning (and today I'm learning a LOT!)

v.3.0.2.0
-------------
also v.1.5.6
with vqmod 2.5.1
I just noticed something. Renaming /admin/ to /othername/ leaves OC where it was, you're just changing the name of where admin sits. At the moment, whether that is already renamed or not, the HTTPS sections need to agree with it and should not be protecting it.
You will turn the htaccess.txt file into the .htaccess file by renaming, but wait for the moment before doing that.
You will turn the htaccess.txt file into the .htaccess file by renaming, but wait for the moment before doing that.
Simpler . . . what are the earliest backups you have of the two config.php files?
If you happen not to have backups, then refiring the installer should snuff the SSL booboo . . . you would need to be sure that /admin/ is named /admin/, reinstate the ORIGINAL config and index files, refire the OC installer, then rerun the vqmod installer.
Unfortunately, that link you read did not forewarn you not to interleave doing this and that, just do one, then the next. Renaming /admin/ and concurrently hitting SSL before the former was done was one booboo, many of us would say that protecting admin with SSL is itself a booboo. You dinna know.
Afterward, inside the htaccess.txt file specify any directory change for the OC root (it will end in /, and it will be either / or /directory/, NOT the /admin/ directory), then turn the htaccess.txt file into the .htaccess file by renaming (note the nonameDOTextension format). It will be a good idea NOT to let SSL protect /admin/.
If you happen not to have backups, then refiring the installer should snuff the SSL booboo . . . you would need to be sure that /admin/ is named /admin/, reinstate the ORIGINAL config and index files, refire the OC installer, then rerun the vqmod installer.
Unfortunately, that link you read did not forewarn you not to interleave doing this and that, just do one, then the next. Renaming /admin/ and concurrently hitting SSL before the former was done was one booboo, many of us would say that protecting admin with SSL is itself a booboo. You dinna know.
Afterward, inside the htaccess.txt file specify any directory change for the OC root (it will end in /, and it will be either / or /directory/, NOT the /admin/ directory), then turn the htaccess.txt file into the .htaccess file by renaming (note the nonameDOTextension format). It will be a good idea NOT to let SSL protect /admin/.
Since this was/is a fresh install I had not backed up yet since I really haven't built anything.
I've renamed my admin folder back to admin, and reinstated the config.php files to their original configuration.
I've refired an installer and have acquired my login page, but when I log in I receive the error message "404: File Not Found"
Hmm...you say refire the OC installer. How do I do this? My webhost had OC on it and when I initially installed it I only had to press an install button. The rest was automated. I tried installing by running http://my url/OpenCart/install but get the same 404 File Not Found error message.
I've run the vqmod install again and the system tells me "VQMOD ALREADY INSTALLED!"
I'm holding back on doing anything with the htaccess.txt file until later, unless I'm told I need to do otherwise!
I've renamed my admin folder back to admin, and reinstated the config.php files to their original configuration.
I've refired an installer and have acquired my login page, but when I log in I receive the error message "404: File Not Found"
Hmm...you say refire the OC installer. How do I do this? My webhost had OC on it and when I initially installed it I only had to press an install button. The rest was automated. I tried installing by running http://my url/OpenCart/install but get the same 404 File Not Found error message.
I've run the vqmod install again and the system tells me "VQMOD ALREADY INSTALLED!"
I'm holding back on doing anything with the htaccess.txt file until later, unless I'm told I need to do otherwise!
v.3.0.2.0
-------------
also v.1.5.6
with vqmod 2.5.1
When you start with the stock config.php pair AND the stock index.php pair, first /install/index.php rewrites both config,php, and then (do wait, do it second) /vqmod/install/index.php rewrites both main OC and admin OC index.php. The former reinstated your log-in page but something SEEMS missing, while the latter knows where the index.php are. You may need just to flush vqmod/vqcache/ files so that it doesn't remember anything about its recent adventures, and then the 404 won't fire. (The stock files are in the OC .zip /upload/ tree.)
Retry, just put back in stock config.php and stock index.php, flush, then install OC and then install vqmod. After that is stable, then you'll want .htaccess in place to protect it in certain ways.
Which version did the host routine install?
Retry, just put back in stock config.php and stock index.php, flush, then install OC and then install vqmod. After that is stable, then you'll want .htaccess in place to protect it in certain ways.
Which version did the host routine install?
Okay, well I decided to simply uninstall and reinstall OC on my webhost. Since it was a new install I didn't lose anything, and I learned some important lessons. I'm definitely going to slow down and ask questions before jumping ahead of myself as I did here...won't be able to afford these kinds of mistakes once my new site is live.
Anyway, I'm back at square one, where I'll work on changing the admin folder name to improve security. I do have vqmod reinstalled, and I'd certainly like to have the important administrative stuff accomplished before I begin building my catalog.
Anyway, I'm back at square one, where I'll work on changing the admin folder name to improve security. I do have vqmod reinstalled, and I'd certainly like to have the important administrative stuff accomplished before I begin building my catalog.
v.3.0.2.0
-------------
also v.1.5.6
with vqmod 2.5.1
Who is online
Users browsing this forum: Majestic-12 [Bot] and 67 guests