|
||||||
| Forums FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Network/Internet Questions about internet applications, network configuration, usage (SAMBA, network printing, NFS) |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I am trying to set up a subdomain on my webserver, and from what I can tell, that is called a virtual host on Apache. I tried putting
Code:
NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot /srv/www/htdocs ServerName www.(site).info ServerAdmin root@(site).info <Directory /srv/www/htdocs> AllowOverride None Order allow,deny Allow from all </Directory> </VirtualHost> <VirtualHost *:80> DocumentRoot /srv/www/mail ServerName mail.(site).info ServerAdmin root@(site).info <Directory /srv/www/mail> AllowOverride None Order allow,deny Allow from all </Directory> </VirtualHost> |
|
|||
|
how would i set up a name based host. According to one of the sites i looked at, that is a name based host. Should I just replace the *:80 with site:80?
|
|
||||
|
You're right, I overlooked that (the joy of replying too fast while in a hurry)
I do not see much wrong with your config, but you way want to bind them to a specific address and also since these hosts run on one and the same machine, just under different names, you may want (or need) ServerAlias Docs over here: Name-based Virtual Host Support - Apache HTTP Server
__________________
My site: http://microchip.bplaced.net My repo: http://download.opensuse.org/repositories/home:/microchip8 SUSE Unbound Forum: http://suseunbound.lefora.com Do coders dream of sheep() ? |
|
|||
|
Could it just be as simple as restarting the httpd service after changing the Virtual Hosts? Any changes to the httpd.conf file require restarting the service.
Code:
sudo /etc/init.d/httpd restart |
|
|||
|
Bman22 wrote:
> I am trying to set up a subdomain on my webserver, and from what I can > tell, that is called a virtual host on Apache. I tried putting (...) > and no matter what subdomain i go to, it just takes me to the root > domain. I set the hostname settings to redirect mail.(site).info, and > www.(site).info to 127.0.0.1, and everything else is set the same as the > examples on the Apache2 website. Any idea why it isn't working? Maybe this helps :-) Apache Web Server & Virtual Host on openSUSE : Part 2 http://vavai.net/2009/03/02/apache-w...ensuse-part-2/ Greetings, -- Camaleón |
|
|||
|
Ok, that tutorial looks great, I will try it when I get home. I had tried restarting the Apache server, but it seems that I do need the extra stuff in that tutorial. Another question on this topic, is there a way to set the public html directory to be at (username).(site).com instead of (site).com/~(username)?
|
|
||||
|
Quote:
__________________
My site: http://microchip.bplaced.net My repo: http://download.opensuse.org/repositories/home:/microchip8 SUSE Unbound Forum: http://suseunbound.lefora.com Do coders dream of sheep() ? |
|
|||
|
from what i can tell, it is just the use of the "public_html" folder that is a compile option, but i think i will just set up virtual hosts for the users i have, unless somebody has a way to do it automatically
|
|
|||
|
I got virtual hosts working, but with one small problem. In order to get the server to go to the main domain name, i have to create another virtual host that loads the main site. Is there anyway to make it so that leaving no subdomain just takes it to the main site without creating a virtual host for it?
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|