It's a bad idea to add localhost in the url of launching projects - Warning - wamp

I have a program called ‘project’ that I run from wamp, and everything goes correctly, the problem is that I'm getting the following warning every time I launch wamp:
It's a bad idea to add localhost in the url of launching projects. It is best to define VirtualHost in
wamp/bin/apache/apache2.4.37/conf/extra/httpd-vhosts.conf
file and not add localhost in the url.
I know there are similar questions with solutions, I have been reading several forums with solutions to solve the problem but I can not get the warning to disappear. In httpd-vhosts.conf I have the following:
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
Can you help me solve it? I get the same warning even if I replace 'localhost' in serverName and ServerAlias with: C:/wamp64/www/project/
My wamp version is 3.1.7 - 64bit:

Within c:\wamp64\wampmanager.conf under [options] you should see urlAddLocalhost = "on", try switching its value to off and restart WAMP.
I'm sorry that I couldn't find any documentation that explains it. I know it because I was looking for something that could link my projects directly from http://localhost and tracked this option from the WAMP scripts. When I enabled it the warning started to show.
PS.: I'm afraid this method I described works only for WAMPSERVER >v3.1

Related

AH01630: client denied by server configuration WAMP

I have seen alot alot of guides how to fox the AH01630 error and some httpd corrections and tweaks.
Surely some will be annoyed me asking for help on this specific topic but I was trying to figure out for hours how to fix my issue.
What did I do?
I have port-forwarded the required ports for Apache and MySQL
I installed WAMP on my computer
I tried to config. httpd
I read about 50 topics according to make my server public accessible
-
I tried to set up the whole thing on a fresh virtual machine
I reinstalled WAMP a few times
So what doesn't work?
The usual access refuse message: Forbidden You don't have permission to access / on this server.
-I found this in the error log: AH01630: client denied by server configuration
I have tried to fix the issue by my own and couldn't proceed further after hours, maybe I forgot a little detail or just something I have to know but I don't because I am uneducated in this specific area
Thanks in advance
Here are the logs and config, if you don't mind and know how to fix the problem send me the finished file
httpd.conf
apache_error.log http:// pastebin. com/YSZDc0tp
access.log http:// pastebin. com/xfwv5ebB
In WAMPServer 3+ there is a Virtual Host defined for localhost by default, and that is where you should make the access amendments and not in httpd.conf
So in httpd.conf replace
# onlineoffline tag - don't remove
Require all granted
</Directory>
With
# onlineoffline tag - don't remove
Require local
</Directory>
Edit \wamp\bin\apache\apache\apache2.4.18\conf\extra\httpd-vhosts.conf and replace Require local with Require all granted
EG
#
# Virtual Hosts
#
<VirtualHost *:80>
ServerAdmin webmaster#homemail.net
ServerName localhost
DocumentRoot E:/wamp/www
<Directory "E:/wamp/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

WampServer 3 Online Forbidden

When I try to access my local website from another device (connected with LAN), I get Forbidden error.
I tried to edit Apache's httpd.conf (as what google told me), repair vcredist packages, uninstalling wamp completely and installing (re-downloaded the latest version), deactivating Antivirus software (I am using BitDefender btw).
About 1 month ago, I was using windows 7 and wamp was working perfectly. After I upgraded to windows 10, I cleaned my pc and installed wamp. At first, I didn't need it's Online mode, but right now, I need it. So, I am open to all new ideas.
Note
-I can reach localhost with my pc (with LAN IP, Router IP and http://localhost)
-I am using Windows 10 Professional x64
-I looked at all of the similar questions and relevant pages on Google, and none of them worked for me
About 3 weeks ago, I started using a new router. Can it cause this problem? or maybe I couldn't install drivers correctly?
don't edit http.config instead edit httpd-vhosts.config
<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/wamp/www
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
change Require local to Require all granted. when it is Require local it can be accessed only through localhost request from other hosts are denied. Finally it looks like below
<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/wamp/www
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

403 forbidden when Django folder is located in /root

I'm trying to deploy my local Django site on my Ubuntu 12.04 server. I followed a tutorial, and everything seems to work fine, except Apache won't allow me to store my Django project under /root. More specifically, I get a 403 Forbidden when trying to access my site.
I suspect I need to configure my virtual host in a different manner. Any ideas?
Here is /etc/apache2/sites-available/mysite
<VirtualHost *:80>
ServerAdmin me#mysite.com
ServerName mysite.com
ServerAlias www.mysite.com
WSGIScriptAlias / /root/me/index.wsgi
Alias /static/ /root/me/static/
<Location "/static/">
Options -Indexes
</Location>
ErrorLog /var/log/mysite/error.log
</VirtualHost>
Thanks for the comments. I'll mark this as the correct answer for future reference.
I ended up moving the whole Django project to /home/anotheruser, and defined DocumentRoot as per Aamir Adnans suggestion. After service apache2 restart it started working.

Django / WSGI blank page

I am trying to get Django to work together with Apache using WSGI. The problem is that it simply returns an empty page (200 OK or 203 not modified).
I can't find any error upon restarting or when accessing the page in either error.log or django-error.log. There is an entry in django-access.log though.
WSGIPythonPath /web/django/dtest/
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot /web/django
ServerName django.markv.nl
<Directory />
Options FollowSymLinks Includes
AllowOverride All
</Directory>
WSGIScriptAlias /wsgi-scripts/ /web/django/dtest/dtest/wsgi.py
LogLevel info
ErrorLog ${APACHE_LOG_DIR}/django-error.log
CustomLog ${APACHE_LOG_DIR}/django-access.log common
</VirtualHost>
I tried using the manage.py runserver, in which case it works fine, so it's really an apache/wsgi problem.
I tried disabling mod_php5 with no result (except that PHP stopped working).
Any clues what the problem is or where I can find an error? It's probably something trivial but I fail to find it...
You're serving your application at /wsgi-scripts/, which seems an odd thing to do, so you'll need to go to that URL to see it.
Note that you absolutely certainly do not want to set your DocumentRoot to the location of your Django files, although this is not the source of your problem.

Trying to set up custom url (mysite.dev) using WAMP

Evening everyone,
Firstly, I apologize if this is the best location to ask this question so feel free to redirect me or this post :)
I have WAMP installed on C: but any projects will exist on a separate drive. I can create an alias to point to the correct directory just fine - no problem there. The problem lies in the fact that I want/need to have a custom URL assigned to each project (so instead of localhost/mysite it would be something similar to mysite.dev).
I found this article, but it's a bit old so I'm not sure if the information is still accurate. Here's what I have so far:
Edited hosts file to add domain - 127.0.0.1 mysite.dev
Edited WAMP's httpd.conf file to uncomment - Include conf/extra/httpd-vhosts.conf
Edited WAMP's httpd-vhost.conf file to add virtual host:
<VirtualHost 127.0.0.1>
DocumentRoot "d:/projects/mysite/"
ServerName mysite.dev
ServerAlias mysite.dev
<VirtualHost>
In the end this produces no errors, just a big fat 403 Forbidden Access "You don't have permission to access / on this server."
No idea where to go from here, this isn't exactly my area of expertise :P any and all help/tips are greatly appreciated! Thanks!
Try setting a port to listen for
<VirtualHost *:80>
DocumentRoot d:/projects/mysite/
ServerName mysite.dev
</VirtualHost>
After another hour or two I can actually answer my own question.
Someone on another forum mentioned that you need to keep a mention of plain ol' localhost in the httpd-vhost.conf file, so here's what I ended up with in there:
<VirtualHost *:80>
ServerName localhost
DocumentRoot "c:/wamp/www/"
</VirtualHost>
<VirtualHost *:80>
ServerName platypus.dev
DocumentRoot "d:/projects/test/"
<Directory "d:/projects/test/">
Options Indexes FollowSymLinks Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Exit WAMP, restart - good to go. Hope this helps someone else :)
Depending on which WAMP stack you're using, different, but very silimar configs in every stack. WAMP = (apache, mysql, php FOR Windows ... Win Ap My Php). There are different WAMP stacks, AMPPS, XAMPP, Bitnami.. You probably meaned WAMPserver (most people call it simply WAMP, but can mean also others, which has slightly different configs..)
If you're using WAMPserver, I think it's the easiest to config a "custom URL", that means virtual host. You just need to uncomment the vhosts config file in httpd.conf in apache's folder, and you already have a template of how to set virtual host in this file, there are 2 dummy hosts as examples. But, don't forget the Windows' "hosts" file, you need to set 127.0.0.1 [url_you_want] in your hosts file, and that [url_you_want] is the same in your apache vhosts config file as "ServerName"...