Author |
|
sworduke
Joined: 31 Jul 2013 Posts: 5 Location: Poland
|
Posted: Wed 31 Jul '13 22:48 Post subject: Apache - starting problem - invalid path |
|
|
Hi All,
I'm looking for some help while httpd server configuring.
I share my files only from local disks but some of my resources are located on truecrypt secure volume.
When I want to start my server now I have to mount my all drives first to have all path active. Otherwise httpd doesn't start with 'invalid path' error.
My question is, how to force httpd starting without path or drive exists checking?
Platform Windows7 x64
Apache version 2.4.3
Package Xampp
Greetings,
sworduke |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 01 Aug '13 14:02 Post subject: |
|
|
Hi sworduke,
which path in invalid? The vhost paths or the server path itself? |
|
Back to top |
|
sworduke
Joined: 31 Jul 2013 Posts: 5 Location: Poland
|
Posted: Fri 02 Aug '13 9:37 Post subject: |
|
|
It's about server alias paths, eg.:
Code: | Alias /sdata "s:/sdata/"
<Directory "s:/sdata/">
Options Indexes MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory> |
This path "s:/sdata/" doesn't exist while server is starting so that operation/attempt is failed.
I'd like to start server without checking if such path or drive exists.
Greetings,
sworduke |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Fri 02 Aug '13 12:30 Post subject: |
|
|
Well that is not possible with apache. However you can mount a harddirve into a folder on your C: or whatever partion. Than I think it shouldn't be a problem since the folder can exist even if empty when not mounted yet. |
|
Back to top |
|
sworduke
Joined: 31 Jul 2013 Posts: 5 Location: Poland
|
Posted: Fri 02 Aug '13 19:39 Post subject: |
|
|
I don't know what for this path are checked for such critical error. Moreover, this alias directories are not 'locked' by httpd so I can unmount my S drive just after server is started. Nothing wrong happens than and the only effect is 404 error while calling this location.
If there's no idea to switch this checking off the only way is changing and recompiling source than? :O
BTW, I have also FTP server and it's starting without any error, the only the warning is logged (pretty wise).
sworduke |
|
Back to top |
|
KenD
Joined: 30 Jul 2013 Posts: 7 Location: US, Gainesville, FL
|
Posted: Sun 04 Aug '13 19:59 Post subject: |
|
|
One trick is to use the subst command at startup to create a local virtual drive that will exist when Apache starts.
Create a directory such as c:\TempSDrive\sdata.
You can create placeholder files for index.html and custom 404 errors with maintenance text
install AutoExNT from the windows resource kit
download - http://www.microsoft.com/en-us/download/details.aspx?id=17657
docs - http://support.microsoft.com/kb/243486
open command window with "Run as Administrator" option
Create C:\windows\system32\AutoExNT.bat file that contains the following to create virtual S drive
"Subst S: c:\TempSDrive"
run the following commands (source path may be different depending on OS)
copy "c:\program files (x86)\windows resource kits\tools\autoexnt.exe" "C:\windows\system32"
copy "c:\program files (x86)\windows resource kits\tools\servmess.dll" "C:\windows\system32"
copy "c:\program files (x86)\windows resource kits\tools\instexnt.exe" "C:\windows\system32"
instexnt install
Check current dependencies for Apache2.4 service
sc qc Apache2.4
In my case, the default install of Apache2.4 depends on Tcpip and Afd.
Configure Apache2.4 service to wait until the AutoExNT batch file runs (and in my case, network drives are available) before starting
Note that the depend= must have a space afer it and it overwrites current dependencies, so include current dependencies
sc config Apache2.4 depend= "AutoExNT/LanmanWorkstation/Tcpip/Afd"
When the system boots, it will use the files in the virtual drive.
When you are ready to mount the truecrypt drive, delete the virtual S drive with "subst s: /D", then mount the truecrypt drive.
Another option (which I have not tried) should allow the files to be usable at boot time, but the truecrypt password would be visible to anyone who can read the AutoExNT.bat file.
Edit AutoExNT.bat to mount the truecrypt drive from the command line instead running the subst command.
Make AutoExNT service depend on truecrypt - sc config AutoExNT depend= "truecrypt" |
|
Back to top |
|
Xing Moderator
Joined: 26 Oct 2005 Posts: 49
|
Posted: Sun 04 Aug '13 22:11 Post subject: |
|
|
Great post, was for me a puzzle for a long long time.
Thank you. |
|
Back to top |
|
sworduke
Joined: 31 Jul 2013 Posts: 5 Location: Poland
|
Posted: Sat 10 Aug '13 23:42 Post subject: |
|
|
Thanks a lot for above tutorial, I'll check it just after be back from holidays.
I thought about subst command in the past and even did a few test with. This idea was dropped by me because of some problems (I don't remember now). I'll try to set it up this time.
Greetings,
sworduke |
|
Back to top |
|
sworduke
Joined: 31 Jul 2013 Posts: 5 Location: Poland
|
Posted: Tue 20 Aug '13 9:32 Post subject: |
|
|
Hi,
At least I have succeeded using this subst command. The only problem was with starting autoexnt service and I had to change some path locations:
in registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\AutoExNT
ImagePath -> "c:\Program Files (x86)\Windows Resource Kits\Tools\autoexnt.exe"
autoexnt.bat -> c:\windows\syswow64
Service can not start if above files was placed in c:\windows\system32
One more problem was with subst drive unmounting, it only works with admin privileges. It was good moment to switch UAC completely off (it's driven me mad for long time).
Additionally I create the same directory structure in virtual subst drive (like in truecrypt data). Now calling this location when disk is not mounted shows just empty folder not 404 error.
Thanks a lot,
sworduke |
|
Back to top |
|