0

I am having a problem with a test page I set up for my website. The config file (index.html) looks like this

<html>
<head>
<title>Welcome to website.net!</title>
</head>
<body>
<h1>Success! The website.net virtual host is working!</h1>
</body>
</html>

Which should display a page like this in my browser when I navigate to www.mywebsite.net

Welcome to website.net!


<h1>Success!  The website.net virtual host is working!</h1>

However I get a 403 "forbidden" error when I navigate to the page. What am I missing? I have the directory installed on /var/www/mywebsite.net/public_html/index.html

I have the permissions of the /var/www directory set to 755 so that others can read and exicute it but it does not seem to be working. I also have port 80 open on my iptable. The server is a VPS server if that makes a difference however I have added a DNS record for the ip address.

Any help is appreciated!

UPDATE: Here is my virtual host configuration file "mywebsite.net.conf"

<VirtualHost *:80>
# Admin email, Server Name (domain name), and any aliases
ServerAdmin webmaster@mywebsite.net
ServerName  www.mywebsite.net
ServerAlias mywebsite.net
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /home/myusername/public/mywebsite.net/public
# Log file locations
LogLevel warn
ErrorLog  /home/mysuername/public/mywebsite.net/log/error.log
CustomLog /home/myusername/public/mywebsite.net/log/access.log combined
<Directory /home/myusername/public/mywebsite.net/public>
Options Indexes ExecCGI Includes FollowSymLinks MultiViews
AllowOverride All
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>

2 Answers2

0

Since your virtual host file has a .conf extension, then I guess you are using 13.04 or 14.04, or maybe you just updated apache to apache 2.4.

In your case, you need to remove the following two directives:

Order Deny,Allow
Allow from all

and replace them with the following directive

Require all granted

For a more detailed info, please look at my other answer which explains what needs to be changed after upgrading apache2.2 to apache2.4.

Dan
  • 14,180
0

if you want to run apache under your user

first edit /etc/apache2/envvars and look for

export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data

change www-data to your user, restart apache2 after that, let me know if it work