One IP, One Site

mvtimes

Verified User
Joined
Jan 10, 2011
Messages
27
Hello all,

I'm just getting started with DirectAdmin and I have two questions about setting up a site. I've done several searches here, but can't seem to find an answer.

I only need one site and wish to use the server IP for it. So, question 1, do I need to setup a reseller and then users or can I just use the "user level" access page from the main admin account? (This seems to have worked, but I'm unsure if it's a good practice)

Second, setting up a dummy domain (I am just using the IP address for now) works but can only be accessed via http://xx.xx.xx.xx/~user/

Is there a way in DA to have the server IP default to the public_html of the main user so that http://xx.xx.xx.xx/ displays the index.html page? (Right now just using the ip gives me a blank page with "Apache is functioning normally")

Any help would be greatly appreciated.

Thanks.
 
If you're planning to use one site, there is no need to create any other user or reseller. You can add domain to admin account. Remember in this case to change FTP-password for admin for more secure. Because if your FTP password to admin account will be stolen, a hacker can get access to your directadmin.

You can change DocumentRoot "/var/www/html" in /etc/httpd/conf/httpd.conf to feet your needs in order to switch from displaying "Apache is functioning normally".
 
Thanks for the quick response. That all seems simple enough.

However when I edit the httpd.conf file, changing the DocumentRoot and subsequent <Directory> entries from "/var/www/html" to the desired directory, I am unable to restart Apache from the DA admin. I recieve a simple error screen with "/sbin/service httpd start 2>&1"

I am guessing this file needs to reflect the changes also:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf

But in the httpd.conf comments it says not to edit those as they are written by DA.

It seems like a step is missing. Any ideas?

Thanks.
 
Scratch the above. There was an issue with the hosting company.

So now I have made the httpd.conf changes, but still see the "Apache is functioning normally" when accessing just the IP.

Any ideas?
 
The main IP# is always set up as shared. So it works only as name-based hosting, or as you've noticed, with the ~username construct.

Set up a real domain name and it should just work.

Or for testing put a record into your local (desktop/laptop) system's hosts file to match up your IP# with www.example.com, and then type:
Code:
http://www.example.com
into your browser; it should work.

Jeff
 
That seems to be working. Thank you.

One tangential question ... in my hosts file I put xx.xx.xx.xx example.com and when I enter http://example.com in my browser it is showing me the home page as if I had entered http://xx.xx.xx.xx/~user (example.com is assigned to user in DA). How is that able to happen but the straight IP (without the HOSTS file) doesn't?

Second question, once the site is up and running and the domain name servers are updated, there won't be anything special to do in regards to users emails will there? For instance, [email protected] will get their email without any other changes, correct?
 
One tangential question ... in my hosts file I put xx.xx.xx.xx example.com and when I enter http://example.com in my browser it is showing me the home page as if I had entered http://xx.xx.xx.xx/~user (example.com is assigned to user in DA). How is that able to happen but the straight IP (without the HOSTS file) doesn't?

That's how, it works. See /etc/httpd/conf/extra/httpd-vhosts.conf and /etc/httpd/conf/ips.conf

Second question, once the site is up and running and the domain name servers are updated, there won't be anything special to do in regards to users emails will there? For instance, [email protected] will get their email without any other changes, correct?

Not sure, I've got your question. You need to create email boxes just before, you''ll able to send and receive emails.
 
One tangential question ... in my hosts file I put xx.xx.xx.xx example.com and when I enter http://example.com in my browser it is showing me the home page as if I had entered http://xx.xx.xx.xx/~user (example.com is assigned to user in DA). How is that able to happen but the straight IP (without the HOSTS file) doesn't?

When you type example.com in your browser, it gets to your server as a host-header, which apache uses to figure out which virtual configuration to use. When you just enter the IP#, there's no such host-header, and apache defaults to the main configuration for the IP#.

Read up on it here (apache.org).
Second question, once the site is up and running and the domain name servers are updated, there won't be anything special to do in regards to users emails will there? For instance, [email protected] will get their email without any other changes, correct?
Already responded to by user zEitEr.

Jeff
 
Back
Top