Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

apache2 directory 2

Status
Not open for further replies.

Tracey

Programmer
Oct 16, 2000
690
NZ
I have applications currently running on the web via apache (c:\apache).

I am at present setting up a new server to replace the current. I have a new machine with win2000 pro installed. When i first installed apache i made the mistake of not changing the default directory to c:

so i uninstalled it and installed again to c. My problem here is that apache keeps installing itsself into a directory "apache2" ( i had prior deleted remaining folders - c:\apache group\). My programs refer (many, many times) to the c:\apache\cgi-bin path.

When I try to change the dir name to apache, i am told i cannot rename that folder, access is denied.

This means of course that i will have to go through all my applications and change the paths.

Can anyone help me here? I would like to get apache 2 installed into an identical directory if i can (c:\apache)

[cannon][wiggle]
 
The reason you can't rename the folder is probably because you are trying to do that while Apache is running. You need to stop the Apache server first. You might even need to stop Apache, disable it's auto-startup in Services, and then restart Windows 2000. Then, you should be able to rename the folder.

Of course, you will also need to change certain directory paths in httpd.conf, such as DocumentRoot.

"My programs refer (many, many times) to the c:\apache\cgi-bin path."

This is a perfect example of why you should use global application config files, instead of hard-coding directories into your applications. -------------------------------------------

"Now, this might cause some discomfort..."
(
 
ok... I have stopped apache and set to manual start. I have changed the folder name to apache. I have changed all reference in Httpd.conf from "Apache2" to apache in the paths. I have changed the path in registry (services path) to reflect the changes.

There is something i have missed however....

Apache will now not start. On viewing the application log in Win200 i see this warning:

Apache.exe could not open document config file c:/Apache2/conf/httpd.conf

Where do i change the path to this file within apache??

 
Correcting error details:

the error message i mentioned previously was not the most recent...

the error i am getting after the abovementioned process is in the system log:

The Apache2 service terminated with service specific-error 1
 
Oops, yes. I forgot to explain one of the concepts of Apache: You really don't have to change your main install directory for all of Apache. (In order to do that, you would have to make some registry changes. If you are brave, you can search through the registry for references to C:\Apache2, and change them to C:\Apache. I think the main one is HKEY_LOCAL_MACHINE->SOFTWARE->Apache Group->Apache->2.0.36->ServerRoot)

But really... all you want to change is your document root and your cgi-bin root directories. You can leave all the Apache binaries and config files at their present location, and just move your documents and CGI scripts into the C:\Apache directory. Then, just edit C:\Apache2\conf\httpd.conf to specify the new path for documents and CGI scripts.

Or, if you really wanted a super simple but kludgy solution, I suppose you could just make a shortcut from C:\Apache to C:\Apache2. I don't recommend this in the long run, though, because it is relying on "misinformation", rather than proper configuration.

And finally... Did you install Apache2 from the .MSI installer file (at I was pretty sure the installer allows you to specify any directory. -------------------------------------------

"Now, this might cause some discomfort..."
(
 
Ok, have all that sorted now. Had to tippytoe through registry etc etc (had to change heaps of keys). But now it is running. However, see my latest post [cry]

yes, i installed win32 .msi file, it did give me the option to change directories, otherwise i would be stuck with c:\program files\apache group\apache2

however, as all versions of apache i have used so far, that final folder is automatically inserted (ie i say i want to install at c:\ and it installs c:\apache)
however v2 insisted on calling that folder apache2.

btw... could you point me towards more info on "global application config files". They sound interesting...

 
I still don't understand why you couldn't take the second option I mentioned above. Read the second paragraph from my previous post. Your documents and CGI files can be stored anywhere you want. They are completely independent of your core Apache install directory. In fact, if you start doing multiple virtual hosts in Apache, each domain should have its own DocumentRoot and cgi-bin directory, and you can specify where.

Maybe I wasn't clear enough in my previous post. If so, I apologize.

Global application config files are a simple concept. It depends on what web scripting language you are working with, but Perl, PHP, ASP, etc... each allow for scripts to include other files. Thus, any application you do should have one central file which defines all configuration options, such as directories, username/passwords, names, etc... as variables. So, all scripts in that application have a line at the top which includes this file. Then, you refer to the variables within all your scripts.

In short, anything that you are going to use multiple times should be defined in ONE place only (your configuration files). Then you can change the settings for your whole application simply by changing the config file. -------------------------------------------

"Now, this might cause some discomfort..."
(
 
yeah, i liked the idea your mentioned in the 2nd paragraph, unfortunately i had already taken care of all the registry stuff the day prior.

I develop my .exe's in Delphi. I suppose a global could take care of what u are talking about... unfortunately its things like my database connection which is held in the Db properties..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top