Hi,
I got my AMP stack running a few days ago and was wanting to get more into it. But am having problems with virtual hosts in apache.
I am just doing testing on my LAN at the moment. But will probably go with something like dyndns if I can get everything working.
Apache2 is working fine, I can see the test page, even MySQL and PHP5 are working, and it only took a couple tries :P I installed bblog to test out the MySQL and PHP5.
My original directory structure was:
/usr/local/apache2/htdocs < apache test page in there
/usr/local/apache2/htdocs/blog < bblog in there
I could access both fine by just using my IP, 192.168.1.110 for the test page, and /blog for the bblog.
I like the subdomain way better, ie
www.mydomain, blog.mydomain but I cannot get it working. Is it not possible to do this by IP on a LAN?
I have changed my directory structure around to make a little more sense:
/usr/local/apache2/htdocs/www < is document root
/usr/local/apache2/htdocs/www/www < apache test page
/usr/local/apache2/htdocs/www/blog < bblog
Here are the important parts of my httpd.conf:
### Section 1: Global Environment
ServerRoot "/usr/local/apache2"
Listen 80
### Section 2: 'Main' server configuration
ServerName 192.168.1.110
DocumentRoot "/usr/local/apache2/htdocs/www"
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "/usr/local/apache2/htdocs/www">
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>
### Section 3: Virtual Hosts
<VirtualHost *>
DocumentRoot "/usr/local/apache2/htdocs/www/www"
ServerName
www.192.168.1.110
</VirtualHost>
<VirtualHost *>
DocumentRoot "/usr/local/apache2/htdocs/www/blog"
ServerName blog.192.168.1.110
</VirtualHost>
Am I doing something wrong there? I also tried what I found at this site,
http://www.megalinux.net/archives/649.html, but couldn't get it to work, so tried just making a virtualhost for each subdomain I wanted, found here,
http://ubuntuforums.org/archive/index.php/t-394618.html Can you only use virtual hosts if you actually have a domain assigned to you? Or is it possible to do it by IP? Or do I just have it all wrong? I'm betting on the last one, thats why I'm asking you guys :P