• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

Apache 2 - Trying to configure subdomains.

aeioa

n00b
Joined
Feb 7, 2004
Messages
11
Hello all,

I am having some trouble configuring my subdomains properly on Gentoo Linux with Apache 2.0.50.
Right now my current set up is as follows:

- Router (192.168.1.1)
- Main Computer (XP - 192.168.1.100)
- 'Server' (Gentoo - 192.168.1.102)

I have a NoIP address, for argument's sake, we can say it is:
example.no-ip.com.

I want to set the subdomains up so that:
example.no-ip.com points to /var/www/htdocs
-and-
test.example.no-ip.com points to /home/username/public_html/test

This is what my current setup looks like, I have no idea if this is correct or not.

NameVirtualHost 192.168.1.1:8080

<VirtualHost 192.168.1.1:8080>
ServerName example.no-ip.com:8080
DocumentRoot "/var/www/htdocs"
ServerAlias example
</VirtualHost>

<VirtualHost 192.168.1.1:8080>
ServerName test.example.no-ip.com:8080
DocumentRoot "/home/username/public_html/test"
ServerAlias test
</VirtualHost>

I've been trying to do this for hours to no avail, and it's really bothering me that I can't figure it out. Any help from any webmasters would be great.
Thanks :)
 
Setting the port line to "port 8080" should do it. You can't specify ports per vhost (I could be wrong as I haven't actually tried it, but with the way vhosts work I don't see how you could)..

Try something like this....

<VirtualHost 192.168.1.1>
ServerAlias www.test.example.no-ip.com test.example.no-ip.com
ServerAdmin webmaster@test.example.no-ip.com
DocumentRoot /home/user/blahblha/public_html
*optional*BytesLog domlogs/test.example.no-ip.com-bytes_log
ServerName test.example.no-ip.com
*optional*User tp
*optional*Group tp
*optional*CustomLog domlogs/test.example.no-ip.com combined
*optional*ScriptAlias /cgi-bin/ /home/tp/public_html/cgi-bin/
</VirtualHost>
 
Just tried your suggestion, and it didn't work :(

I forgot to mention in my earlier post that it does serve the documents, e.g.:
If I go to example.no-ip.com, I will see /var/www/htdocs
If I go to test.example.no-ip.com, I also see /var/www/htdocs

I don't get it. :(
 
aeioa said:
<VirtualHost 192.168.1.1:8080>
ServerName example.no-ip.com:8080
DocumentRoot "/var/www/htdocs"
ServerAlias example
</VirtualHost>

<VirtualHost 192.168.1.1:8080>
ServerName test.example.no-ip.com:8080
DocumentRoot "/home/username/public_html/test"
ServerAlias test
</VirtualHost>

I've been trying to do this for hours to no avail, and it's really bothering me that I can't figure it out. Any help from any webmasters would be great.
Thanks :)

Try taking out the port numbers all together and replace the 192.168.1.1 with a *...such as:
<VirtualHost *>
ServerName test.example.no-ip.com
DocumentRoot "/home/username/public_html/test"
ServerAlias test
</VirtualHost>

I'm not 100 percent sure that will work, but its how one of the servers where I work is set up to an extent.

Let me know if that works...
 
Nope, this didn't work either, murph.
I really wish I knew why it doesn't work properly.:\
 
End of this thread.
The vhosts and subdomains worked fine...

after I realized I hadn't uncommented #Include /conf/vhosts/vhosts.conf.
>_<

Thanks for the help everyone.
 
aeioa said:
End of this thread.
The vhosts and subdomains worked fine...

after I realized I hadn't uncommented #Include /conf/vhosts/vhosts.conf.
>_<

Thanks for the help everyone.

D'oh !? Erm, yeah, that would do it.

Congrats
 
lmao :D Good to know it was an easy fix..

I have some rather complex vhost examples. Shoot me a pm if your interested ;)
 
Back
Top