Before marking this as answered, please read the entire thing because yes there is a good amount of these questions but NONE of the answers on them have worked at all.
Hosts File
127.0.0.1 localhost
127.0.0.1 abv
httpd.conf
<Directory />
AllowOverride none
Require all granted
</Directory>
index.php
echo "abc";
httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "/xampp/htdocs/abv"
ServerName abv
ErrorLog "abv-error.log"
CustomLog "abv-access.log" common
<Directory "/xampp/htdocs/abv">
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Access LOG
127.0.0.1 - - [21/Jul/2019:10:09:50 +0530] "GET / HTTP/1.1" 200 3
127.0.0.1 - - [21/Jul/2019:10:09:50 +0530] "GET /favicon.ico HTTP/1.1" 404 1053
These Setting are running perfectly and output is showing and now replacing with below
<VirtualHost *:80>
DocumentRoot "F:\Websites\abv"
ServerName abv
ErrorLog "abv-error.log"
CustomLog "abv-access.log" common
<Directory "F:\Websites\abv">
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Access LOG
127.0.0.1 - - [21/Jul/2019:10:09:57 +0530] "GET / HTTP/1.1" 200 384
127.0.0.1 - - [21/Jul/2019:10:09:57 +0530] "GET /favicon.ico HTTP/1.1" 404 1053
No out is showing WHY?
Related
I want to setup a virtual host in my localhost, so I can access my Laravel app like this: demo.example.com. I have added a custom conf file: etc/apache2/sites-available/example.com.conf with the following contents:
<VirtualHost *:80>
ServerAdmin username#gmail.com
ServerName example.com
ServerAlias www.example.com
ServerAlias demo.example.com
ServerAlias www.demo.example.com
DocumentRoot /var/www/example/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/example/public>
AllowOverride All
</Directory>
</VirtualHost>
Contents from /etc/hosts file:
127.0.0.1 localhost
127.0.1.1 username-pc
127.0.0.1 example.com
127.0.0.1 www.example.com
127.0.0.1 http://exaple.com
127.0.0.1 demo.example.com
With the above settings if I access the url demo.example.com it works. But if I try to access other routes like demo.example.com/login I get apache 404 error: The requested URL /login was not found on this server. How do I fix this?
Note that this is not laravel's NotFoundHttpException.
place this under your directory tag
<Directory /var/www/example/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
recently modified httpd.conf and httpd-vhosts.conf to add vhosts...
#IncludeOptional "E:/wamp/vhosts/*"
Include "E:/wamp/alias/*"
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "e:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "e:/wamp/www">
Options Indexes FollowSymLinks
AllowOverride All
Require local
Require ip 192.168.1
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot E:/activeWork/projects
ServerName projects.local
<Directory "E:/activeWork/projects">
Options Indexes FollowSymLinks
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot E:/activeWork/projects
ServerName www.projects.local
<Directory "E:/activeWork/projects">
Options Indexes FollowSymLinks
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot E:/activeWork/projects
ServerName api.projects.local
<Directory "E:/activeWork/projects">
Options Indexes FollowSymLinks
AllowOverride All
Require local
</Directory>
</VirtualHost>
after that when i try to load 192.168.1.6 or 127.0.0.1 , gives me :
Forbidden
You don't have permission to access / on this server.
i've tried to solve it whit this answer but not works for me
and by recommandation in answers i check my access.log and this is the result:
192.168.1.6 - - [03/Oct/2016:11:03:00 +0330] "GET / HTTP/1.1" 403 288
127.0.0.1 - - [03/Oct/2016:11:00:55 +0330] "GET / HTTP/1.1" 403 286
if you are sure that your wamp Installation path is inside E:
then I suggest you to check your access log and error log to collect more information.
I assume you are using Apache 2.4 or later on your Wampserver? If so, then replace the require rules with "Require all granted" in your vhosts, like this:
<VirtualHost *:80>
DocumentRoot "e:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "e:/wamp/www">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
If it still doesn't work, check if your firewall is blocking your access.
my problem is to define 3 vhost point to same directory and this confused apache...finally tnx to riggsfolly i fixed that...beside of this i make changes from this guide to define VHost to have setup things in a right way
My WAMP 3 vhost (vhost was setup with WAMP tool) stopped working, here are my particulars:
hosts file
127.0.0.1 localhost
::1 localhost
127.0.0.1 projectx
::1 projectx
http.conf
...
Listen 127.0.0.1:80
Listen [::1]:80
...
LoadModule vhost_alias_module modules/mod_vhost_alias.so
...
httpd-vhosts.conf
<VirtualHost *:80>
ServerName localhost
DocumentRoot C:/company/profordable/server/local/wamp/server/wamp64/www
<Directory "C:/company/profordable/server/local/wamp/server/wamp64/www/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName projectx
DocumentRoot c:/company/profordable/projects/projectx/www
<Directory "c:/company/profordable/projects/projectx/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
Here is the apache access log:
::1 - - [17/Aug/2016:17:53:34 -0400] "GET / HTTP/1.1" 302 3054
which I think means there is a redirect going on, because when I click the link to go to http://projectx/ it rests on the localhost main page.
Any help would be greatly appreciated. Nate
Before going on, let me say that I'm rather new to application protocols and do not fully understand how this world works ... :-)
This is the situation:
I have several sites being served by apache2.4.7 and those work
well when accessing apache on port 80.
On the other hand, I have only one site being served by tomcat7 and it's
also working well when accessing Tomcat on port 8080.
I tried to redirect traffic from apache on port 80 to that specific site on tomcat on port 8080 and cannot do it (getting a 404 error message).
I have also enabled the proxy and proxy_http modules, but nothing
changed
This is the sites-enabled file for apache:
<VirtualHost 10.10.61.10:80>
ServerAdmin webmaster#localhost
DocumentRoot /var/www
ServerName 10.10.61.10
<Directory />
Options None
AllowOverride None
</Directory>
Alias /racktables /var/www/racktables/wwwroot/
<Directory /var/www/racktables/wwwroot>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
<VirtualHost 10.10.61.10:80>
ProxyPreserveHost On
ProxyRequests Off
ProxyPass /app1/ http://10.10.61.10:8080/app1/
ProxyPassReverse /app1/ http://10.10.61.10:8080/app1/
</VirtualHost>
All the information that I have read only mentioned that adding the above configuration regarding the proxy* parameters nothing more, nothing less.
However, when looking at the access.log of apache, I get the following:
10.10.61.62 - - [10/Nov/2015:11:32:00 -0300] "GET /app1 HTTP/1.1" 404 410 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0"
What is it that I'm missing? Any ideas or hints?
Thanks!
Lucas
Well, after some digging, the solution was to include everything under the same virtualhost such as this:
<VirtualHost 10.10.61.10:80>
ServerAdmin webmaster#localhost
DocumentRoot /var/www
ServerName 10.10.61.10
<Directory />
Options None
AllowOverride None
</Directory>
Alias /racktables /var/www/racktables/wwwroot/
<Directory /var/www/racktables/wwwroot>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ProxyPreserveHost On
ProxyRequests Off
ProxyPass /app1/ http://10.10.61.10:8080/app1/
ProxyPassReverse /app1/ http://10.10.61.10:8080/app1/
</VirtualHost>
Regards!
Lucas
I have a working site at on the Top level of a domain, I now want to add a subdomain on the same domain and the same server.
The files for this site are located in the public html folder (/var/www/html)
I have the following virtualhosts/directory config in httpd.conf
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin support.portal#somesite.com
DocumentRoot /var/www/html/joomla3
ServerName support.somesite.com
ErrorLog logs/support.somesite.com_error.log
CustomLog logs/support.somesite.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin support.portal#somesite.com
DocumentRoot /var/www/html/moodle
ServerName support.somesite.com/moodle
ErrorLog logs/moodle.error.log
CustomLog logs/moodle.access.log common
</VirtualHost>
<Directory "/var/www/html/moodle">
DirectoryIndex index.php
AcceptPathInfo on
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
No errors are reported on the start/restart of httpd
Nothing is reported in the httpd error log. The below entry is shown in the Access log so the request is reaching the webserver but appears to be not being handled properly by the webserver.
192.168.4.202 - - [05/Jan/2015:12:49:14 +0000] "GET /moodle HTTP/1.1" 404 290
I have configured something similar before but I can't figure out the problem here. I might have missed something obvious, Can you see where the problem is, Thanks?
I am running CentOS 6.5 for reference.