keep getting 403 access forbidden using apache webserver

Hello,

I am an Apache newbie but I will try and describe the issue the best I can.

I have XAMPP 1.8.3 / XAMPP control panel 3.2.1 with Apache 2.4.7 running on a server using Windows server 2012 and I want to use this server to host multiple websites with different domains.

I initially setup my first website on there and everything worked ok however when I went to add a different site with different domain things started to go wrong. Now when I visit http://www.myfirstsite.co.uk I get this error:

Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.

Error 403

www.MYFIRSTSITE.co.uk
Apache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.9


However if I go to https://www.myfirstsite.co.uk it works fine and the SSL works fine.

If i try to try to browse to http://www.mysecondsite.co.uk I getr the same 403 error and if I go to https://www.mysecondsite.co.uk it takes me to my first website.

Here is a copy of my httpd-vhosts.conf file

# Virtual Hosts
#
# Required modules: mod_log_config

# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
##NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ##ServerName or ##ServerAlias in any <VirtualHost> block.
#
##<VirtualHost *:80>
    ##ServerAdmin webmaster@dummy-host.example.com
    ##DocumentRoot "C:/xampp/htdocs/dummy-host.example.com"
    ##ServerName dummy-host.example.com
    ##ServerAlias www.dummy-host.example.com
    ##ErrorLog "logs/dummy-host.example.com-error.log"
    ##CustomLog "logs/dummy-host.example.com-access.log" common
##</VirtualHost>

##<VirtualHost *:80>
    ##ServerAdmin webmaster@dummy-host2.example.com
    ##DocumentRoot "C:/xampp/htdocs/dummy-host2.example.com"
    ##ServerName dummy-host2.example.com
    ##ErrorLog "logs/dummy-host2.example.com-error.log"
    ##CustomLog "logs/dummy-host2.example.com-access.log" common
##</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "E:\www\myfirstsite.co.uk\dev\htdocs"
    ServerName www.myfirstsite.co.uk
      ServerAlias myfirstsite.co.uk
    <Directory "E:\www\myfirstsite.co.uk\dev\htdocs">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>
<VirtualHost *:443>
    DocumentRoot "E:\www\myfirstsite.co.uk\dev\htdocs"
    ServerName www.myfirstsite.co.uk
    SSLEngine on
    SSLCertificateFile "C:/xampp/apache/conf/ssl.crt/www_myfirstsite.co.uk.crt"
    SSLCertificateKeyFile "C:/xampp/apache/conf/ssl.key/www_myfirstsite.co.uk.key"
    SSLCertificateChainFile "C:/xampp/apache/conf/ssl.chain/DigiCertCA.crt"

    <Directory "E:\www\myfirstsite.co.uk\dev\htdocs">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

<VirtualHost 172.16.0.20:80>
      ServerAdmin support@mysecondsite.co.uk
      DocumentRoot "E:\www\mysecondsite.co.uk\htdocs"
      ServerName www.mysecondsite.co.uk
      ServerAlias mysecondsite.co.uk
      ServerAlias www.mysecondsite.com
      ServerAlias mysecondsite.com
      DirectoryIndex index.html
      <Directory "E:\www\mysecondsite.co.uk\htdocs">
            Options Indexes FollowSymLinks Includes ExecCGI
            AllowOverride All
            Order allow,deny
            Allow from all
      </Directory>
</VirtualHost>



Any help with this would be very much appreciated.

Thanks
LVL 2
purpleoakAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
You have two <VirtualHost *:80> on port 80.  Comment out the second one and see if the first one works then.
0
purpleoakAuthor Commented:
This has not made a difference...this is still and issue, please advise.
0
bansidharCommented:
Check if the file E:\www\mysecondsite.co.uk\htdocs\index.html exists. Second You have not defined any virtual host the handle https://www.mysecondsite.co.uk so it goes to the default (first) site.

Note: Use forward slash instead of backslash even in windows. Apache likes unix style filename syntax.

DocumentRoot "E:/www/mysecondsite.co.uk/htdocs"
<Directory "E:/www/mysecondsite.co.uk/htdocs">

etc...

Edit: sry, didn't notice this was a very old question.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.