Long story short: I installed Windows 7 on my laptop everything is fine with OS. I installed latest xampp. What i did next via help of google and stackoverflow:
system32/drivers/etc/hosts
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
::1 localhost
127.0.0.1 local.projects
httpd-xampp.conf (allow from all is commented couse it totally had no effect at all).
#
# New XAMPP security concept
#
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
Deny from all
Allow from ::1 127.0.0.0/8 \
fc00::/7 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 \
fe80::/10 169.254.0.0/16
#Allow from all
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>
And the main couse for the 403 being retrieved everywhere is i think THIS in httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot "D:/Web-Pages"
ServerName local.projects
ServerAlias local.projects
ErrorLog "logs/local.projects.log"
CustomLog "logs/local.projects.log" combined
<directory "D:/Web-Pages">
AllowOverride All
Allow from all
Require all granted
</directory>
</VirtualHost>
If there is anyhow you can point me to the right direction i would be very glad!
More info:
When i type in addressbar this "local.projects" or this "localhost" I get 403 like that:
Access forbidden!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster.
Error 403
localhost
Apache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.6
Okay, but when i access phpmyadmin at "localhost/phpmyadmin" everything works fine. When i add pressmission to the folders via Windows- nothing changes. Suggest any ideas how to get rid of these 403's please?
Do you have any pages in D:/Web-Pages directory? If this directory has no index page then it will show you 403 error.
If you have any page like, index.htm then try to browse http://localhost/index.htm.
Related
I'm attempting to setup a apache2 vhost in the latest version of Ubuntu and i keep getting a "Forbidden" when trying to access the page.
I have setup a folder for this new site under
/root/websites/panel.joosh.eu/www
And this has the owner/group of root:root so i can edit it and permissions of 644
This is my vhost file in sites-avaliable (yes i also enabled it)
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName panel.joosh.eu
ServerAdmin josh#joosh.eu
DocumentRoot /root/websites/panel.joosh.eu/www
<Directory /root/websites/panel.joosh.eu/www>
Order allow,deny
Allow from all
Require all granted
</Directory>
ErrorLog /root/websites/panel.joosh.eu/logs/error.log
CustomLog /root/websites/panel.joosh.eu/logs/access.log combined
Ive tried everything but i still get forbidden, any ideas?
sudo chown -R www-data:www-data /root/websites/panel.joosh.eu/www
your permission is wrong
Understanding and Using File Permissions
move your project folder to /var/www/html and try
Apache Server Unable to host multiple domain on single Public IP running on Windows Server 2016
Error:"Not Found The requested URL / was not found on this server." 404 Not Found
Progress so far :
1)Edited Windows hosts file "C:\Windows\System32\drivers\etc\hosts": to below
127.0.0.1 localhost
::1 localhost
127.0.0.1 koffeeroasters.com
2)Changes made in the httpd.conf file of apache is below
changed
#Include conf/extra/httpd-vhosts.conf
to
Include conf/extra/httpd-vhosts.conf
also changed
#LoadModule rewrite_module modules/mod_rewrite.so
to
LoadModule rewrite_module modules/mod_rewrite.so
and added to the end of the file the following
# Tells Apache to identify which site by name
NameVirtualHost *:80
# Tells Apache to serve the default WAMP Server page to "localhost"
<VirtualHost 127.0.0.1>
ServerName localhost
DocumentRoot "C:/wampstack/apache2/htdocs"
</VirtualHost>
# Tells Apache to serve Client 1's pages to "client1.localhost"
# Duplicate and modify this block to add another client
<VirtualHost 127.0.0.1>
# The name to respond to
ServerName koffeeroasters.com
ServerAlias www.koffeeroasters.com
# Folder where the files live
DocumentRoot "C:/wampstack/apache2/htdocs/koffeeroasters.com/"
# A few helpful settings...
<Directory "C:/wampstack/apache2/htdocs/koffeeroasters.com/">
Order Allow,Deny
Allow from all
# Enables .htaccess files for this site
AllowOverride All
</Directory>
# Apache will look for these two files, in this order, if no file is specified in the URL
DirectoryIndex index.html index.php
</VirtualHost>
Other details
I am using apache server on bitnami wampstack.
Site is available when typed the address "koffeeroasters.com" from the servers browser.
A reason for it which I know no solution of (refered from apache docs "https://httpd.apache.org/docs/2.4/vhosts/examples.html") :
Note :
Creating virtual host configurations on your Apache server does not magically cause DNS entries to be created for those host names. You must have the names in DNS, resolving to your IP address, or nobody else will be able to see your web site. You can put entries in your hosts file for local testing, but that will work only from the machine with those hosts entries.
Thanks a bunch. All help appreciated.
Try changing this:
<VirtualHost 127.0.0.1>
to
<VirtualHost *:80>
This means allow any other IPs connect on port 80, which should get you going. Trying to match the localhost is doing more than you probably need, unless you are public facing server, in which case you will not want to do this.
System: Windows7 64-bit
WAMP server 32-bit version: Apache : 2.4.9 MySQL : 5.6.17 PHP : 5.5.12 PHPMyAdmin : 4.1.14 SqlBuddy : 1.3.3 XDebug : 2.2.5
My issue is that when I navigate to my project "local.blamo1.com" - via WAMP "Localhost" chrome returns: "Oops! Google Chrome could not find local.blamo1.com"
I am able to access my project folder with "localhost/local.blamo1.com" - But as I understand it, this is bad practice as it will throw off server mapping by one directory. I would like to be able to access the project with the designated server alias. I have implemented the following...
httpd-vhosts.conf
Location: "C:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.config"
# Virtual Hosts
#
# Required modules: mod_log_config
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
<VirtualHost *:80>
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "c:/wamp/www">
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "c:/wamp/www/local.blamo1.com"
ServerName local.blamo1.com
ServerAlias local.blamo1.com
<Directory "c:/wamp/www/local.blamo1.com">
AllowOverride All
Require local
</Directory>
</VirtualHost>
hosts file
Location: "C:\Windows\System32\drivers\etc\hosts"
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
127.0.0.1 localhost
127.0.0.1 local.blamo1.com
#::1 localhost
#::1 local.blamo1.com
httpd.conf
Location: "C:\wamp\bin\apache\apache2.4.9\conf\httpd.conf
I have un-commented these lines
Include conf/extra/httpd-vhosts.conf
LoadModule vhost_alias_module modules/mod_vhost_alias.so
Current Diagnosis
Apache httpd -t return: "Syntax OK"
I think this has something to do with my DNS or ports, or whatev - as I do not have enough experience with this level or how the DNS is not able to resolve the domain:
after I tried to ping the project:
ping local.blamo1.com
"Ping request could not find host local.blamo.com. Please check the name and try again.
Please help me understand why I am getting this issue. I have been working on this for a day and a half. Apologies if there is not adequate information for your to make a diagnosis of the problem. I will provide more information as necessary.
All my best.
I was able to solve this issue - props to this post: http://www.tweaksforgeeks.com/windows7/2011/02/windows-7-hosts-file-ignored
The issue appeared to be a corrupted "hosts" files - all I know for sure was that the solution was to delete the hosts file and create a new one with raw text from the old. The causality is inexplicable.
This solve my problem. After hours of making it work. Turns out I was careless about the host file. Saving as txt and then just removing the extension to replace the original file.
I'm having issues loading VirtualHosts I've setup on my iMac, all that they appear to be returning are blank pages. I've tried multiple browsers, flushed my DNS cache, cleared browser cache etc but nothing appears to be fixing this.
Here is what my /etc/apache2/httpd-vhosts/conf file looks like:
NameVirtualHost *:80
<Directory "/Users/chris/Sites/test/">
Allow From All
AllowOverride All
</Directory>
<VirtualHost *:80>
ServerName "test.dev"
ServerAlias "test.dev.*.*.*.*.xip.io"
DocumentRoot "/Users/chris/Sites/test"
</VirtualHost>
Here is what my /etc/hosts file looks like:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
# VHX START
127.0.0.1 test.dev
fe80::1%lo0 test.dev
# VHX STOP
In my /private/etc/apache2/httpd.conf file I've made sure to uncomment the following line:
Include /private/etc/apache2/extra/httpd-vhosts.conf
I'm using VirtualHostX to manage all of this but I've even resorted to deleting everything in these files and starting again following guides online – that didn't work either.
I've tried to tail the apache access log and whenever I try to access http://test.dev nothing shows up in that file or the apache error log – it's as though my machine has absolutely no idea that URL exists even though I believe everything is setup correctly.
Any ideas on how I can fix this?
Thanks,
Chris
I'm setting up a dedicated server with multiple virtual hosts. The DNS is registered correctly...
$ ping mydomain.com
$ ping 8.8.8.8 (for example)
Both return the IP address as expected and it's correct.
The last line of my httpd.conf file is:
Include /etc/httpd/sites-enabled/
And the contents of mydomain.com.conf (in the above folder) are:
<VirtualHost 8.8.8.8:80>
ServerName mydomain.com
ServerAdmin jongosi#mydomain.com
# Indexes + Directory Root
VirtualDocumentRoot /var/www/html/mydomain.com
DocumentRoot /var/www/html/mydomain.com
<Directory "/var/www/html/mydomain.com">
Options FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
I suspected that the firewall was interfering with the access so I have disabled it with:
$ /etc/init.d/iptables stop
The server is running CentOS 6 64-bit with the latest LAMP stack.
Trying to go to the address http://www.mydomain.com/ or the IP address in browser both result in eventual time-out. Any suggestions would be helpful. Thank you!
EDIT 1
Running apachectl -S returns...
VirtualHost configuration:
8.8.8.8:80 mydomain.com (/etc/httpd/sites-enabled/mydomain.com.conf:6)
Syntax OK
EDIT 2
Following the request in Chrome's inspector returns a 204 header response.
204 No Content
The server successfully processed the request, but is not returning any content.
Thanks.
SOLVED
My hosting provider had configured their hardware firewall to only allow traffic through on port 22 (SSH). Why on earth would I NOT want traffic on my WEBSITE.
$_hosting_provider = "In.sane";