4

Right about now I'm going out of my head trying to set up my development environment on my new laptop. I did this on my old laptop in 15 minutes back in July, but this time it's stumping me.

I setup Apache, and everything worked. Then I altered the document root from /var/www & added 3 ports in my ports.conf like this:

NameVirtualHost *:80
NameVirtualHost *:591
NameVirtualHost *:8008
NameVirtualHost *:8080
Listen 80
Listen 591
Listen 8008
Listen 8080


<VirtualHost *:80>
  ServerName 127.0.0.1
  DocumentRoot /home/devon/code/http/080-main
</VirtualHost>

<VirtualHost *:591>
  ServerName 127.0.0.1
  DocumentRoot /home/devon/code/http/591-fsr
</VirtualHost>

<VirtualHost *:8008>
  ServerName 127.0.0.1
  DocumentRoot /home/devon/code/http/8008-port
</VirtualHost>

<VirtualHost *:8080>
  ServerName 127.0.0.1
  DocumentRoot /home/devon/code/http/8080-port
</VirtualHost>

...now, I get 403 errors at every port. So I've been Googling this and that led me to chown the directories so www-data group can access them. That didn't help though. So I chmod'd the directories to 755, 775, 777... but none of that helped. I even found an answer that led me to chmod my /home to 751 (recursively) and still nothing changed. So if it's not a permissions or a group problem, what else could it be?

As you can see, the permissions look correct?

drwxr-xr-x  2 devon www-data 4.0K 2011-10-07 08:33 080-main/
drwxr-xr-x  8 devon www-data 4.0K 2011-10-04 00:57 591-fsr/
drwxr-xr-x  2 devon www-data 4.0K 2011-10-07 08:45 8008-port/
drwxr-xr-x  2 devon www-data 4.0K 2011-10-07 08:46 8080-port/

(I know the ports work, 'cause when I go localhost:678369, which is not a port I specify, then it doesn't reach the server, whereas the localhost:591 & the other ports I specified, reaches the server & returns a 403. So I know Apache's working & that the configuration files are working correctly.)

UPDATE as requested:

drwxr-xr-x  6 devon www-data 4.0K 2011-10-07 15:31 http

& the files within...

drwxr-xr-x  6 devon www-data 4.0K 2011-10-07 15:31 .
drwx------ 14 devon devon    4.0K 2011-10-07 08:39 ..
drwxr-xr-x  2 devon www-data 4.0K 2011-10-07 08:33 080-main
drwxr-xr-x  8 devon www-data 4.0K 2011-10-04 00:57 591-fsr
drwxr-xr-x  2 devon www-data 4.0K 2011-10-07 08:45 8008-port
drwxr-xr-x  2 devon www-data 4.0K 2011-10-07 08:46 8080-port
3
  • This is almost certainly a permissions issue. Could you update your post with an ls -lah of the code and http directory? Oct 7, 2011 at 22:51
  • Updated the post. I'm thinking you're right, but I cannot see what permissions are wrong or how I should alter them. I've been at this most of the day. I feel like a newbie all over again.
    – Forrest
    Oct 7, 2011 at 23:12
  • Crazy thing I just noticed & tried... the code directory was CHMOD'd 700... so I changed it to 755 and everything's working now! I got that whole directory from a tar.gz, which was straight from my old laptop. It worked there, so I'm guessing the tar.gz backup didn't back it up with the same permissions of a normal directory?
    – Forrest
    Oct 7, 2011 at 23:28

1 Answer 1

3
cd /home/devon; find -type d -exec chmod 0755 {} \;

4
  • Tried that. Didn't fix it.
    – Forrest
    Oct 7, 2011 at 22:41
  • This pretty much fixed it but I had to alter it... chmod 755 /home/devon/code , so thanks! Your ideas helped! Not sure why that directory was chmod'd wrong though or why that affected Apache getting into a deeper directory. I'll figure that one out another time though. Thanks!
    – Forrest
    Oct 7, 2011 at 23:30
  • @Forrest I've updated my answer to show how you can change all directories in a given sub-folder, and all sub-folders below that, to 755. Glad you're issue is resolved! Oct 7, 2011 at 23:35
  • This really fixed it on my newly installed Ubuntu 18.10 ! Thanks. I was stuck at this for weeks.
    – anjanesh
    Mar 17, 2019 at 11:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .