Avatar of LeTay
LeTay
 asked on

Problem to access apache web server home page - WAMP Server and WordPress

I am starting to develop a small web site on my PC
I already have a ftp server on it, and using dynamic dns from no-ip I can access it with this name cbsl.ddns.net
I forwarded port 80 to my PC on my internet box (like I did for ftp ports)
Now I installed WAMPServer and then WordPress.
Everything looks to be correctly configurered (mySQL db created etc...)
In my browser, when I code localhost/CBSL, I get the WordPress home page
But when I code http://cbsl.ddns.net/cbsl, I get this error

Forbidden
You don't have permission to access /cbsl on this server.
Apache/2.4.9 (Win64) PHP/5.5.12 Server at cbsl.ddns.net Port 80

This shows that the connection works but it is refused.
What did I miss in the config ?
Thanks
Apache Web ServerWordPress

Avatar of undefined
Last Comment
Tinotenda Ziramba

8/22/2022 - Mon
Marco Gasi

Look at your httpd.conf (Apache conf file) near to the end of the file you should see something like
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

Open in new window


Change it to

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Allow from all
</Directory>

Open in new window

Dave Baldwin

My WAMP installation has a line in the config in the tray that allows or denies external access.  Default is to deny access.
DrDamnit

This can also happen if you don't have an index.htm our index.php file. Can you confirm that the directory route is both configured properly ( the directory exist) and that it hasn't index.html index.php file?
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
DrDamnit

*Directory root. (Mobile / auto correct issues)
LeTay

ASKER
Much better with this Allow from all !!!
LeTay

ASKER
Answer too quickly ..
Was still using localhost in the URL
Same result with cbsl.ddns.net > error as above
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Marco Gasi

You hould post here your httpd-vhost.conf file and your HOSTS file contents, please. It could be a mismatch in the site name in these two files. If you don't want to post here these files, you can just check that the name of the DocumentRoot in the first file be identical to the site listed in HOSTS file.
LeTay

ASKER
No such hosts file in my Windows 7 PC ...
Name is correct and anyway the apache server does answer ... with an error
So ?
Marco Gasi

No such hosts file in my Windows 7 PC ...
c:\Windows\System32\drivers\etc\
Name is correct and anyway the apache server does answer
This doesn't mean anything: Apache can respond with that error message if you're trying to access a site with a wrong name, otherwise I'd not suggested to check those files
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Chris Stanyon

WAMPServer's default httpd.conf will serve pages for localhost - if you look through the httpd.conf file, you'll see the following line:

ServerName localhost

This will usually be followed by the  <Directory /> block you've already edited - but it's still for the localhost.

Best way to handle this is to enable virtual hosts and then create an entry specifically for your new domain into the httpd-vhosts.conf file. Make sure your HOSTS file maps the domain to your local IP and you should be good to go.

In the httpd.conf file, remove the # from the following line:

#Include conf/extra/httpd-vhosts.conf

Now edit that httpd-vhosts.conf file and add a section for your new domain name. Something like this:

<virtualhost *:80>
      ServerName cbsl.ddns.net
      DocumentRoot "C:/path/to/your/files/public_html/"

      <Directory "C:/path/to/your/files/public_html/">
            AllowOverride All
            Order allow,deny
            Allow from all
      </Directory>
</virtualhost>

Now edit your HOSTS file and add the following (note - the file maybe hidden and/or readonly, and it doesn't have a file extension):

127.0.0.1      cbsl.ddns.net

Save all your files and restart Apache (from the WAMPServer menu)

If you set it up the way I've outlined, then you should get your files served when you call your domain - if you include a folder at the end of your domain name, then make sure your files are in the folder, so if you call:

http://cbsl.ddns.net/cbsl/

then make sure you files are in:

C:/path/to/your/files/public_html/cbsl/
LeTay

ASKER
Thanks
I made all the changes you propose.
Now I get this :
You don't have permission to access /cbsl on this server.
Apache/2.4.9 (Win64) PHP/5.5.12 Server at cbsl.ddns.net Port 80
Chris Stanyon

Add a file in there and call it directly. For example - add in a file called index.html and then make sure you append that to the url - it will identify whether this is a problem with it not serving a default index page or not serving any page.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
LeTay

ASKER
There is already a index.php there but whatever I put in the URL, even an non-existing file, I get the same permission error
In my httpd-vhosts.conf, I added as said this, (unremark it in the httpd-conf file) and restarted the service :
<VirtualHost *:80>
      ServerName cbsl.ddns.net
      DocumentRoot "C:/wamp/www/"
      <Directory "C:/wamp/www/">
            AllowOverride All
            Order allow,deny
            Allow from all
      </Directory>
</VirtualHost>
ASKER CERTIFIED SOLUTION
LeTay

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
LeTay

ASKER
No other answer to the question did result in a 100 % solution
Tinotenda Ziramba

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Allow from all
</Directory>

this method worked for me. thanks so much.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck