0

I've installed Wampserver 2.5 and Wordpress on a windows server 2008 R2 at my work place and manged to get a website working. Everything is fine on that machine.

The problem is when trying to access the site from a different machine on the intranet.

I get a 403 forbidden error, given by the Apache server.

I guess that means I need to set the right permissions on the Apache server.

I wonder if the fact that wamp 2.5 uses virtual hosts now has any affect.

Currently these are the settings I've got on the httpd.conf file:

<Directory "c:/wamp/www/">
  Options Indexes FollowSymLinks
  AllowOverride all
  Order Deny,Allow
#    Deny from all
#    Allow from 127.0.0.1
#    Allow from ::1
  Allow from all
  Require all granted
</Directory>

And these are the settings on the phpmyadmin.conf:

<Directory "c:/wamp/apps/phpmyadmin4.1.14/">
   Options Indexes FollowSymLinks MultiViews
   AllowOverride all
  <IfDefine APACHE24>
   Require local
  </IfDefine>
  <IfDefine !APACHE24>
    Order Deny,Allow
#     Deny from all
#     Allow from localhost ::1 127.0.0.1
Allow from all
    </IfDefine>
  php_admin_value upload_max_filesize 128M
  php_admin_value post_max_size 128M
  php_admin_value max_execution_time 360
  php_admin_value max_input_time 360
</Directory>

Your help is appreciated.

EDIT:

After reintalling wampserver 2.5 I followed their guide here for adding virtual hosts, and after each step I made sure that I can reach Wamp's main screen from another machine. I lost contact after doing this step:

Find this line in httpd.conf
 #Virtual hosts
 #Include conf/extra/httpd-vhosts.conf
And just remove the `#` to uncomment the Include line.

But if I don't do this step than I can't login to the Wordpress site from the machine it's installed on (same one as wamp).

So I still need your help.

EDIT 2:

Here's my httpd-vhosts.conf file:

 <VirtualHost *:80>
     DocumentRoot "c:/wamp/www"
     ServerName localhost
     ServerAlias localhost
     <Directory  "c:/wamp/www">
        AllowOverride All
        Require all granted
     </Directory>
 </VirtualHost>

 <VirtualHost *:80>
     DocumentRoot "c:/wamp/www/hista-portal"
     ServerName hista-portal
     <Directory  "c:/wamp/www/hista-portal">
        AllowOverride All
        Require all granted
     </Directory>
 </VirtualHost>
ubonozur
  • 47
  • 1
  • 6

1 Answers1

1

Stick to Apache 2.4 commands rather than mixing Apache2.2 and 2.4 commands.

Virtual Hosts are a Help and not a hinderance.

Look at what you are doing

APACHE24 is defined in httpd.conf if you are using WAMPServer2.5

you are using Apache 2.4

This will probably fix your issue.

<Directory "c:/wamp/www/">
  Options Indexes FollowSymLinks
  AllowOverride all
  Require all granted
</Directory>

And the phpmyadmin config file

<Directory "c:/wamp/apps/phpmyadmin4.1.14/">
   Options Indexes FollowSymLinks MultiViews
   AllowOverride all
  <IfDefine APACHE24>
     Require all granted
  </IfDefine>
  <IfDefine !APACHE24>
    Order Deny,Allow
    Allow from all
  </IfDefine>
  php_admin_value upload_max_filesize 128M
  php_admin_value post_max_size 128M
  php_admin_value max_execution_time 360
  php_admin_value max_input_time 360
</Directory>

But you would be better to use syntax like

Require ip 192.168.1

instead of Require all granted, so access is allowed from just your internal network subnet, assuming your subnet ip addresses start with 192.168.1

And if all else fails check out the manual http://httpd.apache.org/docs/current/howto/access.html

EDIT SECOND PROBLEM

If you did the uncomment properly, you have now included the wamp/bin/apache/apache2.4.9/conf/extra/httpd-vhosts.conf into httpd.conf so I would guess there is a problem in the edits you made in that file.

To get Apache to help with the diagnosis of the problem :-

First open a command windows

cd \wamp\bin\apache\apache2.4.9\bin
httpd -t

This should parse the config files and report any errors with a filename and line number where the error occured.

Fix the error and rerun above command until you get a message Syntax OK

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
  • RiggsFolly, thanks for the elaborate answer. It didn't do the trick but after reinstalling wampserver 2.5 I found where the problem is. But I still don't know how to solve it. I'd appreciate it if you could read my edit to the original question and see if you could help again. Thanks – ubonozur Jul 13 '14 at 09:55
  • I assume you uncommented just the line `#Include conf/extra/httpd-vhosts.conf` and not the LABEL line above it? – RiggsFolly Jul 13 '14 at 11:17
  • Yes, just this line. Now, I made another small progress: in httpd-vhosts.conf I changed the lines that say `Require local` into `Require all granted`. And now I can reach the wampserver main page from another machine, but still, when I click the link to the site I get the 403 error. The IT guy in my company says it doesn't seem right that it says `ServerName localhost` in that file, but we don't know what to do instead. – ubonozur Jul 13 '14 at 11:50
  • Show your httpd-vhosts.conf file in your question – RiggsFolly Jul 13 '14 at 12:32
  • Just saw the edit to your answer. Went through it and I got syntax ok on the first try. – ubonozur Jul 13 '14 at 12:54
  • Actually, now I noticed it's not a 403 error, but a "server not found error". Again, I only get that when clicking the site's link. The main wampserver site loads fine. – ubonozur Jul 13 '14 at 12:58
  • RiggsFolly, I hope you're still with me cause you're my last hope. I've noticed another thing that might give a clue to where the problem is, but it's too long to describe in a comment and since I made some progress since the original question I'll just open a new one (I hope it's ok). – ubonozur Jul 14 '14 at 06:52
  • 1
    Problem finally solved. Can be found here http://stackoverflow.com/questions/24731467/wordpress-portal-not-accessible-from-intranet/24732672#24732672 – ubonozur Jul 14 '14 at 08:48