Jump to content
 
 

I am runinng a LAMP stack with Apache/2.4.18 (Ubuntu). I am hosting a very basic site. I don't have a .htaccsess set up and am using Vhost for everything. The site was working just fine then all of the sudden I get a

   403 You don't have permission to access / on this server.

I was messing around with the sites-enabled configuration files while trying to add a subdomain. (I was unsuccessful) I did not touch the Vhost for the main domain. In fact I have never touched that Vhost. Now though I get a 403 error. WHY?? Here is the config file I was talking about

     <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.
# www.christophersites.com

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html


 ServerName christophersites.com    

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.christophersites.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
</VirtualHost>
Link to comment
https://linustechtips.com/topic/786675-403-error-for-no-reason/
Share on other sites

Link to post
Share on other sites

Firstly, I can't see any of the text without highlighting it...

Pop this under the DocumentRoot 
 

<Directory "/var/www">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

 

Secondly, have you setup the permissions for the apache user for that folder?
 

Thirdly, have you created the virtual host for ssl?

Link to comment
https://linustechtips.com/topic/786675-403-error-for-no-reason/#findComment-9917024
Share on other sites

Link to post
Share on other sites

5 minutes ago, leonfagan71 said:

Firstly, I can't see any of the text without highlighting it...

Pop this under the DocumentRoot 
 


<Directory "/var/www">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

 

Secondly, have you setup the permissions for the apache user for that folder?
 

Thirdly, have you created the virtual host for ssl?

idk about permissions but ssl no

Link to comment
https://linustechtips.com/topic/786675-403-error-for-no-reason/#findComment-9917049
Share on other sites

Link to post
Share on other sites

1 hour ago, TheComputerdude said:

idk about permissions but ssl no

Okay, It's not recommended at all but run this command as root
chmod -R 777 /var/www/
It basically gives full read and write access to the /var/www folder to all users.
Then let me know if you still get forbidden messages.
If you do then we will need to dig into the configuration of Apache more.

Otherwise, we'll need to just fix the permissions for the folders.

Link to comment
https://linustechtips.com/topic/786675-403-error-for-no-reason/#findComment-9917368
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×