Solved

Ubuntu & Wordpress: setting wildcard domain?

Posted on 2010-11-16
4
499 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
  • 3
4 Comments
 
LVL 19

Accepted Solution

by:
Barthax earned 500 total points
Comment Utility
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
Comment Utility
"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
Comment Utility
Thanks a lot for this precise answer!
0
 
LVL 19

Expert Comment

by:Barthax
Comment Utility
No problem - glad to help. :)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In Part I (http://www.experts-exchange.com/Web_Development/Blogs/WordPress/A_8410-Getting-Started-In-WordPress-Part-I.html), I introduced you to the powerful WordPress backend, the WordPress administrative Dashboard.  In Part II, I will introduce yo…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…

728 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now