Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 02-06-2013, 12:33 PM   #1
Registered: Sep 2011
Posts: 92

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 I tried to put * for ServerName of my VirtualHost but it's no good.

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

Thank you,

Old 02-06-2013, 02:11 PM   #2
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,227

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
have you tried removing the *. and just using
such as
<VirtualHost *:80>
DocumentRoot "/document/root"
<Directory "/document/root">
AllowOverride All
allow from all
Options +Indexes
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
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,411

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
You can't use wildcards for ServerName, but you can for ServerAlias
ServerAlias www*
Old 02-06-2013, 09:01 PM   #4
Registered: Oct 2009
Posts: 70

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

DocumentRoot “/var/www/html/flt/subdomains”
ServerAlias *
<Directory /var/www/html/flt/subdomains>
Options Includes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all


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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:45 PM.

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