Apache 2.4.9 Virtual Host on WAMP port 100 On Windows 10 503 error - apache

I keep getting a 503 error when I try to set up a virtual host. I can set up an aliased folder just fine, but no luck on the virtual host setup.
My hosts file looks like this:
127.0.0.1 localhost
::1 localhost
127.0.0.1 appmarket.local
::1 appmarket.local
My vs-hosts file looks like this:
<VirtualHost *:100>
DocumentRoot "C:/nanomarketvhost/local"
ServerName appmarket.local
ServerAlias appmarket.local
ErrorLog "logs/appmarket-error.log"
CustomLog "logs/appmarket-access.log" common
<Directory "C:/nanomarketvhost/local">
AllowOverride All
Options Indexes FollowSymLinks
Require local
</Directory>
</VirtualHost>
<VirtualHost *:100>
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias localhost
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
<Directory "C:/wamp/www">
AllowOverride All
Options Indexes FollowSymLinks
Require local
</Directory>
</VirtualHost>
I have commented out the lines in the httpd.conf to load virtual hosts.

Related

laravel 5.3: setup virtual host. Getting Apache 404 error

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>

Xampp Apache 2.4 VirtualHost not working

I have xampp with apache 2.4 on windows 10.
i have this configuration in my C:\xampp\apache\conf\extra\httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
ServerAlias www.localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/site3/web"
ServerName site3.localhost
ServerAlias www.site3.localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/site2/web"
ServerName site2.localhost
ServerAlias www.site2.localhost
</VirtualHost>
I added in my hosts file:
127.0.0.1 site2.localhost
127.0.0.1 site3.localhost
127.0.0.1 www.site2.localhost
127.0.0.1 www.site3.localhost
When i browse http://site2.localhost i see xampp root index.
When i browse http://site3.localhost i see again xampp root index.Same with www.site2.localhost...
What am I doing wrong?
A quick bit of info on Virtual Hosts. If you set one up and when you try and use it it sends you to the first Virtual Host, normally localhost it means there is something wrong with the Virtual Host definition or the HOSTS file, or you have entered the url incorrectly.
Apache will use the first VH defined in the file as the default site.
First remove these 2 lines from the HOSTS file
127.0.0.1 www.site2.localhost
127.0.0.1 www.site3.localhost
The HOSTS file should look like this
127.0.0.1 localhost
127.0.0.1 site2.localhost
127.0.0.1 site3.localhost
::1 localhost
::1 site2.localhost
::1 site3.localhost
Now each Virtual Host definition should also include some access rights like this
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/site3/web"
ServerName site3.localhost
ServerAlias www.site3.localhost
<Directory "C:/xampp/htdocs/site3/web/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/site2/web"
ServerName site2.localhost
ServerAlias www.site2.localhost
<Directory "C:/xampp/htdocs/site2/web/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

wamp server put online for anyone to access

Hi ive been attempting to set up a wamp server so people can access it for testing
everything works correctly on my pc and i believe i have everything set up correctly but noone can connect to the site as it cant be reached
i have opened port 80 on my router and my firewall
my hosts file is as follows
127.0.0.1 localhost
::1 localhost
127.0.0.1 bandicam.com
127.0.0.1 ssl.bandisoft.com
127.0.0.1 btcGame.local
::1 btcGame.local
my httpd-vhosts.conf is as follows
#
# Virtual Hosts
#
<VirtualHost *:80>
DocumentRoot "g:/wamp/www"
ServerName localhost
ServerAlias localhost
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
<Directory "G:/wamp/www">
AllowOverride All
Options Indexes FollowSymLinks
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName btcGame.local
ServerAlias www.btcGame.local
DocumentRoot "c:/wamp64/www/btcgame"
ErrorLog "logs/btcGame-error.log"
CustomLog "logs/btcGame-access.log" common
<Directory "/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
is there any other things i need to change in order to get my website online?
Other people trying to access your computer should know where to look.
Your server should then be referenced in the hosts file of their machine, except that IP should be resolvable such as
your.local.ip btcGame.local

Message: Forbidden You don't have permission to access / on this server

I get this message.
I have 4 applications of which 3 work fine and the fourth not.
hosts file looks like this (* used to sensor application names)
127.0.0.1 Out*****Series
::1 Out*****Series
127.0.0.1 M****Us
::1 M****Us
127.0.0.1 Paed
::1 Paed
127.0.0.1 Me****AQ
::1 Me****AQ
httpd-vhosts.conf setup like this
<VirtualHost *:80>
DocumentRoot "E:\WEB\Out*****"
ServerName Out*****Series
<Directory "E:\WEB\Out*****">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "E:\WEB\M****Us"
ServerName M****Us
<Directory "E:\WEB\M****Us">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
>>>>>>>>>>>>>THIS IS THE ONE GIVING ME THE FORBIDDEN MESSAGE -> OTHERS WORK
<VirtualHost *:80>
DocumentRoot "E:\WEB\Paed"
ServerName Paed
<Directory "E:\WEB\Paed">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "E:\WEB\Me****AQ"
ServerName Me****AQ
<Directory "E:\WEB\Me****AQ">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
What am I missing.
I did the net stop dnscache and net start dnscache.
I did restart all services in Wamp.
I restarted the machine. Still other 3 apps work, this one not.
Please help the blind to see again.

dns points to wrong directory

I'm trying to setup two virtual hosts in windows using xampp. From what I've read one have to alter the windows hosts file and xampp's httpd-vhosts.conf file.
hosts file:
127.0.0.1 gholizadeh
127.0.0.1 doostr
127.0.0.1 localhost
vhosts file:
NameVirtualHost *:80
<VirtualHost gholizadeh>
DocumentRoot "E:\xampp\htdocs\lowkey\pappa"
ServerName gholizadeh.se
ServerAlias www.gholizadeh.se
<Directory "E:\xampp\htdocs\lowkey\pappa">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost doostr>
DocumentRoot "E:\xampp\htdocs\lowkey"
ServerName doostr.com
ServerAlias www.doostr.com
<Directory "E:\xampp\htdocs\lowkey">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost localhost>
DocumentRoot "E:\xampp"
ServerName localhost
<Directory "E:\xampp">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
But I'm having problem accessing these files. When I try it from my own LAN I get prompted to the xampp site and when get access denied when trying to enter it from extern network. What am I doing wrong?
You got the VirtualHost command wrong. Use it like this instead:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName gholizadeh.se
ServerAlias www.gholizadeh.se
DocumentRoot "E:\xampp\htdocs\lowkey\pappa"
<Directory "E:\xampp\htdocs\lowkey\pappa">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName doostr.com
ServerAlias www.doostr.com
DocumentRoot "E:\xampp\htdocs\lowkey"
<Directory "E:\xampp\htdocs\lowkey">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName localhost
DocumentRoot "E:\xampp"
<Directory "E:\xampp">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Some more things:
* you should add a ServerAdminto each host
* the entries in the host file are just for internal debugging purposes, I assume?
And a side remark:
you don't plan to serve real web pages in the internet from this MS-Windows system, do you?