LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-06-2013, 12:33 PM   #1
conflicker
Member
 
Registered: Sep 2011
Posts: 89

Rep: Reputation: Disabled
Apache 2 wildcard subdomain


Hi everybody,

I'm running Linux Ubuntu 11 on my local machine and able to install LAMP and it works properly. I create a Virtual Host for me to run example.local on my local machine, and it's working very well.

Now, the problem is I'm trying to setup wildcard for the domain so it will look like something sub1.example.com. I tried to put *.example.com for ServerName of my VirtualHost but it's no good.

Please help if you have any idea, that would be much appriciated.

Thank you,

Conflicker
 
Old 02-06-2013, 02:11 PM   #2
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,200

Rep: Reputation: 397Reputation: 397Reputation: 397Reputation: 397
have you tried removing the *. and just using .example.com?
such as
Code:
<VirtualHost *:80>
DocumentRoot "/document/root"
ServerName .gotdns.com
<Directory "/document/root">
AllowOverride All
allow from all
Options +Indexes
</Directory>
</VirtualHost>
no I haven't tried that to know whether or not it works, but it's worth a shot.
 
Old 02-06-2013, 06:32 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
You can't use wildcards for ServerName, but you can for ServerAlias
Code:
ServerAlias eu.example.com us.example.com www*.example.com
 
Old 02-06-2013, 09:01 PM   #4
freelinuxtutorials
Member
 
Registered: Oct 2009
Posts: 70

Rep: Reputation: 21
you can try something like this on your conf

<VirtualHost 192.168.1.100:80>
DocumentRoot “/var/www/html/flt/subdomains”
ServerName freelinuxtutorials.com
ServerAlias *.freelinuxtutorials.com
<Directory /var/www/html/flt/subdomains>
Options Includes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache subdomain help Orange Sunshine Linux - Newbie 8 11-24-2009 05:10 PM
Apache - wildcard ssl dedicated ipaddress for each subdomain? sysconfig Linux - Server 2 04-02-2007 02:04 PM
Apache 1.3.33 and subdomain fai Linux - Software 1 07-15-2005 04:49 AM
subdomain and apache ziggie216 Linux - Newbie 1 11-12-2003 03:36 PM
Subdomain and apache! eXor Linux - Networking 1 10-13-2002 06:49 PM


All times are GMT -5. The time now is 02:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration