Apache issue on Mac "You don't have permission to access / on this server" - apache

I have the following issue with Apache, I am trying to load a website locally, but I get a Forbidden error.
This is my configuration:
/etc/hosts:
127.0.0.1 nop33.local
/etc/apache2/httpd.conf:
Listen 80
<Directory />
Order allow,deny
Require all granted
# AllowOverride none
# Require all denied
</Directory>
DocumentRoot "/Users/nop33/dev"
<Directory "/Users/nop33/dev">
Options FollowSymLinks Multiviews
MultiviewsMatch Any
AllowOverride None
Require all granted
</Directory>
ErrorLog "/private/var/log/apache2/error_log"
/etc/apache2/extra/httpd-vhosts.conf:
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin nop33#example.com
DocumentRoot /Users/nop33/dev/project-name/public
ServerName nop33.local
<Directory /Users/nop33/dev/project-name/public>
Order allow,deny
Require all granted
</Directory>
</VirtualHost>

Related

403 Forbidden vhost Ubuntu

Trying to setup my webserver and allow .htaccess in all www directories. When accessing sub.domain.com on my laptop (with host files adjusted), returns a 403 Forbidden. "You don't have permission to access / on this server."
It feels like the .htaccess file is not allowed, and therefore throws the 403. But as per my understanding the settings are correct isn't? Am I overlooking something?
apache2.conf
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
AllowOverride All
</Directory>
domain.com.conf
<VirtualHost *:80>
ServerName domain.com
ServerAlias sub.domain.com
ServerAdmin webmaster#domain.com
DocumentRoot /var/www/domain.com/public_html/support/current
<Directory "/var/www/domain.com/public_html/support/current">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:443>
ServerName domain.com
ServerAlias .domain.com
ServerAdmin webmaster#domain.com
DocumentRoot /var/www/domain.com/public_html/support/current
<Directory "/var/www/domain.com/public_html/support/current">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Either /var/www/domain.com/public_html/support/current doesn't exist, or its rights are not correct for user Apache runs on. Check the User and Group settings in the main Apache config to find out what they are.
You might also want to check the error log to get additional clues.

Apache2 how to working www.example.com

I need help. I am sorry wrong write. My LAMP server i created virtual host working http://example.com a NOT WORKING http://www.exaple.com
<VirtualHost *:80>
DocumentRoot "/var/www/example/1/public_html"
ServerName example.com
ServerAlias www.example.com
ServerAdmin webmaster#localhost
<Directory />
Options FollowSymLinks
AllowOverride all
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
UseCanonicalName on
<Directory "/usr/lib/cgi-bin">
AllowOverride all
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
<Directory "/var/www/example/1/public_html">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
Considering that you have put a local mapping to example.com in /etc/hosts. Do you have same entry for www.example.com also?
example of the /etc/hosts entry:
127.0.0.1 example.com www.example.com
or
xxx.xxx.xxx.xxx example.com www.example.com
(xxx.xxx.xxx.xxx being your hosting server IP)

XAMPP Windows Apache vhosts not redirecting properly

<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/"
ServerName localhost
<Directory "C:/xampp/htdocs/">
Order allow,deny
allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/gl"
ServerName gl.dev
<Directory "C:/xampp/htdocs/gl">
Order allow,deny
allow from all
</Directory>
</VirtualHost>
The above is what I currently have in my vhosts file. When I hit localhost I want my root to open, but when I load gl.dev I want the individual site to open. Any ideas?
hosts file:
127.0.0.1 localhost
# ::1 localhost
127.0.0.1 gl.dev
I think in windows you have to use backslash when specifying document root. please try the following
<VirtualHost *:80>
ServerName localhost
ServerAlias *.localhost
DocumentRoot "C:\xampp\htdocs\"
<Directory />
#Options FollowSymLinks
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName gl.dev
ServerAlias *.gl.dev
DocumentRoot "C:\xampp\htdocs\gl"
<Directory />
#Options FollowSymLinks
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Restart WAMP server

virtually hosted typo3 site returns a 503 after backend logout

I am trying to host multiple typo3 managed sites on my remote webserver but whenever I logout from a brand new install I get a 503 error and can't get past that. but I can re-install a typo3 site from the same link. but the default typo3 installed which can be referenced via <www.mydomain_name.com/typotest> works fine. below is my default site setup:
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot /srv/www/
<Directory />
Options FollowSymLinks
AllowOverride all
</Directory>
<Directory /srv/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
############### All other demo sites ################
<VirtualHost *:80>
DocumentRoot /srv/www/site1/
ServerName www.site1.typotest.net
<Directory />
Options FollowSymLinks
AllowOverride all
</Directory>
<Directory /srv/www/WFS>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>
#ErrorLog ${APACHE_VHOST_LOG_DIR}/site1/error.log
#Loglevel warn
#CustomLog ${APACHE_VHOST_LOG_DIR}/site1/access.log combined
</VirtualHost>
######## Site2 ########
<VirtualHost *:80>
DocumentRoot /srv/www/site2/
ServerName www.site2.typotest.net
<Directory />
Options FollowSymLinks
AllowOverride all
</Directory>
<Directory /srv/www/Monassier>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>
#ErrorLog ${APACHE_VHOST_LOG_DIR}/site2/error.log
#Loglevel warn
#CustomLog ${APACHE_VHOST_LOG_DIR}/site2/access.log combined
</VirtualHost>
######## site 3 ########
<VirtualHost *:80>
DocumentRoot /srv/www/site3/
ServerName www.site3.typotest.net
<Directory />
Options FollowSymLinks
AllowOverride all
</Directory>
<Directory /srv/www/HandP>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>
#ErrorLog ${APACHE_VHOST_LOG_DIR}/site3/error.log
#Loglevel warn
#CustomLog ${APACHE_VHOST_LOG_DIR}/site3/access.log combined
</VirtualHost>
I will also say that I tried copying the .htaccess from the working site to the virtually hosted site but got no results. At this point I am at a loss as to what could be causing this.
Server OS is Debian Lenny and apache 2.2.16.
I would like to add that I have checked the error logs (php ones included) and all I see are access errors
As you are not getting a Apache error log entry, I presume you have got the maintanence mode enabled.
Check your localconf.php for the entry:
$GLOBALS['TYPO3_CONF_VARS'][BE][adminOnly] = 1;
and change it to
$GLOBALS['TYPO3_CONF_VARS'][BE][adminOnly] = 0;
Slight misunderstanding of the framework caused this. It turns out that I had installed a blank package instead of the introduction package. So I was getting the 503 due to there not being any frontend pages created in the blank, and I was trying to access the backend via the front end address.

AllowOverride for .htaccess on local machine giving 403 Forbidden

I have a mod_rewrite I'd like to use locally on my mac but when I change my configuration to in my directory tag I get a 403 Forbidden error. I've tried all the other solutions around but no luck.
Maybe somebody will see something I am not...
Here is the code:
httpd.conf
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>
<Directory "/Library/WebServer/Documents/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Which is overridden by myusername.conf
<Directory /Users/adrianmaurer/Sites/www>
Options Indexes MultiViews FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Virtual host file httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot /Library/WebServer/Documents
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /Users/adrianmaurer/Sites/www
ServerName myserver.dev
</VirtualHost>
I was able to get it fixed by setting my /etc/apache2/users/username.conf file like so (Note you have to change the Options line too, not just the AllowOverride):
<Directory "/Users/tlhunter/Sites/">
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>