?
Solved

Ubuntu & Wordpress: setting wildcard domain?

Posted on 2010-11-16
4
Medium Priority
?
524 Views
Last Modified: 2012-05-10
Hi,

I'm a Linux noob ...

So I've managed to install Wordpress on my new Ubuntu server but now I want to activate the WP Network option. In order to do this I need to set a domain wildcard for my Ubuntu server

This page (http://codex.wordpress.org/Migrating_Multiple_Blogs_into_WordPress_3.0_Multisite) tells me to do this:

Create a wildcard subdomain. This should be as easy as going into cPanel and creating a subdomain named *.

But I don't have cPanel ... I'm working on a local server.

So how would I do this (I'm connected to my Ubuntu server via PuTTY)? Step by step please, as I don't know much about the Linux CLI ...

Thank you very much!

Jerome
0
Comment
Question by:Xeronimo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 19

Accepted Solution

by:
Barthax earned 2000 total points
ID: 34162637
Having some vague understanding of cPanel, I expect the translation for you would be to set up a NameVirtualHost for your Apache.  Once you have a NameVirtualHost with corresponding VirtualHost tag, you can add a ServerAlias to the VirtualHost tag which accepts the wild card domain.

Command-line via PuTTY without much experience... I'm hoping you've settled on using a text editor you are comfortable with as you'll need to dip into text files to change them.  I'm also going to assume you have some base knowledge of directory navigation (ls & cd command particularly).

First, get a feel for your Apache 2 configuration folder and its layout (almost everything you do in for apache2 configuration will need to be done as root - get used to "sudo" before everything or use "sudo su" to run the terminal as root).  Base directory is /etc/apache2 and the main configuration file is apache2.conf.  Open that up & check at the bottom of the file - there should be (standard Ubuntu install) the directive "Include /etc/apache2/sites-enabled/".  If so, then you should find a pair of directories under the apache2 folder - sites-available and sites-enabled.  The idea behind the layout is you create all your sites in the sites-available folder and then create a symbolic link (symlink) to the configuration in the sites-enabled folder.

Check your sites-available folder & you should find a "default" file.  Open that up & check what is inside - I don't have a default anymore & it has been a long time since I did so I can't remember the content, sorry.  Anyway, you're likely to change it all. :)  In there you should find a NameVirtualHost at the top and a <VirtualHost *> tag underneath.  Inside the <VirtualHost *> tag you should find the name of your domain next to the ServerName directive.  Add a line underneath there with the ServerAlias directory and the wildcard you need.  So, for example, if the wildcard you need is *.mydomain.com use:

ServerAlias *.mydomain.com

Save the change.  Check in the sites-enabled folder and confirm the symlink is there for default (it should be if still base install).  Check your configuration is acceptable to Apache 2:

apache2ctl configtest

If that returns "Syntax OK" then you can ask Apache 2 to restart with the new config:

apache2ctl restart

Suggested further reading:
Apache Virtual Hosts documentation: http://httpd.apache.org/docs/2.0/vhosts/
Apache NameVirtualHost directive: http://httpd.apache.org/docs/2.0/mod/core.html#namevirtualhost
0
 
LVL 19

Expert Comment

by:Barthax
ID: 34162647
"Add a line underneath there with the ServerAlias directory"
should have been
"Add a line underneath there with the ServerAlias directive"
0
 

Author Closing Comment

by:Xeronimo
ID: 34170878
Thanks a lot for this precise answer!
0
 
LVL 19

Expert Comment

by:Barthax
ID: 34172523
No problem - glad to help. :)
0

Featured Post

Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Transferring a wordpress site from a host or local dev server to another host can be a pain. So I've included my steps on how I have accomplished this task. Steps include an assumption that you have Cpanel access or Ftp access.. If you do not hav…
WordPress can be pretty daunting, especially for a beginner, so I thought it might be a good idea to write an article to show how easy it is to get started in WordPress and to design a custom theme.  The first step is to check with your hosting comp…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…
Suggested Courses

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question