I have wampserver 3.1.4 running on Windows 10. It starts php & MySql OK but it won't start Apache.
I can run httpd.exe from the command line and it starts no problem.
The EventViewer tells me I have a Syntax error in my vhosts file on the DocumentRoot line, but I've checked the paths and everything is correct, and it starts OK from the CLI.
Seems to be that wampapache64 has a misconfiguration somewhere.
This is my httpd-vhosts.conf file
The Syntax error occurs on the 'DocumentRoot' line in the second block.
If I remove the second block it works fine.
The path to the folder is correct
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName local.shiftlegal.co.nz
DocumentRoot "c:/projects/true/shift/shiftlegal.co.nz"
<Directory "c:/projects/true/shift/shiftlegal.co.nz/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
I should also note that this exact configuration was working a couple of days ago.
I get 2 error messages in the Windows EventViewer every time I try to run wamp:
The Apache service named reported the following error:
>>> AH00526: Syntax error on line 16 of C:/wamp64/bin/apache/apache2.4.35/conf/extra/httpd-vhosts.conf: .
The Apache service named reported the following error:
>>> DocumentRoot must be a directory .
Well.
I'm not exactly sure what happened but it turns out it had not very much to do with wampserver.
It seems my projects folder was corrupted somehow. I created a new folder and added a project and it worked.
Thanks #RiggsFolly for all your help.
Related
Environment
XAMPP 7.2.4 installed on Windows 10
Apache running on ports 80 and 443
Configuration
C:\Windows\System32\drivers\etc\hosts:
127.0.0.1 www.test.local test.local
C:\xampp\apache\conf\httpd.conf:
DocumentRoot "D:/htdocs"
<Directory "D:/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
C:\xampp\apache\conf\extra\httpd-vhosts.conf:
<VirtualHost *:80>
DocumentRoot D:/htdocs
ServerName localhost
<Directory "D:/htdocs">
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot D:/htdocs
ServerName test.local
<Directory "D:/htdocs">
Allow from all
</Directory>
</VirtualHost>
The problem
When I start Apache and I access to localhost is all right. The problem comes when I try to reach test.local: the browser returns a This site can’t be reached message. It's like XAMPP ignores the custom domain vhosts defined into httpd-vhost.conf file. The same message is displayed with the server off.
This site can’t be reached
The webpage at http://test.local/ might be temporarily down or it may have moved permanently to a new web address.
ERR_ADDRESS_INVALID
A few days ago the setup was working and the only changes that I made was the new software installation. I mean, no changes in Apache config files.
If all your stack were working correctly before, don't be like me and don't forget to check if some browser extension is blocking your local traffic, like some extension related with an antivirus system.
In my case it was the Kaspersky Protection extension. When something goes wrong, it shows the following graphic.
C:\Windows\System32\drivers\etc
127.0.0.1 test.local
C:\xampp\apache\conf\extra\httpd-vhosts.conf:
<VirtualHost *:80>
ServerAdmin webmaster#dummy-host2.example.com
DocumentRoot "C:/wamp64/www/test"
ServerName test.local
<Directory "C:/wamp64/www/hydroboost/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
Have you updated your C:\Windows\System32\drivers\etc\hosts file with a mapping like this this?
add this line to the end of the hosts file
127.0.0.1 test.local
the localhost domain works without this mapping, because the OS already recognizes "localhost" as a built in alias for the loopback IP address
(this suggestion is assuming that you are running and testing on the same local machine)
I am using EasyPHP (version 16.1.1) for Apache server (installed version 2.4.18 x86). I need to add a new VirtualHost, so now the whole VirtualHost section of httpd.conf looks like this:
# VIRTUAL HOSTS
## Virtualhost localweb
<VirtualHost 127.0.0.1>
DocumentRoot "C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www"
ServerName 127.0.0.1
<Directory "C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www">
Options FollowSymLinks Indexes ExecCGI
AllowOverride All
Order deny,allow
Allow from 127.0.0.1
Deny from all
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:8080>
UseCanonicalName Off
ServerAdmin marekbuchtela#gmail.com
ServerName posis
ServerAlias posis.tovarna
VirtualDocumentRoot "C:\Users\marek\is\tovarna\public"
</VirtualHost>
The first one is the default one made by EasyPHP, the second one is added by me. However in this setup, the Apache won't start. When I remove the second VirtualHost, everything works fine, but with it, it just won't start at all. I have checked the error log and there is no output at all.
Any ideas why is this happening/how to fix it?
Thanks
Switch VirtualDocumentRoot "C:\Users\marek\is\tovarna\public"for DocumentRoot "C:\Users\marek\is\tovarna\public"
If by any chance you keep getting the error, show error_log output
There is another instance other than the answer given by ezra-s as to why EasyPHP server won't start and the Apache error log is empty.
When declaring paths in the vhosts file, it is important that the directories referenced in those paths exist. If you provide the following VirtualHost information, for example:
<VirtualHost *:80>
DocumentRoot "D:/MyApp/public_html"
ServerName myapp.local
ErrorLog "D:/MyApp/logs/error.log"
CustomLog "D:/MyApp/logs/apache.log" common
</VirtualHost>
...but you don't have a D: drive, or the directories D:/MyApp/ and D:/MyApp/logs/ don't exist, then you'll get a "silent fail" in Apache when starting the HTTP server from the EasyPHP console.
I am setting up a local site on my mac Mavericks. When I do it I get a 500 error. The logs show me the error in the ".htaccess: IfModule not allowed here". From everything I have seen it says to put AllowOverride ALL to fix this issue but it is not working for me. I know I am just missing something simple so any suggestions would be appreciated.
Thanks
Below is my conf file for that vhost.
<VirtualHost *:80>
DocumentRoot "/Users/Swany/Sites/test/public"
ServerName test.dev
ErrorLog "/private/var/log/apache2/test.dev-error_log"
CustomLog "/private/var/log/apache2/test.dev-access_log" common
<Directory "/Users/Swany/code/www/test/public">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Looks like I also needed to go into the default conf file /etc/apache2/httpd.conf and also switch AlloOveride All and Require all granted and it started to work. I thought the vhost conf file would override it but apparently not.
On a Windows machine running XAMPP I have a folder in my web root called 'static'. It and everything in it return a 404 error even though the folder is there.
If I change the name of the folder, e.g. 'statics', all is well. I have other servers (Ubuntu) running Apache and I do not have this problem.
The site is a copy of one of the sites on one of our Linux servers. What can I do or change to allow the directory to work as named?
EDIT vhosts.conf
<VirtualHost *:8080>
ServerAdmin jablanchard#foo.com
DocumentRoot "C:/xampp/htdocs/home/app/gateway"
ServerName localhost
ServerAlias 127.0.0.*
ErrorLog "logs/error.log"
CustomLog "logs/access.log" common
</VirtualHost>
<Directory C:/xampp/htdocs/home/app/gateway/>
# allow .htaccess overrides to work
AllowOverride All
DirectoryIndex login.html index.html index.php
</Directory>
# this matches a link to any project directory to the physical webui directory
AliasMatch ^/projects/([-\w]*)/(.*)$ /home/src/gateway/webui/$2
<Directory /home/src/gateway/webui>
DirectoryIndex home.html
Options All
AllowOverride All
Require all granted
</Directory>
I was getting ready to re-install XAMPP but made one last pass through the config files for Apache. I found the problem was this bit of code in the httpd.conf file -
Alias "/static" "C:/xampp/htdocs/static"
<Directory "C:/xampp/htdocs/static">
AllowOverride All
Require all granted
</Directory>
I am not sure if this is part of the XAMPP install as all of the edits I have made to this installation are in the vhosts file. Once commented out the static directory, as I have defined it, works properly now.
I just installed suPHP and now need a little help setting up some environment variables to make it work with my web directory structure.
In the suPHP.conf I have a standard array of global options, what I'm really concerned about is this line:
;Path all scripts have to be in
docroot=${HOME}
;Path to chroot() to before executing script
;chroot=/mychroot
I replaced the default value of /var/www to ${HOME} hoping that it does something.
I know suPHP is running because when I was playing around with the docroot paths I would get an error telling the Documentroot of my site isn't specified in the suPHP configuration.
In my VirtualHost directive I have placed:
<VirtualHost *:80>
ServerAdmin admin#abc.com
ServerName abc.com
ServerAlias www.abc.com
DocumentRoot /web/users/abc.com/htdocs
<IfModule mod_suphp.c>
suPHP_ConfigPath ${DOCUMENT_ROOT}/
</IfModule>
<Directory "/web/users/abc.com/htdocs">
AllowOverride All
Order allow,deny
Allow from ALl
</Directory>
</VirtualHost>
Now, I have placed a php.ini in the document root of my VirtualHost and did something simple like display_errors = On and echoed an un declared variable to test it. But I'm not seeing an error pop up (and yes, I have the error level set to E_STRICT and E_ALL).
Further more, I can't seem to get su_PHP_UserGroup to work, on reloading apache i get an error saying that i have a syntax error at that line.