HTTP ERROR 500? - apache

I'm trying to set up my project on xampp.
<VirtualHost *:80>
ServerAdmin test#test.biz
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/test/public"
ServerName testproject.dev
ErrorLog "logs/dummy-host2.example.com-error_log"
CustomLog "logs/dummy-host2.example.com-access_log" common
<Directory "/Applications/XAMPP/xamppfiles/htdocs/test/public">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
I uncomment line in httpd.conf for virtual hosts, but stil im getting error 500. Any suggestion? I m using MAC OS.
Also in hosts i added:
127.0.0.1 testproject.dev

Any suggestion?
It's impossible to help you without checking the log. You should enable Apache HTTP Server's logging and check the events. I guess that the log in your case is dummy-host2.example.com-error_log. Look through the events and find out what's wrong with this configuration.

Related

Getting error .htaccess: <IfModule not allowed here

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.

Virtual hosts on apache

I have this configuration in httpd.conf file.
#NameVirtualHost <ip_address>
<VirtualHost <ip_address>:80>
DocumentRoot /var/www/<domain_folder>
ServerName <doman>
ErrorLog logs/<doman>-error_log
CustomLog logs/<doman>-access_log common
</VirtualHost>
after the this configuration if i type "http://domain.com" its displayed home page
with out any issue but when i click contacts page "http://domain.com/contacts/"
its displayed 404 error.
is this configuration error ?
Note : this is aptana marketplace (magento) app
If I type "domain.com/index.php/contacts/"; its working fine.
You need to enable .htaccess on your magento host. In apache default config you can add this:
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
This should solve the problem.

Adding a directory to Apache Server

I have a Windows XP system running XAMPP/Apache. I already have files on an external hard drive that I would like to serve up without moving them to the same drive as the Apache installation.
Here is what I've tried so far:
In the main HTTPD.conf file:
Alias /client_files D:/clients/files
<Directory D:/clients/files>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
But the only result I got was :
Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server.
If you think this is a server error, please contact the webmaster.
Error 403
localhost
Apache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.6
I also tried adding to the HTTPD-VHOSTS.conf file:
ServerName client_files
ServerAlias client_files
DocumentRoot "D:/clients/files"
And also:
<VirtualHost *:80>
ServerAdmin webmaster#dummy-host.example.com
DocumentRoot "D:/clients/files"
ServerName client_files
ServerAlias client_files
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
But neither of these worked either. How in the world can I add another directory to an Apache installation and have it accesible via something like "localhost/client_files"?
Any suggestions?
UPDATE: [SOLVED]
As per #Pedro Nunes's answer below, I now have my httpd.conf file with this section at the end of the file and which includes the line "Require all granted" which Pedro answered with and which now solves the issue:
Alias /client_files D:/clients/files
<Directory D:/clients/files>
Require all granted
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
Have you tried Require all granted inside the directory section?
This will grant access to all requests.
This guide explains exactly how I have it setup on my windows xampp machine. http://www.delanomaloney.com/2013/07/10/how-to-set-up-virtual-hosts-using-xampp/
remember to give an absolute documentroot path as well as adding the 127.0.0.1 servername line to hosts in C:/Windows/System32/drivers/etc/hosts

Getting 403 forbidden error on WAMP server when usng SSL

I have just spent the last 4 hours trying to get SSL working on my local devolopment wamp server (windows 7).
Everything seems to be setup ok now, well the server restarts without any errors at least!!
The only issue I can not seem to solve is a 403 forbidden when I try to access my site through HTTPS (SSL 443). It works fine on port 80, just not on 443.
The error log shows the following
[error] [client 127.0.0.1] client denied by server configuration: F:/My Webs/freedate/public_html/
My http.conf file has the following vhost added
<VirtualHost *:80>
ServerName www.freedate.local
ServerAlias freedate.local *.freedate.local
DocumentRoot "F:\My Webs\freedate\public_html"
<Directory "F:\My Webs\freedate\public_html">
allow from all
order allow,deny
# Enables .htaccess files for this site
AllowOverride All
</Directory>
DirectoryIndex index.html index.php
</VirtualHost>
And my httpd-ssl.conf has the following vhost added
<VirtualHost *:443>
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile "C:/wamp/bin/apache/Apache2.2.21/conf/ssl/server.crt"
SSLCertificateKeyFile "C:/wamp/bin/apache/Apache2.2.21/conf/ssl/server.key"
ServerName www.freedate.local
ServerAlias freedate.local *.freedate.local
DocumentRoot "F:\My Webs\freedate\public_html"
<Directory "F:\My Webs\freedate\public_html">
Options -Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
DirectoryIndex index.html index.php
</VirtualHost>
If anyone can spot what I am doing wrong I would be most grateful, many thanks.
Kind regards
Garry
Although this is a very old question, I faced the same issue today and I am giving the solution here for anyone facing this issue in the future.
This solution should work if everything is working without SSL. You can find help working without SSL here: https://stackoverflow.com/a/14671738/2407971
In the httpd-ssl.conf file, between the <VirtualHost _default_:443> and </VirtualHost> code blocks, you will find something like this:
<Directory "c:/Apache24/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
After these lines, insert the following code:
<Directory "c:/wamp64/www/">
#Options FollowSymLinks
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
<Directory "c:/wamp64/www/yoursite/">
#Options FollowSymLinks
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
This will basically allow the root directory of the www folder and yoursite to be accessible in SSL.
Restart the server and test your site.
Hope it helps.

Adding VirtualHost fails: Access Forbidden Error 403 (XAMPP) (Windows 7)

I've got a XAMPP installation running on Windows 7.
As soon as I add a VirtualHost to httpd-vhosts.conf, BOTH the 'regular' http://localhost AND the new dropbox.local aren't working.
This is what I added to my httpd-vhosts.conf:
<VirtualHost *:80>
ServerAdmin postmaster#dummy-host.localhost
DocumentRoot "E:/Documenten/Dropbox/Dropbox/dummy-htdocs"
ServerName dropbox.local
ServerAlias www.dropbox.local
ErrorLog "logs/dropbox.local-error.log"
CustomLog "logs/dropbox.local-access.log" combined
</VirtualHost>
So I looked up my dropbox.local-error.log for any information:
[Thu Feb 02 10:41:57 2012] [error] [client 127.0.0.1] client denied by server configuration: E:/Documenten/Dropbox/Dropbox/dummy-htdocs/
This error seems to be solved by adding
<directory "E:/Documenten/Dropbox/Dropbox/dummy-htdocs">
Allow from all
</directory>
But now I get this error in dropbox.local-error.log:
[Thu Feb 02 10:45:56 2012] [error] [client ::1] Directory index forbidden by Options directive: E:/Documenten/Dropbox/Dropbox/dummy-htdocs/
Furthermore when I try to access http://localhost, I dont get any error in the regular error.log, although I get the error 403 when I try to access it.
Can anybody help... It's driving me mad :S
EDIT:
Also in httpd.conf there is the following (I've seen it mentioned multiple times, so before anyone says it):
<IfModule dir_module>
DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.html index.htm \
default.php default.pl default.cgi default.asp default.shtml default.html default.htm \
home.php home.pl home.cgi home.asp home.shtml home.html home.htm
</IfModule>
Okay: This is what I did now and it's solved:
My httpd-vhosts.conf looks like this now:
<VirtualHost dropbox.local:80>
DocumentRoot "E:/Documenten/Dropbox/Dropbox/dummy-htdocs"
ServerName dropbox.local
ErrorLog "logs/dropbox.local-error.log"
CustomLog "logs/dropbox.local-access.log" combined
<Directory "E:/Documenten/Dropbox/Dropbox/dummy-htdocs">
# AllowOverride All # Deprecated
# Order Allow,Deny # Deprecated
# Allow from all # Deprecated
# --New way of doing it
Require all granted
</Directory>
</VirtualHost>
First, I saw that it's necessary to have set the <Directory xx:xx> options. So I put the <Directory > [..] </Directory>-part INSIDE the <VirtualHost > [..] </VirtualHost>.
After that, I added AllowOverride AuthConfig Indexes to the <Directory> options.
Now http://localhost also points to the dropbox-virtualhost. So I added dropbox.local to <VirtualHost *:80> which makes it as <VirtualHost dropbox.local:80>
FINALLY it works :D!
I'm a happy man! :) :)
I hope someone else can use this information.
For me worked when I changed "directory" content into this:
<Directory "*YourLocation*">
Options All
AllowOverride All
Require all granted
</Directory>
For me (also XAMPP on Windows 7), this is what worked:
<Directory "C:\projects\myfolder\htdocs">`
AllowOverride All
Require all granted
Options Indexes FollowSymLinks
</Directory>`
It is this line that would cause the 403:
Order allow,deny
I'm using XAMPP 1.6.7 on Windows 7. This article worked for me.
I added the following lines in the file httpd-vhosts.conf at C:/xampp/apache/conf/extra.
I had also uncommented the line # NameVirtualHost *:80
<VirtualHost mysite.dev:80>
DocumentRoot "C:/xampp/htdocs/mysite"
ServerName mysite.dev
ServerAlias mysite.dev
<Directory "C:/xampp/htdocs/mysite">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
After restarting the apache, it were still not working.
Then I had to follow the step 9 mentioned in the article by editing the file C:/Windows/System32/drivers/etc/hosts.
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
::1 localhost
127.0.0.1 mysite.dev
Then I got working http://mysite.dev
Thank you, that worked! But I replaced this
AllowOverride AuthConfig Indexes
with that
AllowOverride All
Otherwise, the .htaccess didn't work: I got problems with the RewriteEngine and the error message "RewriteEngine not allowed here".
Above suggestions didn't worked for me. I got it running on my windows, using inspiration from
http://butlerccwebdev.net/support/testingserver/vhosts-setup-win.html
For Http inside httpd-vhosts.conf
<Directory "D:/Projects">
AllowOverride All
Require all granted
</Directory>
##Letzgrow
<VirtualHost *:80>
DocumentRoot "D:/Projects/letzgrow"
ServerName letz.dev
ServerAlias letz.dev
</VirtualHost>
For using Https (Open SSL) inside httpd-ssl.conf
<Directory "D:/Projects">
AllowOverride All
Require all granted
</Directory>
##Letzgrow
<VirtualHost *:443>
DocumentRoot "D:/Projects/letzgrow"
ServerName letz.dev
ServerAlias letz.dev
</VirtualHost>
Hope it helps someone !!
After so many changes and tries and answers.
For
SOs: Windows 7 / Windows 10
Xampp Version: Xampp or Xampp portable 7.1.18 / 7.3.7 (control panel v3.2.4)
Installers: win32-7.1.18-0-VC14-installer / xampp-windows-x64-7.3.7-0-VC15-installer
Do not edit other files like httpd-xampp
Stop Apache
Open httpd-vhosts.conf located in **your_xampp_directory**\apache\conf\extra\ (your XAMPP directory might be by default: C:/xampp/htdocs)
Remove hash before the following line (aprox. line 20): NameVirtualHost *:80 (this might be optional)
Add the following virtual hosts at the end of the file, considering your directories paths:
##127.0.0.1
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
</VirtualHost>
##127.0.0.2
<VirtualHost *:80>
DocumentRoot "F:/myapp/htdocs/"
ServerName test1.localhost
ServerAlias www.test1.localhost
ErrorLog "logs/myapp-error.log"
CustomLog "logs/myapp-access.log" common
<Directory "F:/myapp/htdocs/">
#Options All # Deprecated
#AllowOverride All # Deprecated
Require all granted
</Directory>
</VirtualHost>
Edit (with admin access) your host file (located at Windows\System32\drivers\etc, but with the following tip, only one loopback ip for every domain:
127.0.0.1 localhost
127.0.0.2 test1.localhost
127.0.0.2 www.test1.localhost
For every instance, repeat the second block, the first one is the main block only for "default" purposes.
I am using xampp 1.7.3. Using inspiration from here: xampp 1.7.3 upgrade broken virtual hosts access forbidden
INSTEAD OF add <Directory> .. </Directory> in httpd-vhosts.conf, I add it in httpd.conf right after <Directory "D:/xampplite/cgi-bin"> .. </Directory>.
Here is what I add in httpd.conf:
<Directory "D:/CofeeShop">
AllowOverride All
Options All
Order allow,deny
Allow from all
</Directory>
And here is what I add in httpd-vhosts.conf
<VirtualHost *:8001>
ServerAdmin postmaster#dummy-host2.localhost
DocumentRoot "D:/CofeeShop"
ServerName localhost:8001
</VirtualHost>
I also add Listen 8001 in httpd.conf to complete my setting.
Hope it helps
For many it's a permission issue, but for me it turns out the error was brought about by a mistake in the form I was trying to submit. To be specific i had accidentally put a "greater than" sign after the value of "action". So I would suggest you take a second look at your code.