Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I was not able to view my custom vhost www.ajweb.dev in my apache2.

My www folder resided in /home/ajinkya/www

So I did following.

ajinkya@ajinkya-Inspiron-3521:~$ cd www
ajinkya@ajinkya-Inspiron-3521:~/www$ chmod 755 ./www
chmod: cannot access `./www': No such file or directory
ajinkya@ajinkya-Inspiron-3521:~/www$ chmod 755 ../www
ajinkya@ajinkya-Inspiron-3521:~/www$ sudo chmod 755 ../www
ajinkya@ajinkya-Inspiron-3521:~/www$ sudo useradd -g www-data ajinkya
useradd: user 'ajinkya' already exists
ajinkya@ajinkya-Inspiron-3521:~/www$ sudo chown -R www-data /home/ajinkya/www
ajinkya@ajinkya-Inspiron-3521:~/www$ sudo service apache2 restart
 * Restarting web server apache2                                                                                                                      Warning: DocumentRoot [/home/ajinkya/www/aj/ajweb] does not exist
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
 ... waiting Warning: DocumentRoot [/home/ajinkya/www/aj/ajweb] does not exist
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
                                                                                                                                               [ OK ]
ajinkya@ajinkya-Inspiron-3521:~/www$ cd /etc/apache2/
ajinkya@ajinkya-Inspiron-3521:/etc/apache2$ cd sites-enabled/
ajinkya@ajinkya-Inspiron-3521:/etc/apache2/sites-enabled$ ls
000-default  000-default~  ajweb.dev  ajweb.dev~
ajinkya@ajinkya-Inspiron-3521:/etc/apache2/sites-enabled$ sudo gedit ajweb.dev
ajinkya@ajinkya-Inspiron-3521:/etc/apache2/sites-enabled$ sudo service apache2 restart
 * Restarting web server apache2                                                                                                                      apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
 ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
                                                                                                                                               [ OK ]
ajinkya@ajinkya-Inspiron-3521:/etc/apache2/sites-enabled$ 

And now Im not able to view/open that folder manually.

enter image description here

ls -l /home/ajinkya | grep www
drwxrwxr-x 5 www-data ajinkya    4096 Sep 11 15:33 www
share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

It looks like your attempt to join the www-data group failed. Try this command sudo adduser ajinkya www-data

To verify you are in the www-data group, run groups and it should show up in the list. You may need to log out and back in.

Then you can change the permission to 775 (safer for a www directory) with sudo chmod -R 775 ~/www

share|improve this answer
    
I did this sudo chmod -R 775 /home/ajinkya/www –  STEEL Sep 12 '13 at 8:02
    
sudo chmod -R 777 /home/ajinkya/www –  STEEL Sep 12 '13 at 9:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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