Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

VirtualHost, no success. Help pleasse.


flaviove

Recommended Posts

I've been trying to use a virtual host directive and unfortunately with no success. What do I need to do in order to have it working not using a ?http://localhost/....? but ?http://mydomain/....? instead.

My installation using the ?http://localhost/catalog or http://localhost/catalog/admin? is working perfectly :D , but when I try to test it using http://ipaddress/.... in another box at the same network it doesn't work . :( l

What should I change and where?

My guess is httpd.conf and configure.php but I am not sure about what should I do on them and where.

 

Any help will be great.

Thanks a lot

Flavio Veras

Link to comment
Share on other sites

Firstly your server has to be set up to allow virtual hosts, and not all are. If you're using Xitami web server then you can just go to your server control panel and add the virtual host names there and it should work. If you have Apache then you may have to install a piece of software that gives you an interface where you can set up virtual hosts.

 

Vger

Link to comment
Share on other sites

Firstly your server has to be set up to allow virtual hosts, and not all are.  If you're using Xitami web server then you can just go to your server control panel and add the virtual host names there and it should work.  If you have Apache then you may have to install a piece of software that gives you an interface where you can set up virtual hosts.

 

Vger

 

Hi Vger Thanks for your replay,

 

Let's see. I have no problem in editing all the config files using vi or vim. I am using a Xammp server in a Linux box. Below we have my server info. I've been doing some tests but nothing works

 

Server Information

Server Host: localhost.localdomain (127.0.0.1) Database Host: localhost (127.0.0.1)

Server OS: Linux 2.4.20-8 Database: MySQL 4.1.11

Server Date: 05/18/2005 09:34:29 Datebase Date: 05/18/2005 09:34:29

Server Up Time: 09:34:29 up 5:54, 5 users, load average: 0.30, 0.09, 0.02

HTTP Server: Apache/2.0.53 (Unix) mod_ssl/2.0.53 OpenSSL/0.9.7d PHP/5.0.4 DAV/2 mod_perl/1.999.21 Perl/v5.8.6

PHP Version: 5.0.4 (Zend: 2.0.4-dev)

 

Actually I put :

 

------------------httpd.conf--------------------------------------

 

<VirtualHost 192.168.2.93>

DirectoryIndex index.php index.html

ServerName clickecompre

ServerAdmin [email protected]

DocumentRoot /opt/lampp/htdocs/catalog

</VirtualHost>

 

------/opt/lampp/htdocs/catalog/includes/configure.php------------

 

 

<?php

/*

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

// Define the webserver and path parameters

// * DIR_FS_* = Filesystem directories (local/physical)

// * DIR_WS_* = Webserver directories (virtual/URL)

define('HTTP_SERVER', 'http://192.168.2.93'); // eg, http://localhost - should not be empty for productive servers

define('HTTPS_SERVER', ''); // eg, https://localhost - should not be empty for productive servers

define('ENABLE_SSL', false); // secure webserver for checkout procedure?

define('HTTP_COOKIE_DOMAIN', 'localhost');

define('HTTPS_COOKIE_DOMAIN', '');

define('HTTP_COOKIE_PATH', '/catalog/');

define('HTTPS_COOKIE_PATH', '');

define('DIR_WS_HTTP_CATALOG', '/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', '/opt/lampp/htdocs/catalog/');

define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 

// define our database connection

define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty for productive servers

define('DB_SERVER_USERNAME', 'flaviove');

define('DB_SERVER_PASSWORD', 'password');

define('DB_DATABASE', 'osCommerce');

define('USE_PCONNECT', 'false'); // use persistent connections?

define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'

?>

Link to comment
Share on other sites

I think you need the NameVirtualHost

 

 

NameVirtualHost 192.168.2.93

 

<VirtualHost 192.168.2.93>

DirectoryIndex index.php index.html

ServerName clickecompre

ServerAdmin [email protected]

DocumentRoot /opt/lampp/htdocs <----no catalog

</VirtualHost>

 

If you dont want catalog then put everything in the root and change the configs

 

Then add to your DNS or host files on other computers

 

192.168.2.93 clickcompre

Link to comment
Share on other sites

I think  you need the NameVirtualHost

NameVirtualHost 192.168.2.93

 

<VirtualHost 192.168.2.93>

DirectoryIndex index.php index.html

ServerName clickecompre

ServerAdmin [email protected]

DocumentRoot /opt/lampp/htdocs      <----no catalog

</VirtualHost>

 

If you dont want catalog then put everything in the root and change the configs

 

Then add to your DNS or host files on other computers

 

192.168.2.93 clickcompre

 

Hi Dave...

 

Thanks for your replay and help.

Everything is running like a charm :P now after define a port for it. Now we have:

 

-------------------------------------------------

NameVirtualHost 192.168.2.93:80

<VirtualHost 192.168.2.93:80>

--------------------------------------------------

 

Cheers,

Flavio Veras

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...