| Author |
|
Damn Yankee
Joined: 28 Dec 2025 Posts: 6 Location: East Tennessee
|
Posted: Sun 28 Dec '25 18:15 Post subject: Pointing To A Remote Folder |
|
|
Hi Folks, Newb here.
I recently installed PHP and then Apache 2.4 downloaded from Apache Lounge (finding and removing the "-64" references in httpd.conf) on a Windows 11 machine to be used as a dev server. All 4 site folders are located in a remote folder called "Web Development" on the C: drive.
I have trolled the Internet for several weeks and questioned other forums with conflicting and very different responses - none of which worked. It seems this is a subject that is a ghost.
In the case of the site which I wish to use Apache, "imheuristic" the last iteration of configuration was:
| Code: | <VirtualHost imheuristic.local>
DocumentRoot "C:/John's Stuff/Hobbies/Developing/Web Development/GCHS"
ServerName imheuristic.local
</VirtualHost>
#<VirtualHost localhost> This code breaks localhost which opens my form containing the phpinfo() function.
#DocumentRoot C:/Apache/htdocs
#ServerName localhost
#</VirtualHost> |
Note the localhost is remarked-out as it throws an error upon Apache restart.
This code is located at the end of httpd.conf. I added the line:
127.0.0.1 imheuristic.local
in C:\windows\system32\drivers\etc\hosts, however if typed in the address bar I am presented with an "Internal Server Error" page. My goal is to point Apache to all site folders and keep the localhost pointing to htdocs.
Please, what am I missing? |
|
| Back to top |
|
James Blond Moderator

Joined: 19 Jan 2006 Posts: 7451 Location: EU, Germany, Next to Hamburg
|
Posted: Sun 28 Dec '25 22:02 Post subject: |
|
|
The problem is the name in the virtual host definition.
remove the name and only use *:80. The ServerName inside the vhost is enough.
For an example config with a default vhost see https://gist.github.com/JBlond/3d58a1a2e66ce0e42413d9015377a72c
if you still have a question please ask again. |
|
| Back to top |
|
Damn Yankee
Joined: 28 Dec 2025 Posts: 6 Location: East Tennessee
|
Posted: Sun 28 Dec '25 22:40 Post subject: |
|
|
I changed it as you suggested. Restarting Apache threw:
[Sun Dec 28 15:35:50.903763 2025] [core:error] [pid 2864:tid 476] (OS 11003)A non-recoverable error occurred during a database lookup. : AH00547: Could not resolve host name @ -- ignoring!
The example you provided made me think this code should be in the httpd-vhosts.conf file. If that is true, how do I get httpd.conf to point to that file? |
|
| Back to top |
|
Otomatic

Joined: 01 Sep 2011 Posts: 304 Location: Paris, France, EU
|
Posted: Mon 29 Dec '25 11:26 Post subject: |
|
|
Hi,
How it works at my place:
httpd.conf
| Code: |
Listen 0.0.0.0:80
Listen [::0]:80
|
httpd-vhosts.conf
| Code: |
<VirtualHost *:80>
DocumentRoot "C:/John's Stuff/Hobbies/Developing/Web Development/GCHS"
ServerName imheuristic.local
<Directory "C:/John's Stuff/Hobbies/Developing/Web Development/GCHS/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride all
Require local
</Directory>
</VirtualHost>
|
hosts
| Code: |
127.0.0.1 imheuristic.local
::1 imheuristic.local
|
|
|
| Back to top |
|
Damn Yankee
Joined: 28 Dec 2025 Posts: 6 Location: East Tennessee
|
Posted: Mon 29 Dec '25 16:45 Post subject: Pointing To A Remote Folder |
|
|
@Otomatic, thank you for the reply.
I changed "Listen 80" to your 2-line code and changed what I had to what you provided for VirtualHost. I updated the Windows hosts folder to include the second line.
imheuristic.local now opens my dev site - thank you!.
localhost however now serves up "Internal Server Error". I would like to keep the ability to access the htdocs folder to ensure Apache and PHP are playing together nicely without changing file extensions. Can this be done?
Also, can you explain what is happening with the Directives and their Parameters so I can get a grasp of how it all works without having to ask? I feel like a PIA... [/b] |
|
| Back to top |
|
Otomatic

Joined: 01 Sep 2011 Posts: 304 Location: Paris, France, EU
|
Posted: Mon 29 Dec '25 16:59 Post subject: |
|
|
Hi,
| Quote: | | can you explain what is happening with the Directives and their Parameters |
I can only advise you to take a look at the excellent Apache documentation:
https://httpd.apache.org/docs/2.4/en/mod/quickreference.html
As for me, I use Wampserver:
WampServer is a Windows-based Web development platform, without Internet access, for dynamic Web applications using the Apache 2.4 server, PHP scripting language and a MySQL and/or MariaDB database. Includes PHPMyAdmin and Adminer for database management. WampServer automatically installs everything you need to intuitively develop Web applications. You can adjust your server without touching its configuration files, using the various left-click and right-click menus of the Tray Menu Manager installed in the taskbar.
https://wampserver.aviatechno.net/ |
|
| Back to top |
|
Damn Yankee
Joined: 28 Dec 2025 Posts: 6 Location: East Tennessee
|
Posted: Mon 29 Dec '25 17:35 Post subject: Pointing To A Remote Folder |
|
|
@Otomatic,
I have read the documentation and it is confusing, but I will not burden you with that.
I still have a server config problem...
After I modded httpd.conf per your instructions, imheuristic.local worked and I thanked you for that. After closing, I should have reopened it again for I just tried to open it and I get an Internal Server Error.
I restarted Apache - same thing. I restarted Windows - same. i opened the config file and hosts file and they are correct. What else could be at work here??? |
|
| Back to top |
|
Otomatic

Joined: 01 Sep 2011 Posts: 304 Location: Paris, France, EU
|
Posted: Mon 29 Dec '25 17:59 Post subject: |
|
|
Hi,
Take a look at "apache_error.log" |
|
| Back to top |
|
Damn Yankee
Joined: 28 Dec 2025 Posts: 6 Location: East Tennessee
|
Posted: Mon 29 Dec '25 18:13 Post subject: Pointing To A Remote Folder |
|
|
I was just doing that (for the first time - told you I was a Newb). it appears there has been a problem since first install. I included a few errors logged yesterday to indicate the pre-existing history and the half-dozen or so attempts to reopen imheuristic.local:
11464:tid 1164] [client ::1:55676] C:/John's Stuff/Hobbies/Developing/Web Development/GCHS/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration, referer: http://imheuristic.local/
I am presuming you will suggest a WAMP install. Is there any caveats I should look for to remove all of this Apache installation? PHP was done with a zip file - anything I need to clean-up after deleteing that folder? |
|
| Back to top |
|
Otomatic

Joined: 01 Sep 2011 Posts: 304 Location: Paris, France, EU
|
Posted: Mon 29 Dec '25 18:30 Post subject: |
|
|
Hi,
> Invalid command 'RewriteEngine'
In httpd.conf, uncomment:
LoadModule rewrite_module modules/mod_rewrite.so
ie remove # at the begigning of the line
Then clean-up apache_error.log |
|
| Back to top |
|
Damn Yankee
Joined: 28 Dec 2025 Posts: 6 Location: East Tennessee
|
Posted: Mon 29 Dec '25 19:24 Post subject: Pointing To A Remote Folder |
|
|
THANK YOU.
I believe you fixed me up here. I even added a second site and it too worked! Now, maybe I can figure out what/how the directives are/work!
Once again, thanks for the patience.
John |
|
| Back to top |
|