Solved

Ubuntu & Wordpress: setting wildcard domain?

Posted on 2010-11-16
4
516 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 500 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to insert an Iframe into WordPress. 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 : Open Page or Post…

688 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