[Techtalk] Stumped - accessing site on local server

Sheila Fenelon sheila at shefen.com
Sun Feb 10 20:56:24 UTC 2013


Billie Walsh wrote:
> <VirtualHost *>
>       ServerAdmin bilwalsh at swbell.net
>       ServerName cslsa
>       DocumentRoot /home/billie0w/public/cslsa/
>       <Directory />
>               Options FollowSymLinks
>               AllowOverride None
>       </Directory>
>       <Directory /home/billie0w/public/cslsa/>
>               Options Indexes FollowSymLinks MultiViews
>               AllowOverride None
>               Order allow,deny
>               allow from all
>       </Directory>
> 
>  (/VertualHost)
> 
> Everything goes fine through the enable and restart of Apache2. But when
> I try to access the site from another computer I get:
> 
> 
>  Forbidden
> 
> You don't have permission to access /~cslsa/ on this server.
> 
> ------------------------------------------------------------------------
> Apache/2.2.22 (Ubuntu) Server at 192.168.1.125 Port 80
> 
> The permissions for the site are:
> 
> Owner = Me/user [ not root ] Read/Write
> Group = Read
> Other = Read
> 
> The sites files have the same permissions.
> 
> What am I doing wrong?
> 

I assume you have not activated UserDir on the server and are attempting to use a URL
like  http://xxx.xxx.xxx.xxx/~cslsa/

If that is incorrect then ignore the rest of this and post your userdir.conf

Otherwise, in the VirtualHost file the ServerName directive will let the server
respond to requests for

http://cslsa/

but that's not a real domain name, so you can fake it by adding a line to the
/etc/hosts file on the client machine

xxx.xxx.xxx.xxx cslsa

where xxx.xxx.xxx.xxx is the IP address for the server. Of course for this to always
work you want the server's IP address to be static, so you might need to make
adjustments to your network settings to ensure the server is always given the same IP.

On the server, edit the /etc/hosts file and add cslsa to the line that defines
localhost. Something like this

127.0.0.1 localhost cslsa

--
Sheila Fenelon
http://www.shefen.com/



More information about the Techtalk mailing list