12 Jan, 2009, tphegley wrote in the 1st comment:
Votes: 0
Ok. I took the plunge and bought a linode account to create a free mud host for players (much like Zeno's site). I am using Ubuntu 8.10 and I am having trouble figuring out how to set up websites. I have installed webmin, I created a new domain server for a doman name that I own. I created the path that I wanted the website to link to and when I set the A record from my domain name to my server IP, the site just went to the regular /var/www directory and not the directory that I wanted it to go.


Does anyone have any advice to give me as to where I need to set up the new domain? I have searched on google and haven't quite found what I was looking for. Nothing seems to work with ubuntu or it is outdated and it doesn't work now.

Thoughts?
12 Jan, 2009, elanthis wrote in the 2nd comment:
Votes: 0
Ubuntu puts individual site configs in /etc/apache/sites-available (and then you link to them in /etc/apache/sites-enabled). Pretty standard Apache configuration from there. I have no clue what Webmin does for that stuff. If you opted to use Webmin, you probably should be asking on their support forums, as they probably have better answers.
12 Jan, 2009, tphegley wrote in the 3rd comment:
Votes: 0
Ok, I've tried just editing files but it's still not working. Here is my default file which is the /var/www/:

<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>


and here is the generated webmin file:
<VirtualHost www.mysite.com>;
DocumentRoot "/my/path/public_html/"
<Directory "/my/path/public_html/">
allow from all
Options +Indexes
</Directory>
</VirtualHost>


Now I tried to copy/paste the default file and put my settings to it, but that didn't work either.

**EDIT**

I don't mind hand editing files. I'm fine with that, but it didn't seem to work so I must have messed up somewhere. I don't have to use webmin.
12 Jan, 2009, ShadowsDawn wrote in the 4th comment:
Votes: 0
Ubuntu, being based on the Debian release, makes use of the Debian way of handling Apache.

http://www.control-escape.com/web/config...
http://www.debian-administration.org/art...

In short, you create your virtual host file. then use a2ensite *insert path and name of virtual host file*

a2dissite disables
a2enmod is for modules
a2dismod is disabling modules

Edit** added another example link.
12 Jan, 2009, tphegley wrote in the 5th comment:
Votes: 0
ShadowsDawn said:
Ubuntu, being based on the Debian release, makes use of the Debian way of handling Apache.

http://www.control-escape.com/web/config...

In short, you create your virtual host file. then use a2ensite *insert path and name of virtual host file*

a2dissite disables
a2enmod is for modules
a2dismod is disabling modules


Thanks for that. I had just found it from this site: http://articles.slicehost.com/2008/12/11...

and it works now. Thanks for your help guys.
13 Jan, 2009, tphegley wrote in the 6th comment:
Votes: 0
Ok, guess I didn't figure it out. I have two sites I am wanting to run and I have pointed them both to my IP and then set up the sites-available then a2ensite'd them. They both point to the same site and my default which I didn't change points to the same as well. So the default doesn't direct to /var/www/ (which is shows that directory path in the file) but rather to my first site's path (which is not in the default directory).

Here's some output:
*/etc/apache2/sites-available# /etc/init.d/apache2 reload
* Reloading web server config apache2
[Tue Jan 13 02:54:55 2009] [warn] VirtualHost www.legendsofold.com:0
overlaps with VirtualHost www.loohosting.com:0, the first has precedence,
perhaps you need a NameVirtualHost directive
[ OK ]
*:/etc/apache2/sites-available# ls
001-legends 002-loohosting default default-ssl
*:/etc/apache2/sites-available# cd ../sites-enabled
*:/etc/apache2/sites-enabled# ls
000-default 001-legends 002-loohosting
*:/etc/apache2/sites-enabled#


default site is shown in my first post.

001-legends is here:
<VirtualHost www.legendsofold.com>;
DocumentRoot "/my/path/public_html/"
<Directory "/my/path/public_html/">
allow from all
Options +Indexes
</Directory>
</VirtualHost>


Here is 002-loohosting
<VirtualHost www.loohosting.com>;
DocumentRoot "/var/www/"
<Directory "/var/www/">
allow from all
Options +Indexes
</Directory>
</VirtualHost>


All three sites link to /my/path/public_html.

loohosting and the default are supposed to link to /var/www/
13 Jan, 2009, ShadowsDawn wrote in the 7th comment:
Votes: 0
When I was doing mine I ended up having to just roll both virtual host things into one file. Here is a copy of mine, all I did was c&p this as a new entry, and modified it to what I wanted. Just had to change ServerName. Like in the second copy I'd had pastebin.my-website.com

NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@localhost
UserDir www
ServerName www.my-website.com
DocumentRoot /path/to/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /path/to/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place

</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined
ServerSignature On

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>
13 Jan, 2009, tphegley wrote in the 8th comment:
Votes: 0
What does UserDir mean? Do I need to keep it www?

Got the information from here:

http://httpd.apache.org/docs/2.0/mod/mod...
13 Jan, 2009, tphegley wrote in the 9th comment:
Votes: 0
Ok. Here's my file:
NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@localhost
UserDir public_html
ServerName www.my-website.com
DocumentRoot /home/user/public_html/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/user/public_html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# # This directive allows us to have apache2's default start page
# # in /apache2-default/, but still have / go to the right place

</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# # Possible values include: debug, info, notice, warn, error, crit,
# # alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined
ServerSignature On

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>


and here is my output:
*/etc/apache2/sites-available# a2ensite 001-loohosting
Enabling site 001-loohosting.
Run '/etc/init.d/apache2 reload' to activate new configuration!
*:/etc/apache2/sites-available# /etc/init.d/apache2 reload
* Reloading web server config apache2
[Tue Jan 13 03:40:23 2009] [error] VirtualHost *:80
– mixing * ports and non-* ports with a NameVirtualHost
address is not supported, proceeding with undefined results
[Tue Jan 13 03:40:23 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
[ OK ]
*:/etc/apache2/sites-available#


So I guess it has something to do with lines 2 and 3 in my file.
13 Jan, 2009, ShadowsDawn wrote in the 10th comment:
Votes: 0
It may have to do with the white space being different? Not entirely sure, as I've ot hd that problem pop up. My stuff worked more or less out of the box, very little alterations needed.
13 Jan, 2009, tphegley wrote in the 11th comment:
Votes: 0
Is that what your default looks like as well?
13 Jan, 2009, ShadowsDawn wrote in the 12th comment:
Votes: 0
my default is disabled entirely.
13 Jan, 2009, tphegley wrote in the 13th comment:
Votes: 0
Hrm..well, I got it to work somehow. I'm not really sure how I did it. Here's my loohosting file:

NameVirtualHost www.loohosting.com
<VirtualHost www.loohosting.com>;
ServerAdmin webmaster@localhost

DocumentRoot /home/username1/public_html/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/username1/public_html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>


and here is my legends file

<VirtualHost www.legendsofold.com>;
ServerAdmin webmaster@localhost

DocumentRoot /home/username/public_html/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/username/public_html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>


Only difference is the first line. Why does that make the difference?
13 Jan, 2009, ShadowsDawn wrote in the 14th comment:
Votes: 0
I honestly have no idea, lol. But at any rate, glad to hear it is working for you now.
0.0/14