Ubuntu, Apache, virtualhost and Access forbidden - apache

I made virtualhost like: here. My directory is in my home folder. When I try to enter my new domain or anywhere I get 403 error:/
What happened?

You can give the details of the error in the log file
/var/log/apache2/error_log
apache probably need read access to the following documents:
/home/.htaccess
/home/user/.htacces
[...]
/home/user/path/to/project/.htaccess

I answer this question in the case you are still stuck.
I presume that you have set the permissions the correct way. The next step is to check if your home folder is encrypted? If so this might be your problem. Put you files in an folder outside of the home folder and give the permissions needed to access the folder.

Related

How can I fix my homepage showing a 403 error?

I keep getting a 403 error on my homepage, despite having all my permissions set to allow public to read. I'm not using any plugins, I'm not using Wordpress, and though my site is routed through Cloudflare it goes through to my hosting provider's 403 page (I haven't created my own). I've tried 755 and 644 and I keep getting the same thing. How can I fix this?
(The website is alexbelman.com)
There are several possible reasons depending on your hosting environment and a bit more detailed info from you about your hosting setup would help. For example - is your site on a server running Linux? cPanel?
But maybe this info can help you in the meantime:
If you're sure you have the correct permissions on folders (in most cases your public_html folder should be 750, all folders within the public_html folder in most cases should be 755, and files should be 644) then probably the first two things I would check would be:
Make sure you have an index file in your public_html folder - some examples would be index.html , index.htm , index.php , or on some hosts a default.html is used. If there is no index file in the folder that serves your site, server security configs will often present a 403 while protecting the sensitive contents of your hosting account from being viewed.
If you're sure you have an index file in your public facing folder, then check the contents of the .htaccess file in your public_html folder, since an errant rule or line of code in your htaccess is a common cause for a 403
If you can post the contents of your .htaccess file here someone here or possibly myself can spot anything that shouldn't be there or is incorrect.
Also, since you're using CloudFlare you should take a look at their Quick Fix suggestions here - https://community.cloudflare.com/t/community-tip-fixing-error-403-forbidden/53308

Why WHMCS shows permission error after applying its security tips even when permission is 777?

I've installed WHMCS on my hosting space and did its security tips regarding to its document. I've moved templates_c, downloads, and attachments fot one level above public_html (I'm using DirectAdmin control panel) and set their permissions to 777. After it, I put these lines in configuration.php file:
$templates_compiledir = "/home/mysite.com/templates_c/";
$attachments_dir = "/home/mysite.com/attachments/";
$downloads_dir = "/home/mysite.com/downloads/";
But now, when I want to open WHMCS, I get this error:
Permissions Error
The templates compiling directory '/home/mysite.com/templates_c/' must be writeable (CHMOD 777) before you can continue.
If the path shown is incorrect, you can update it in the configuration.php file.
I've tested the below formats for configuration.php file too, but they did not work:
/domains/mysite.com/templates_c/
/home/domains/mysite.com/templates_c/
Please help me.
level above public_html for DirectAdmin:
/home/[USERNAME]/domains/[mysite.com]/
insert this code for DirectAdmin in configuration.php file:
$templates_compiledir = '/home/[USERNAME]/domains/[mysite.com]/templates_c/';
$attachments_dir = '/home/[USERNAME]/domains/[mysite.com]/attachments/';
$downloads_dir = '/home/[USERNAME]/domains/[mysite.com]/downloads/';
I searched and searched all over for an answer on this and finally figured it out. At least in my server environment for WHMCS (Rackspace Cloud Sites) you need to enter the absolute path to the file, not the relative path to the file as is demonstrated in the WHCMS example.

viewing folders named 'public_html'

I've just altered wamp to use my external hard drive to use a folder in there as the DOcumentRoot.
The problem being, as all my sites are in seperate folders ie i:/www/sitename/public_html/
the folder public_html is not showing and I cannot access it. Is there a setting somewhere maybe in the htconf so I can access these folders.
regards
Phil Jackson
If your WAMP config has an entry along these lines:
UserDir public_html
I believe you will have to remove it. If not, or if that doesn't help, we probably need some more details about your config, and exactly what is happening.

Access error uploading file using winsp

I am trying to upload two files to a webserver so my teacher can see it. I am using winsp since my filezila doesnt work. But for some reason it is telling me that i don't have access to that page. Can anyone tell me why is it doing that.Here is a picture of my screen.
I am just not understanding why it is telling me that i don't have to access it.
If I had to take a guess, that public_html folder is your public directory where you should put things that anybody can get to (like through a browser). You have your files outside of that directory, so your page can't access them.
edit:
It's an educated guess, as I have seen a fair amount of server configurations that name the public web folder as such (other common names are "www" and "httpdocs")
Problem definitly isn't in code. There is error while uploading files. Can you connect to FTP regulary? If you can. Look for Active or Passive file transfer to FTP. Also if you can upload files, files must be in public_html folder to be visible from browser.
Active or passive
First read Neal comment.
second, you should probably copy the files into the /public_html folder, instead of the / (root) folder.

How Come Everybody Can See My Private Files?

Sorry for the newbie question...
When I go to http://www.plans4boats.com/scripts/youtubeplayer/ in Google Chrome, I can see a full listing of the files there. What should I do if I don't want any old hacker to just come in and view/copy my source codes? Does it have something to do with htaccess?
I discovered that putting a blank index.html file in the folder helps for THAT folder, but it still leaves all subfolders vulnerable.
What should I google for more information on how to set up my server to prevent this?
Just set Options -Indexes for that particular directories either in an .htaccess file or a <Directory> or <Location> container.
What you need to do is turn of Directory Listing for your specific server. I don't know what server you're using so I can't walk you through it, but just google your server name and how to disable directory listing.
I created a file called .htaccess and put the following contents:
IndexIgnore /