Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I just purchased a domain on Dreamhost, let's say I already have hosting, let's say at, and have setup a directory which is accessible at I can set the DNS to point to that IP, but how do I route it to that folder once it's there? My hosting has a really bad cPanel that gives me almost no help. Can I use .htaccess, or something else? What's the best way to accomplish this?

Edit in response to comment(s): It's VPS hosting, so I have access to http.conf and other system files. Also, yes it's Apache.

share|improve this question
Assuming Apache for a second, you would have to create an entry in the httpd.conf or create a site configuration file under sites-available for which is where the control panel comes in. In a hosting situation on a shared server, you will not have access to these files. Otherwise, you might. What is your hosting situation? It may also help someone answer your question if you can tell us what control panel you have access to. – closetnoc Mar 24 '14 at 0:11
Edited question in response to your comment :) – MattDiamant Mar 24 '14 at 0:51

2 Answers 2

up vote 1 down vote accepted

It has been a while since I have had to do this so I am a bit rusty. Please excuse any errors.

Here are some Apache documentation links:

Here are some other reousrces that seem to be good:

It seems like the default installation of Apache needs less configuration since earlier versions. It may be safe to assume that it will answer to requests on the server IP address and port 80.

There are several configuration files to be considered. You can find them in /etc/apache2 or /etc/local/apache2, and the directories sites-available and sites-enabled under the apache2 directory.

The sites-available/default file is the default configuration for your server. If you create no other sites, then this is the only site that will be served. If you only have one site, it is okay to modify this file. Common modifications would be to change the <directory /var/www/> directive to change the directory and to change the AllowOverride from None to All to allow the use of .htaccess files. It would be fine to expect to deploy a website within the /var/www/ directory and it should work.

Otherwise, if you want to host more than one site, then in the /etc/apache2/sites-available directory, create a site configuration file often named using the following scheme domain-name.tld.conf. Here is an example configuration:

<VirtualHost *:80>
SuexecUserGroup "#<user id>" "#<group id>"
DocumentRoot /home/
ErrorLog /home/
CustomLog /home/ combined
AddHandler cgi-script .php
DirectoryIndex index.php index.html
<Directory /home/>
Options -Indexes +IncludesNOEXEC +FollowSymLinks
allow from all
AllowOverride All

The <user id> and <group id> need to be replaced with the user id and group id of the user that owns the site. The home, www, and log, directories have to be created in the /home directory and chown, chgrp, and chmod may need to be used to change the ownership and permissions of these directories.

When you are done, create a symbolic link with the same name of the config file you created in the sites-enabled directory pointing to the configuration file you just created.

That should do it. If I missed a step or something needs to be explained better let me know. I will add more or change anything I need to help.

share|improve this answer

Thanks to closetnoc for leading me on the right path by mentioning sites-available.

I used these two articles to solve it:

share|improve this answer
Glad you got it! I had to run away for a short while and was just answering your question when your answer popped up. You might want to get used to the Apache documentation which can be a bit hard to digest at first. – closetnoc Mar 24 '14 at 2:02
Thanks for your help. If you'd like to answer, your answer will probably be more knowledgeable than me just linking to two answers, and I'll give you the green check. – MattDiamant Mar 24 '14 at 2:28
Thanks Matt. I am hoping this answer is helpful to someone in the future. If you need more help, let me know. – closetnoc Mar 24 '14 at 5:21
I actually am having some trouble. is working fine, but is not. In Dreamhost's DNS settings, I have set A records for with name www and blank name. In my vhost file, I have ServerName and ServerAlias * Pinging reveals that it's still going to Dreamhost, and pinging goes to Pretty sure it's a DNS problem, and I'd like to get www working, along with, etc. – MattDiamant Mar 24 '14 at 18:09
Typically, you would have an A record for the and create a CNAME for www pointing to Then in the Apache config you would have ServerName and ServerAlias like I have it above. Is this the case in your scenario? – closetnoc Mar 24 '14 at 18:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.