Forum Moderators: coopster & phranque

Message Too Old, No Replies

HTTP_REFERER to be read from a CD?

How to read drive letter of the file calling the script?

         

weaver

3:38 pm on Apr 3, 2003 (gmt 0)

10+ Year Member



I'm distributing a large web site on a CD, and on the CD is the installation files for the IndigoPerl version of Apache and Perl, where I also have the Perl script copied into the Perl installation on the user's hard drive. Everything works fine after the automated installation, except that I have to specify in the script the drive letter of the HTML file that calls the script in order for the user to click back into the web site on the CD. And if the user doesn't have D: as the CD-drive they have to change it manually. I was wondering if the script couldn't read the drive letter into a variable to make it automated. I tried with the ENV{HTTP_REFERER} but that only returns someting if the originating file is a http address. Any help would be appreciated.

bcolflesh

3:52 pm on Apr 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Maybe this will help:

GetLogicalDrives [aspn.activestate.com]

Regards,
Brent

andreasfriedrich

4:36 pm on Apr 3, 2003 (gmt 0)

weaver

8:40 pm on Apr 4, 2003 (gmt 0)

10+ Year Member



Thank you Andreas for this solution, I have tested it with Perl from a SUBST drive, and it works nicely. It's really cool to run Perl from a CD. However, I tried to type mysql and mysqld commands in a DOS window from the X:\MySQL\bin folder (of course when Apache is running) but get the message
"ERROR 2003: Can't connect to MySQL server on 'localhost' (10061)"
so I assume that MySQL is not working. I haven't changed any of the config files. What could be the reason, or what else do I need to do?

andreasfriedrich

11:08 pm on Apr 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you run
start_.bat
the WAMPonCD system will be configured and the daemons will be started. Then the
index.[url=http://www.php.net/]PHP[/url]
file is loaded into your browser. You should see a welcome message and a WAMPonCD logo. If you can see this logo then MySQL [mysql.com] is running ok since it is retrieved from the database.

When connecting to the MySQL [mysql.com] server keep in mind that it listens on port 8182 or whatever port you changed it to. Likewise Apache [httpd.apache.org] is listening on port 8181.

WAMPonCD documentation

So when connecting to the database server try using a command like this:


MySQL [mysql.com] -port=8182 ...

or even better yet since it will avoid accidentally reading any other my.ini that may exist on your system:


MySQL [mysql.com] --defaults-file=%%TEMP%%/Apache [httpd.apache.org]/my.ini

You would need to replace %%TEMP%% with the drive letter and path to your TEMP directory as identified by your TEMP environment variable.

HTH Andreas

weaver

1:28 am on Apr 5, 2003 (gmt 0)

10+ Year Member



Andreas,
Thanks for your reply.
I am using Win98 second edition.
However, on startup the WAMPonCD logo does not show up.

When I type this command from \mysql\bin:

mysqladmin -port=8182 version

I get this message:

error: 'Can't connect to MySQL server on 'localhost' (10061)
Check that mysqld is running on localhost and that the port is 3306.
You can check this by doing 'telnet localhost 3306'

When I telnet nothing shows up.

And when I try:
mysqladmin -port=3306 version

I get the same message.

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

The my.ini file in the C:\windows\temp\Apache looks like this:

# $Id: my.ini_readonly,v 1.1 2003/01/08 21:02:51 af Exp $
#This File was made using the WinMySQLadmin 1.1 Tool
#11.07.01 14:51:10

#Uncomment or Add only the keys that you know how works.
#Read the MySQL Manual for instructions

[mysqld]
basedir=X:/MySQL
bind-address=127.0.0.1
datadir=X:/database
#language=F:/MySQL/share/your language directory
#slow query log#=
tmpdir=C:\WINDOWS\TEMP/Apache
port=8182
#set-variable=key_buffer=16M
[WinMySQLadmin]
Server=X:/MySQL/bin/mysqld-opt.exe
user=apache
password=aaron/8
[mysqladmin]
port=8182

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

The Mysql\data\mysql.err has these last entries:

030404 17:18:05 D:\PROGS\WAMPONCD\MYSQL\BIN\MYSQLD.EXE: File '.\mysql\host.ISD' not found (Errcode: 2)
030404 17:18:05 D:\PROGS\WAMPONCD\MYSQL\BIN\MYSQLD.EXE: Can't find file: 'host.ISD' (errno: 2)

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

andreasfriedrich

3:13 am on Apr 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sorry, I forgot one slash in that port option :(


mysqladmin --port=8182 ...

This should work. At least it will tell mysqladmin to use the right port.

Just post again if there is no MySQL [mysql.com] server listening on that port.

Andreas

weaver

3:38 pm on Apr 5, 2003 (gmt 0)

10+ Year Member



When I type in this it says:

error: 'Can't connect to MySQL server on 'localhost' (10061)
Check that mysqld is running on localhost and that the port is 8182.
You can check this by doing 'telnet localhost 8182'.

When I telnet it says error connecting to localhost.