Thread: Virtual hosts issues with apache2
hi,
have started working virtual hosts, , seemed alright. have 2 vhosts, default 1 , 1 created. removed them every indexes option found, because dont want apache browse folders, , works. it's change made in default config file. can see how sites-available files down here :
default
<virtualhost *:80>
serveradmin webmaster@localhost
documentroot /var/www/virtuals
<directory />
options followsymlinks
allowoverride none
</directory>
<directory /var/www/virtuals>
options followsymlinks multiviews
allowoverride none
order allow,deny
allow all
</directory>
scriptalias /cgi-bin/ /usr/lib/cgi-bin/
<directory "/usr/lib/cgi-bin">
allowoverride none
options +execcgi -multiviews +symlinksifownermatch
order allow,deny
allow all
</directory>
errorlog ${apache_log_dir}/error.log
# possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
loglevel warn
customlog ${apache_log_dir}/access.log combined
alias /doc/ "/usr/share/doc/"
<directory "/usr/share/doc/">
options multiviews followsymlinks
allowoverride none
order deny,allow
deny all
allow 127.0.0.0/255.0.0.0 ::1/128
</directory>
</virtualhost>
can see how removed indexes options, , make default point /var/www/virtuals, work there. let me show mydomain.com sites-available config file :
mydomain.com
<virtualhost *:80>
servername mydomain.com
documentroot /var/www/virtuals/mydomain.com
<directory /var/www/virtuals/mydomain.com/>
options followsymlinks multiviews
allowoverride all
</directory>
</virtualhost>
works great when put index.html file in /var/www/virtuals/mydomain.com. point want create 1 more level, httpdocs. want path : /var/www/virtuals/mydomain.com/httpdocs , can put html inside httpdocs folder. put index.html there , change mydomain.com config file, looks :
mydomain.com
<virtualhost *:80>
servername mydomain.com
documentroot /var/www/virtuals/mydomain.com/httpdocs
<directory /var/www/virtuals/mydomain.com/httpdocs/>
options followsymlinks multiviews
allowoverride all
</directory>
</virtualhost>
problem : i 403 forbidden in browser. why ? should have modify configuration work ? think i'm not understanding quite way default config file works ....
please help, in advance.
did check on original thread?
permissions folder , documents in folder?
apache needs permission read index.html.code:ls -alt /var/www/virtuals/mydomain.com/httpdocs/
entering in address bar?
if developing locally, simplest add sides in sub folders , keep default vhost file is.
able access site 1 (mydomain.com) like:
http://localhost/mydomain.com
site like, http://localhost/mydomain2.com , on.
mydomain.com , mydomain2.com subfolders in virtuals folder operating under default vhost file. way there no need reload apache when making new site.
need make sure subfolders , .html readable apache2.
Forum The Ubuntu Forum Community Ubuntu Specialised Support Ubuntu Servers, Cloud and Juju Server Platforms [ubuntu] Virtual hosts issues with apache2
Ubuntu
Comments
Post a Comment