0

So weird thing here, I can access my website using

ftp://username:password@192.168.1.214/godlysoftware/home.html

By obviously changing username and password to the ftp credentials.

BUT, I cannot view the website using the local machine IP

http://192.168.1.214/godlysoftware/home.html

I get Permission Denied Accessing /

This occurred after changing default root path from the /www/ in apache2 "000-default.conf" to my desire root path of my website: /godlysoftware/

Before this I was able to view the Apache 2 homepage before changing that default root directory.

I changed permissions in vsftpd.conf and only gained access through ftp and not the local IP itself.

Any idea?

1

Found my answer after asking around and research more.

FIRST but not recommended is:

"here is a review of the steps to take to open up access of /var/www for users (which will include the user's access when they use ftp). The example gives 'myuser' access.

  1. groupadd www_users
  2. usermod -a -G www_users myuser
  3. chown -R root:www_users /var/www
  4. chmod -R 2775 /var/www

find /var/www -type f -exec chmod 0774 '{}' \; Now myuser should have full access to create/remove/edit files and directories in /var/www, even when they connect via ftp. The key is in the setgid bit, so that group ownership is taken from the parent directory when a new file/dir is created. Thus assuring all users in the group always have access."

From: Source

Then, after I gained FTP Access I added all my website files into /var/www/html/ and changed my homepage name to index.html, named the default one to .old.

Then I did the following command in order to give access to groups and other users read and execute only permissions along with root to have all permissions.

sudo chmod -R 755 /var/www

Now if I visit my website VIA server ip: 192.169.1.214, it will show my websites home page.

Recursively change permissions to -rwxr-xr-x.

sudo chmod -R 755 /var/www

You should end up with the following permissions on all of the files in the directory. Root: read, write, execute Group: read, execute Others: read, execute

Remove read permissions on the folders you don't want users in the group or other to access (chmod 744 folder or chmod 700 folder). Just add the -R option to do it recursively. For more information on file and folder permissions, please read http://catcode.com/teachmod/summary.html. There are 3 pages to read through there.

From: Source

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.