Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Making a Virtual Host Emvironment in Xampp for Windows


rpdesign

Recommended Posts

Hello all,

I'm posting this topic to allow all you prople who are using Xampp for windows and want to type in oscomm.local in your browser for your test site and not localhost\htdocs\your shop\catalog\

 

This tutorial assumes you have Xampp installed My version was 1.7.3

 

What does Xampp Do?

Xampp provides an easy way for you to test your catalog in a local environment by setting up a webserver on your computer! No more crashing live sites!

 

You can receive it here

http://www.apachefriends.org/en/xampp-windows.html

run the install.bat file in the install folder after unzipping xampp to install xampp.

 

To edit my files i use notepad++ a substitute for notepad with many additional features.

You can find it here http://notepad-plus-plus.org/download/v6.2.3.html

 

***note make sure xampp is not running****

 

Step 1

open up c:\xampp\apache\conf\httpd.conf file

 

Step 2

 

on line 47 change Listen 80 to Listen 127.0.0.2:80 //this changes the ip address of xampp to 127.0.0.2

 

****note if you are in another country please look at your hosts file for your localhost ip address. In the USA it is always 127.0.0.1 this is why we change xampp to 127.0.0.2 so it will not interfere with normal operations of windows.******

 

Step 3

create two empty files called

example.local.access.log

example.local.error.log

in the folder that contains your catalog

 

Step 4

place this code in on line 49 of c:\xampp\apache\conf\httpd.conf *****remember to replace the 127.0.0.2's with whatever ip you set up for xampp. You also need to change the paths to your oscommerce catalog where applicable**********

 

# Start of <virtualhost>

NameVirtualHost 127.0.0.2:80

 

<VirtualHost 127.0.0.2:80>

DocumentRoot "C:\xampp\htdocs"

ServerName xampp.local

ServerAlias www.xampp.local

</VirtualHost>

 

<VirtualHost 127.0.0.2:80>

DocumentRoot "C:\xampp\htdocs\oscommerce\catalog"

ServerName oscomm.local

ServerAlias www.oscomm.local

 

CustomLog "C:\xampp\htdocs\oscommerce\example.local.access.log" combined

ErrorLog "C:\xampp\htdocs\oscommerce\example.local.error.log"

 

<Directory "C:\xampp\htdocs\oscommerce\catalog">

Options Indexes FollowSymLinks

AllowOverride All

Order allow,deny

Allow from all

</Directory>

</VirtualHost>

 

Step 5

Now open up your hosts file it should be located in c:\windows\system32\drivers\etc\ folder

 

add

127.0.0.2 oscomm2.local

127.0.0.2 www.oscomm2.local

127.0.0.2 xampp.local

127.0.0.2 www.xampp.local

 

after

127.0.0.1 localhost

 

Step 6

restart your browser

start apache and mysql in xampp control

 

Enjoy :lol:

Got questions?

send me an email

Always backup your files! You will be glad you did

My add-ons :

SSPP Seperate Shipping Per Product v2.5| Support
Gift vouchers for SPPC 4.22 v2.1 | Support |
Catalog Infobox v1.0 | Sorry no support for Catalog Infobox |
HTML Mail v2.0 | Support |




Upcoming Add ons:

Addon Manager |
Separate Pricing Per Product Qty |
Coupon Populate |
EZ-PDF Catalog

Link to comment
Share on other sites

ok I know, I know emvironment should be environment ok geez :lol:

Always backup your files! You will be glad you did

My add-ons :

SSPP Seperate Shipping Per Product v2.5| Support
Gift vouchers for SPPC 4.22 v2.1 | Support |
Catalog Infobox v1.0 | Sorry no support for Catalog Infobox |
HTML Mail v2.0 | Support |




Upcoming Add ons:

Addon Manager |
Separate Pricing Per Product Qty |
Coupon Populate |
EZ-PDF Catalog

Link to comment
Share on other sites

Sorry,

Additional steps!

 

Step 7

in your catalog->includes->configure.php file if you want your catalog to show up, place the paths to your install

here is my sample from my computer

<?php
define('HTTP_SERVER', 'http://www.oscomm.local');
define('HTTPS_SERVER', 'http://www.oscomm.local');
define('ENABLE_SSL', false);
define('HTTP_COOKIE_DOMAIN', 'www.oscomm.local');
define('HTTPS_COOKIE_DOMAIN', 'www.oscomm.local');
define('HTTP_COOKIE_PATH', '/');
define('HTTPS_COOKIE_PATH', '/');
define('DIR_WS_HTTP_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');
define('DIR_WS_IMAGES', 'images/');
define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
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_DOWNLOAD_PUBLIC', 'pub/');
define('DIR_FS_CATALOG', 'C:/xampp/htdocs/oscommerce/catalog/'); //place the direct path here
define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
define('DB_SERVER', 'localhost');
define('DB_SERVER_USERNAME', 'user'); // this is the user for your database
define('DB_SERVER_PASSWORD', 'mypassword'); //this is your password setting
define('DB_DATABASE', 'oscomm');
define('USE_PCONNECT', 'false');
define('STORE_SESSIONS', 'mysql');
?>

Step 7

now do the same for your catalog->admin->includes->configure.php file again here is my copy

<?php
define('HTTP_SERVER', 'http://www.oscomm.local');
define('HTTP_CATALOG_SERVER', 'http://www.oscomm.local');
define('HTTPS_CATALOG_SERVER', 'http://www.oscomm.local');
define('ENABLE_SSL_CATALOG', 'false');
define('DIR_FS_DOCUMENT_ROOT', 'C:/xampp/htdocs/oscommerce/catalog/'); //place the direct path to your catalog here
define('DIR_WS_ADMIN', '/admin/');
define('DIR_FS_ADMIN', 'C:/xampp/htdocs/oscommerce/catalog/admin/');// place the path to your admin here
define('DIR_WS_CATALOG', '/');
define('DIR_FS_CATALOG', 'C:/xampp/htdocs/oscommerce/catalog/'); //hmmm this looks familiar huh lol
define('DIR_WS_IMAGES', 'images/');
define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');
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', DIR_WS_CATALOG . 'includes/languages/');
define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');
define('DB_SERVER', 'localhost');
define('DB_SERVER_USERNAME', 'user');//this is your user
define('DB_SERVER_PASSWORD', 'mypassword');//this is your password
define('DB_DATABASE', 'oscomm'); //this is your database fun isnt it
define('USE_PCONNECT', 'false');
define('STORE_SESSIONS', 'mysql');
?>

Always backup your files! You will be glad you did

My add-ons :

SSPP Seperate Shipping Per Product v2.5| Support
Gift vouchers for SPPC 4.22 v2.1 | Support |
Catalog Infobox v1.0 | Sorry no support for Catalog Infobox |
HTML Mail v2.0 | Support |




Upcoming Add ons:

Addon Manager |
Separate Pricing Per Product Qty |
Coupon Populate |
EZ-PDF Catalog

Link to comment
Share on other sites

in step 5 127.0.0.2 oscomm2.local and 127.0.0.2 www.oscomm2.local should be 127.0.0.2 oscomm.local and 127.0.0.2 www.oscomm.loocal respectfully

Always backup your files! You will be glad you did

My add-ons :

SSPP Seperate Shipping Per Product v2.5| Support
Gift vouchers for SPPC 4.22 v2.1 | Support |
Catalog Infobox v1.0 | Sorry no support for Catalog Infobox |
HTML Mail v2.0 | Support |




Upcoming Add ons:

Addon Manager |
Separate Pricing Per Product Qty |
Coupon Populate |
EZ-PDF Catalog

Link to comment
Share on other sites

You can also use your own domain in this setup.

 

just use in your hosts file:

 

127.0.0.1 www.yourdomain.com

or

"your private ip" www.yourdomain.com

if you have server in your local network.

 

Then you can set up local with the configuration you have online.

 

You cant access your live domain when this is enabled, then you have to remove the entry's from the hosts file.

Link to comment
Share on other sites

This post might get me started. I'm about to take the plunge and see if I can do anything with OS. I can do minimal html and css, so I don't know how far I'll get. But I thought I'd try in my spare time. I've got to get my store off yahoo so I can have more flexibility.

 

First thing, as I understand, is to download wamp or xampp as a test platform, and then download 2.3.3 into it. I'll try xampp and follow the above directions. Unfortunately, much of this stuff is like reading Latin to me.

 

But I appreciate the tips, such as above.

Link to comment
Share on other sites

I suggest using the wampserver package instead. It is much more user-friendly, in my opinion, and it allows you to easily change php/mysql versions, which is sometimes needed when you need to know if your shop will work correctly with them.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

There are five versions of Wampserver to choose from. Since my OS is 32 bit, is this version below the right choice? And down below on the wampserver page are 4 addons. Should I add all of them after downloading WS?

 

Wampserver (32 bits & PHP 5.4) 2.2E

Link to comment
Share on other sites

There are five versions of Wampserver to choose from. Since my OS is 32 bit, is this version below the right choice? And down below on the wampserver page are 4 addons. Should I add all of them after downloading WS?

 

Wampserver (32 bits & PHP 5.4) 2.2E

Probably not. That is for php 5.4, which your host is probably not using. The items at the bottom allow you to add other choices. So you can install the basic code for 5.3, or 5.4, and then install the 5.2 version if you wanted.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I started this discussion with xampp in mind, because that is what I've used and have successfully set up on my own machine. This is also a great way to test out add ons that you are developing or just to test the site

Always backup your files! You will be glad you did

My add-ons :

SSPP Seperate Shipping Per Product v2.5| Support
Gift vouchers for SPPC 4.22 v2.1 | Support |
Catalog Infobox v1.0 | Sorry no support for Catalog Infobox |
HTML Mail v2.0 | Support |




Upcoming Add ons:

Addon Manager |
Separate Pricing Per Product Qty |
Coupon Populate |
EZ-PDF Catalog

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...