ubonozur
ubonozur

Reputation: 47

Can't access WP site with Wamp 2.5 from intranet

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>

Upvotes: 0

Views: 2998

Answers (1)

RiggsFolly
RiggsFolly

Reputation: 94652

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

Upvotes: 1

Related Questions